|
If you delete and they reappear, then yuor app is running fine, your code has an issue. The error, I'm not sure, depends where this object is coming from. This sort of error usually means a broken config file IMO.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
If this sort of error usually means a broken config firl IMO, are there any solution for fix it ?
VB.Net
|
|
|
|
|
I want to read a file into a program bit by bit not by bytes. I attempted to use the binary reader it returned byte instead of bit. I don't really want an example as much as i would like to know the class or function i should be using to do so.
I don't know if maybe i need to convert the number returned by the binary reader to binary in order to do so. I would assume there is another way to do this.
The file types are all file types so i'm not talking about just text files. Images, executables, text files, ect. I would like to be able to read those bit by bit.
Any help would be appreciated.
modified on Tuesday, August 12, 2008 10:00 PM
|
|
|
|
|
ibigpapa wrote: I want to read a file into a program bit by bit not by bytes. I attempted to use the binary reader it returned byte instead of bit. I don't really want an example as much as i would like to know the class or function i should be using to do so.
I don't know of any such class or function and I would be suprised if it is part of the standard .net library because computers are designed to work on whole bytes not bit by bit.
ibigpapa wrote: I don't know if maybe i need to convert the number returned by the binary reader to binary in order to do so. I would assume there is another way to do this.
Computers always store numbers as binary so there is no need to convert anything. You can find out the bits by using 8 bitwise AND operation per byte. This example uses standard numbers but I would recommend you look up binary and bitwise operations so you can understand why this example works. It goes something like this:
result = byte AND 1
result = byte AND 2
result = byte AND 4
result = byte AND 8
result = byte AND 16
result = byte AND 32
result = byte AND 64
result = byte AND 128
Each time test if result is > 0. If it is then the bit is 1 if not then it is zero.
|
|
|
|
|
hi
the System.Collection namespace contains a BitArray Class.
there are usefull methods for your problem.
regards
|
|
|
|
|
I'm trying to build a card game (who didn't do that once). And I'm struggling with the images.
Obviously all of the card face images are different, but the card back images are all the same.
Why would you make 52 copies of the same image in memory? So I'm trying to hold the card back image in a common place that all of the cards can access, and just use a pointer to it. I'm having some trouble using pointers in vb. they seem to be relatively easy to use sometimes and I can't figure them out other times. One other question that I had is about passing ByRef. If you pass a reference and assign it to a variable, what is being assigned? Is it the reference or another copy of what the reference points to?
I appreciate any help on this. I'm sure they're common questions but I'm having a hard time finding answers.
|
|
|
|
|
On the first part, what version of vb are you using? VB and vb.net have a different way of handling graphics. Also vb.net doesn't have pointers because they aren't really necisary and would screw up the garbage collector.
Here's the easiest way to think of byval and byref: if you pass something byval then the called function/sub makes a new copy of the variable and copies the value into it. If you make any changes to that variable it won't effect the original variable. With byref it is exactly the same variable so any changes you make effect the original. For instance:
public sub Sub1 ()
dim x as integer
x = 2
Sub2 (x)
'if passed byval x = 2
'if passed byref x = 4
end sub
private sub Sub2 (x as integer)
x = 4
end sub
The only tricky part if arrays and objects because they are reference types not value types. In those cases the name of the array or object is really a pointer and when you pass them byval you are making a new pointer to the items they contain not new copies of all the items so a change in one can effect the other in some cases.
|
|
|
|
|
Thank you for responding.
Visual Basic is tricky when it comes to this stuff. What i'm finding is that the runtime takes care of most of these fine details. And you should only spend so much energy on it. Especially when you are talking about making 52 different copies of something. From what I've found VB won't let that happen.
But as far as the byval and byref information... It is a very good explaination. Thanks for helping me clear all that up.
|
|
|
|
|
I have big matrices of single precision data. I want to operate on that data using array processing. How can I do that as fast as possible? What data format should the data be put into to make them as small as possible (to load into RAM)? Are there assembly type routines I can call from vb.net to increase the array processing speed?
Thanks!
|
|
|
|
|
cstrader232 wrote: Are there assembly type routines I can call from vb.net to increase the array processing speed?
Nope. Your question isn't really answerable since you haven't provided any details at all about what you're tried, the performance you're getting, and what you expect.
|
|
|
|
|
OK, agreed, lousy question. Let me think about it and try again later.
|
|
|
|
|
Let say I have a web-site http://www.TrialXML.com, in that site I have a folder \database and my MS Access database file Trial.mdb having a table Purchasing and having 2 columns: Part & Value
In the main folder (www), I do have the Link_XML.asp that can handle XML (Reponse & Request) will be used from the Client to access the Trial.mdb
Is there any sample codes or links that I can use to write code in VB.net using XMLDOM to read/write data to the Trial.mdb through Link_XML.asp?
Thanks in advanced,
|
|
|
|
|
I don't know a lot about the later versions of Access but what makes you think you can use XML to write to a database? You could use a CONNECTION to write xml into a database but AFAIK you can use XML.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
- 4 years ago, my friends said that using XML to access information directly through the Web is much better than using program (FTP) to download files (read information) then upload files (write information).
- In my question, I did mention that XML does not access directly to MS Access database, but through an .ASP file. In that ASP file, the Request XML commands will be handled and it will connect to MS Accesss database to read/write information ... then it will Response back to the Client
I hope that I explain mt question well enough. There might be a better way to access data trhough the WEB without Download/Upload files through FTP?
|
|
|
|
|
Ok, now I get to see your problem. Actually you and your friend have a very wrong handle on how this should work. What you need to look into are database driven web pages. This is completely different to what you are thinking of. Todays structure is more like:
Database - SQL Server with stored procedures to service the clients - lives near/on the web server
DAL - VB project that connects yor OM to the database - lives on the web server
OM - Object model - VB project that represents your objects (tables in database or entities in the UI) - lives on the web server
Code behind - VB attached to your ASPX pages - lives on the web server.
ASPX - UI served up by the web server to the client and uses code behind to connect to the OM which uses the DAL to connect to the database to get the data
Ajax as well on the ASPX pages.
So life is a little more complex than you envisaged. There are 3 distinct languages required for this development (TSQL, VB and javascript). If you are going to pursue this you should start with database design, get your data right and the rest will be simpler (not easy but simpler).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for detail explains, I think I have to change our approaches and start the way as you suggested
Thanks
|
|
|
|
|
Hi all, Is it at all possible to have an SQL trigger (which fires every time a row is inserted in a certain table) raise an event in a running VB application ?
Thanks in advance.
|
|
|
|
|
manisghouri wrote: Hi all, Is it at all possible to have an SQL trigger (which fires every time a row is inserted in a certain table) raise an event in a running VB application ?
Is it possible to accelerate your car using breaks...
Jokes apart NO. But I suppose, your application is the one which is inserting the data in the table or there is some external source of data?
If former is the case, you can better tackle the event in your application itself.
|
|
|
|
|
Perhaps not triggering an event per se, but Microsoft SQL Server does have the ability to work with COM objects, which you could use to signal an application.
The method I've used may be a bit Rube Goldberg-ish, but it does work for what we need.
An incredibly simple VB6 COM object was created which does nothing more than issue a TCP connection request to a computer and port specified in the lone Ping method. A multi-threaded VB.NET application was written which listens on a given port for inbound connection requests. When one is received, the connection request is dropped and a short countdown timer is started. Additional connection requests reset the countdown. When the countdown has elapsed, the pending items in the queue are processed.
We have also used SQL Server's COM object functionality to make a better email component (one that can take queries and format the results as HTML tables).
|
|
|
|
|
Depends on the version of SQL Server you're using. It won't be an event like you see in, say, the button class, but yes, you can get notifications. Google for "SQL Server Notification Service".
|
|
|
|
|
It seems that I can assign the value of a cell by dbl-clicking on the cell like this
In this event handler
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
TextBox1.Text = dgView1.CurrentCell.Value
However the first column of data does not work the same way. If I dbl-click on it It does not fire the event but if I click on the column header the data will populate the textbox??
Is there something I am missing??
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
modified on Tuesday, August 12, 2008 12:07 PM
|
|
|
|
|
Are you certain you are clicking on the 1st column and not the header for the rowheader column.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My bad I was in cell changed event....working now..
THX to all
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I want to do some scientific calculations to evaluate a scientific equation.
I want to develop a component in VB.net to perform the arthematic calculations with required precission(Which is more than 30 digits after decimal point).
Can some one help me with this.
Ram
|
|
|
|
|