DataGrid - almost have it

  • Thread starter Thread starter James McGivney
  • Start date Start date
J

James McGivney

In Microsoft Access I make a new Access Project called
VipperSQL (Access 2000 file format). I construct a table
called Ante with 13 columns. One column called ID is the
primary key. Some columns have text data, others date
data and others numeric data. I add 10 rows of sample
data.
In Visual Studio I build a new Web Project in C#.
I place a DataGrid (named MyGrid) on the aspx page along
with an SQLConnection1, SQLDataAdapter1 and dataset
vippy11.
I place a statement: using System.Data.SqlClient; at the
top of the code page.
In the Page_Load event handler I place:
MyGrid.DataSource = vippy11.Ante;
MyGrid.DataBind();
I save and build the project.
I browse the aspx page in the browser, I get the correct
Column headings, but do not get the 10 rows of sample
data. What do I need to do to view my sample data in the
DataGrid ?
Thanks,
Jim
 
James said:
In Microsoft Access I make a new Access Project called
VipperSQL (Access 2000 file format).
with an SQLConnection1, SQLDataAdapter1 and dataset
vippy11.

The problem is the Connection and DataAdapter objects you're using only
work with SQL Server. Switch to an OleDbConnection and OleDbDataAdapter
when using Access as a backend.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
In a new web project I place a datagrid on the aspx page.
Configure an OleDBDataAdapter with dataSet11 connected to
a table in my Access Project.
Place the statement: using System.Data.OleDb; at the top
of the code page.
Place the statements in the Page_Load event handler.
DataGrid1.DataSource = dataSet11.AntMort;
DataGrid1.DataBind();
I view the aspx page in Explorer.
I still get the column headers but not the row data.
Any suggestions ?
Thanks in advance for your help.
Jim
 
Hi James,

Based on my research and experience, the following article is useful to
this issue.

Walkthrough: Editing an Access Database with ADO.NET
http://www.microsoft.com/indonesia/msdn/adon_wtaccessdb.asp
"...
Summary: This walkthrough demonstrates how to add, delete, and edit records
in a Microsoft? Access database with ADO.NET using a simple Visual C#?
code-behind Web application. (11 printed pages)
..."
Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.est

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top