Hey,
I'm having a ennoying problem with VB.NET. The solution will probably
very simple but I can't find it.
I'm having an Access2003 database (called Database.mdb) with one Table
'Person'. I'm simple trying to bind the datasource of the datagrid to
the database and view the contents of the single table. Therefore I
use a Datatable, Dataset and a connection to the database. I'm not
getting any errors, but the datagrid is empty at run time, I can't see
nothing at all of the datagrid (include the borders!). I've tried this
with a windows form project and it worked fine, but with a Web
Application project it doesn't work!
The code looks like this:
Dim connString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\testdb\\Database.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection()
myConnection.ConnectionString = connString
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select *
from Person", myConnection)
Dim ds As DataSet = New DataSet()
da.Fill(ds, "Person")
DataGrid1.DataSource = ds.DefaultViewManager
DataGrid1.DataBind()
Can anyone help me to show a database content in a datagrid of a Web
Application??
thx!