|
-
May 18th, 2003, 09:17 PM
#1
Thread Starter
Addicted Member
Text File, Datagird, SQL [Resolved]
I am trying to write a program that pulls information from a text file, much like a database. I have no problem getting the data and populating a dataset.
What I am attempting to do is send a WHERE clause in my SQL statement to look for certain values in a CSV column, much like you would in a database, but I can't seem to figure it out. Any ideas?
VB Code:
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & ";Extended Properties=Text;"
SQL = "SELECT * FROM " & FileName
ds = GetDataSet(SQL, strConn)
DataGrid1.DataSource = ds
DataGrid1.DataMember = "Table"
Public Shared Function GetDataSet( _
ByVal SQLString As String, _
ByVal ConnectionString As String) As DataSet
Dim da As OleDbDataAdapter
Dim ds As DataSet
Try
' Create new DataAdapter
da = New OleDbDataAdapter( _
SQLString, ConnectionString)
' Fill DataSet from DataAdapter
ds = New DataSet()
da.Fill(ds)
Catch
End Try
Return ds
End Function
Last edited by rdove; May 19th, 2003 at 10:53 AM.
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
|