|
-
Feb 13th, 2003, 03:16 PM
#1
Thread Starter
Hyperactive Member
recordset trouble
I'm writing a program that runs a sql query, and puts those fields into a long string. Since I am new to .NET ( I'm used to ADODB in VB 6 ), I can't get it to work.
Can someone give me an example on how to run a query and go through the recordset, or dataset, and add it to a string?
-
Feb 13th, 2003, 05:36 PM
#2
Thread Starter
Hyperactive Member
ok, I got this far, but I am getting a "Specified Cast Not Valid" Error.
VB Code:
Dim sString(1) As String
Dim dr As OleDbDataReader
Dim iRow As Integer
Dim x As Integer = 0
Try
While dr.Read
iRow += 1
If iRow Mod 100 = 0 Then
x += 1
ReDim Preserve sString(UBound(sString) + 1)
End If
sString(x) = String.Concat(sString(x), dr.GetString(0))
End While
Catch ex As Exception
Console.Write(ex.Message)
End Try
Any suggestions??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|