Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid1.DataBind() ... error

Status
Not open for further replies.

jeffmoore

Programmer
Aug 29, 2003
301
US
This code was posted as a solution to a prior question. But the last line is incorrect .... any help?


Dim MyConnection As System.Data.Odbc.OdbcConnection
Dim MyDataTable As New DataTable
Dim MyDataAdaptor As System.Data.Odbc.OdbcDataAdapter
Dim strMyConnection, strSavedFolder, strFilename As String
strSavedFolder = "c:\inetpub\ strFilename = "test.csv"
strMyConnection = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" & strSavedFolder & ";"
MyConnection = New Odbc.OdbcConnection(strMyConnection)
MyDataAdaptor = New System.data.Odbc.OdbcDataAdapter("select * from [" + strFilename + "]", MyConnection)
MyDataAdaptor.Fill(MyDataTable)
DataGrid1.DataSource = MyDataTable
DataGrid1.DataBind()


TIA
Jeff
 
the datagrid1.databind is only used in asp.net/webforms if you use windows forms you don't need it.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top