|
I answered this yesterday, and you didn't reply, but now you ask it again ?
Are you using VB6 ? If so, why would you do such a thing ? If not, why use ADO ?
Dunno why I bother trying to help, it seems anything beyond a cut/past solution, you will ignore and just ask again.....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
how can i define dynamic array and how can i know its size
please help
|
|
|
|
|
A dynamic array is on in which you don't know the size when you start, so the question is a bit unclear. However, defining and using a dynamic array is about as easy as using a regular arry.
I'll give example in a single-dimension array
<br />
Private fileList() As sDownloadRecord<br />
<br />
Private Sub clientTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles clientTimer.Tick<br />
' keep track of overall files to download count<br />
Dim queuePosition As Integer = 0<br />
ReDim fileList(queuePosition)<br />
<br />
For i As Integer = 0 To UBound(Severe)<br />
fileList(i).URI = "[uri obscured]" & My.Settings.Calls.ToLower & "/" & Severe(i).InFile<br />
queuePosition += 1<br />
ReDim Preserve fileList(queuePosition)<br />
Next<br />
End If<br />
Note: sDownloadRecord is a structure of string items. It's not important to this example. The important thing for answering your question lies in these lines:
<br />
Private fileList() As sDownloadRecord<br />
This sets up the dynamic array...initializing it without a size.
<br />
Dim queuePosition As Integer = 0<br />
This sets the array to size 0 (1 item, since arrays are 0-based).
<br />
ReDim Preserve fileList(queuePosition)<br />
After you put a value in the array, you need to expand the array to accept the next value. "ReDim Preserve" handles this.
"UBound" is how you know where the top of the array is. You see it used in the line
<br />
For i As Integer = 0 To UBound(Severe)<br />
As Severe() is a Dynamic array of strings, too.
Hope that helps!
Scott
|
|
|
|
|
thanks
do you think that using ( ArrayList ) is butter than dynamic array
|
|
|
|
|
how to convert date in string to date and send to access database in the query
Thank You
Meghana
|
|
|
|
|
You can use DateTime.TryParse to try to turn a string into a datetime. You pass it as a parameter to the query after that
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This seems like it ought to be simple, but I'm apparently not coming up with the right search terms to find an answer...
My application downloads audio files for an automated player. I'm downloading the files into a temp directory, because the player may be using the file at the time I'm trying to download an updated one. How can I keep a file copy from happening if the destination file is open?
|
|
|
|
|
Hi,
AFAIK there is no way to interrogate a file on its current activities or open state.
if a file is open it typically will not allow to be copied over, so all you have to do
is try to copy and catch the possible exceptions to detect failure.
And if the file is opened in such a way that copying over would be possible, then make
your open more demanding (such as open-for-readwrite, and no-share).
|
|
|
|
|
Here is a way to wait for the file to be available before saving, you could apply the same to copying and remove the do until / loop. Just use a try/catch statement.
A process i have is iterating through all the
Dim saved = False
Do Until saved = True
Try
doc.Save("c:\data\results.xml")
saved = True
Catch ex As Exception
'silentFail
End Try
Loop
|
|
|
|
|
hi all
I Add this tool "Microsoft ADO Data Control 6.0" and connected it to my Database and i want to store the select statment in my variable like this:
<br />
dim dnsip as String<br />
<br />
dnsip = ado.RecordSource = "select ip1,ip2,ip3,ip4 from DNSTable where hostname like ('dnshostname ') "<br />
<br />
This code does not store select statment in my variable dnsip
How i can store the select statment in variable dnsip
THANK'S
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
I dunno how VB handles this sort of syntax, why not set dnsip first, THEN set teh RecordSource on the next line ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm not much of an expert on ado but I can see at least one thing is wrong here. You have 2 equals statements which I think is illegal. Either your first " should be between your = and ado.Recordsource if you are trying to turn that whole statement into a string or you should do this in 2 lines of code if you are trying to make 2 assignments.
|
|
|
|
|
Seriously, pickup a beginners book on VB.NET and work through it. What you're doing is legal, but that statement doesn't work how you're thinking it does.
|
|
|
|
|
No, he'd rather ask the same question again.....
( about 3 threads up )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: No, he'd rather ask the same question again.....
Why do we even bother...
|
|
|
|
|
For the few who listen....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm developing a VB6 program to draw boxes. I'm stuck with the programming. I've done about 90% of the functionality. I'm using teeChart from Steema software and works pretty fine. My problem is about box walls. Up to now I can draw them as lines in space. That implies that the are transparent. My client is asking for non transparent walls.
Do some body have any hint. I think my problem could be solved drawing 3d planes in OpenGL but I don´t now where to start.
The beginning could be a good starting point. What's OpenGL?
Greetings from México
quijoteMX
|
|
|
|
|
qujoteMX wrote: The beginning could be a good starting point. What's OpenGL?
Wow.
Well, first of all, VB6 is outdated, clunky, underpowered and nasty. Why are you writing software using it ?
OpenGL is the competitor to DirectX. I am not sure if VB6 can use DirectX, perhaps through COM. Using DirectX or OpenGL, your whole UI needs to be drawn using it, if you're not already using it, I doubt you can start now.
If you're just drawing a box using GDI, I guess your best bet is to flood fill them.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, i was wondering if anyone out there would be able to help me with (i think a simple) task that i am trying to do in VB, preferably VB6, however i do have .NET 2003.
The problem:
i am able to do basic stuff in (mostly) VB6 but i have been trying to figure out how to make a programme to automatically save a picture from a certain address of a website.
i have a made a simple broswer using ie controls in VB6 but what i rly want to do is have a line or two of code in the programme that saves a picture to a file locally.
The reason:
on the met office website they have got IR satelite pictures of weather and i have been downlaoding the pictures manually for a while now and it's getting tedeous, i download them becasue of the nice looking image sequance they make when you run them like a movie :P it's just very interesting, anyway enough of all that talking....
can anyone help? i would be very happy if they could
|
|
|
|
|
First of all, don't learn VB6, it's a dead language, and it sucks.
If you know the exact images you want, you can just do a HTTP request in .NET code to get the image data and save it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
so if i google something like "HTTP request in .NET" and/or in the msdn i should find it.
thanks for replying.
|
|
|
|
|
Hello. I want to know How I can Load a data into Textbox from DataGride Where I clicking on the one cell or Row on it? But it is DataGrid, Not a DataGridView. In VB.Net 2005
Thanks avryone.
|
|
|
|
|
try following code snippent at Double click event of datagrid
If dgvServices.CurrentRowIndex = -1 Then Exit Sub<br />
If Not dgvServices.Item(dgvServices.CurrentRowIndex, 0) Is Nothing Then<br />
txtServiceName.Text = dgvServices.Item(dgvServices.CurrentRowIndex, 1)<br />
txtPrice.Text = dgvServices.Item(dgvServices.CurrentRowIndex, 2)<br />
Else<br />
<br />
End If
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
hi
i have sql statement that take value from 2 table how can i fill the data set with which table name
SqlSec = "Select s.SectionID, s.JoinedSection,c.Priority<br />
From [Section] s,Course c <br />
Where s.CourseID =c.CourseID AND SectionID in(select SectionID <br />
from Slot where SlotID= " & currentslot & ") <br />
ORDER BY c.Priority" <br />
Dim DataAdapter1 As New OleDb.OleDbDataAdapter(SqlSec, con)<br />
DataAdapter1.Fill(Sections, "Section") ' fill the data setits actually section and course tables
it give error msg (No value given for one or more required parameters)
|
|
|
|
|
I don't really understand what you want to do with your first question, perhaps if you explain how you want to use it?
The error message means that you have one or more names in your query that doesn't exist in the database. Check the spelling of the table and field names. Also, is SlotID a numeric field, and does currentslot contain a number?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|