|
I use an OLEDB connection with this connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
If you are looking for more connection string options this [^]is a great site.
Hope this helps.
|
|
|
|
|
may be work with
Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=PWD;Data Source=C:\mydatabase.mdb;Persist Security Info=False
Emimmortal
|
|
|
|
|
Thank you all for replying. It was a great help to try diffrent methods.
John,
|
|
|
|
|
i need help on something i have this
Dim SQLIinsert As String = "UPDATE httpuser SET credits= " + -1 + "' WHERE username='" + My.Settings.Username + "'"
what i need is to decrease the column credits by 1 but it this i get -1 in the database.
can someone explain whats wrong? ive searched but im almost ready to quit.
thanks in advance
|
|
|
|
|
You are telling the database 'SET credits=-1', so that is what it's doing. I believe you can say 'SET credits=credits-1' to get the effect you want.
|
|
|
|
|
thanks that does the job very well.
|
|
|
|
|
Hi,
I work with vb6
i need to write a function which will get
an array of bytes, count how many bytes are
there and run a loop in that size...
i managed to get the length of an array with "x = LenB(y)"
but that function somtimes recieve a single byte (not an array)
and then the size i get for it is 4 instead of 1
how can i determin if what i get in is a byte or an array of bytes
also i dont know what to write in the declaration of the function
("Function myfunc(???)")
thanks in advance.
|
|
|
|
|
It would be easier to help if you post your code and show us where the problem is.
|
|
|
|
|
O.k its quite simple , im not at home so ill write what i remember.
Function CS(a) 'is the decleration ok ?
dim n as int 'Define counter
dim temp as byte 'temp for storing CS
temp = 0
dim b(LenB(a)) as byte '(if a is 7 bytes long i get a new aray of 8 bytes here)
for n = 0 To LenB(a)-1
b(n) = a(n)
temp = temp Xor a(n)
next
.
.
.
b(n+1) = temp '(i dont remeber if its n or n+1 depends if it got increased by the for)
a = b
End Function
if i send an array to this function all goes well
lets say i have an array of bytes named try1(7)
the LenB(a) will return the currect size of it
but when i send it a single byte (not an array) it returns 4.
i need to find a way to get the size of "a"
so if its 1 ill skip the "for n=0..." and do somthing else.
Thanxs again.
|
|
|
|
|
Hi All,
Can you please correct if I am wrong I have declared a function that returns array of object as below, pls. rectify me if I am wrong
Public Function convertInToObject(ByVal dsParameterValues As DataSet) As Object()
Thanks a Lot,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
|
I think it should be this when you return an array.
Public Function convertInToObject(ByVal dsParameterValues As DataSet) As Array
|
|
|
|
|
Just out out of curiousity would any of 2 of you who gave me a 1 vote explain your reason since the answer I gave is correct. As Object will work because of late binding but As Array is preferable.
|
|
|
|
|
|
Don't worry I didn't think it was you. I must have pissed someone off recently since someone has been giving me a bunch of 1 votes but I was wondering why I got the second 1 votes.
|
|
|
|
|
sounds like you not only have attracted a univoter but a copycat univoter - you should feel priveledged.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hi I'm trying to convert this C# code in to VB.net
public event EventChannelMessage EventChannelMessage
{
add { m_EventChannelDataReceived += value; }
remove { m_EventChannelDataReceived -= value; }
}
Here is the converted code i got from one of the code converters but it cannot compile in VB.
Public Custom Event EventChannelMessage As EventChannelMessage
AddHandler(ByVal value As EventChannelMessage)
m_EventChannelDataReceived += value
End AddHandler
RemoveHandler(ByVal value As EventChannelMessage)
m_EventChannelDataReceived -= value
End RemoveHandler
End Event
Anyone who understand both VB and C# please help me as this needed ASAP.
Thanks in Advance.
|
|
|
|
|
Try one of the free online C# to VB.NET convertors like this one[^].
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
You need a 'RaiseEvent' block in custom events in VB:
RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)
'...
End RaiseEvent
The online converters should have caught that.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
Sorry, complete computer hardware novice here.
How much memory do I have for arrays?
According to system information my computer has 1.99Gigabytes of RAM
2 Gigabtyes = about 2,048,000,000 bytes
According to vb.net documentation, single precision floating point = 4 Bytes
2 Gigabytes / 4 Bytes = 512,000,000
So I figured I would try:
Dim Myarray(512000000) As Single
That didn't work, so I tried:
Dim Myarray(512000000 / 2) As Single
But that didn't work either!
How much memory do I have? How can I find out? How can I access it?
References appreciated.
Thanks in advance
|
|
|
|
|
Your math is correct but you are forgetting a few things. First is that the operating system and any programs that are running are using up some of the space. Second is that arrays need a contiguous block of memory,they can't be broken into small chunks and placed in several places. If your memory is more than one piece then the array can't be larger than the largest piece of memory and also where the operating system places programs in memory may reduce the largest block of memory.
If you actually needed to use anywere near the computer's memory limits you should make a few small arrays rather than one monster array but in any case you should try to make your arrays the minimum size necisary to do the job not the largest possible.
|
|
|
|
|
Hmmm. interesting, but it doesn't seem to matter. Large array or small arrays, the max I can ever get is about 780MB. Is this perhaps a limitation of .net?
Can I use virtual memory to increase the size of my arrays? Does that question even make any sense?
Thanks again.
|
|
|
|
|
cstrader232 wrote: Is this perhaps a limitation of .net?
No. The limit is determined by the biggest block of available memory. Also, memory not withstanding, you can only have Int32.MaxValue number of elements in an array, on a 32-bit machine.
cstrader232 wrote: Can I use virtual memory to increase the size of my arrays
This is already done automatically by .NET's memory manager and Windows. The limit is determined by the state of Windows when the array is allocated and, the amount of RAM installed in the machine, the maximum size of your systems page file, and the fact the, by default, there is a 2GB user mode limit per process.
On my machine, 3,000,000 Single's results in a VM size of 1.22GB - automatically. I can to somewhere north of about 3.05 million Singles in an array after a fresh boot, with about 1.5GB of RAM in it.
Keep in mind that your app does not have access to the entire 2GB. The system occupies a good chunk of that memory, so your code has to share that limit. The effective range you have is a max of about 1.2 to 1.4GB of memory for your application, depending on what's installed and running in the system.
|
|
|
|
|
OK, that helps although it's disappointing...
But I don't understand your comment:
"On my machine, 3,000,000 Single's results in a VM size of 1.22GB - automatically. I can to somewhere north of about 3.05 million Singles in an array after a fresh boot, with about 1.5GB of RAM in it."
I can get about 194,000,000 (194 million) singles (That is 780,000,000 bytes), but never more.
In any case, is it possible to tell what the biggest array I can dim at a given time is? I guess I need to determine the biggest block of available memory
Thanks
|
|
|
|