DataGrid - almost have it

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
 
F

Frank Oquendo

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)
 
J

James McGivney

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
 
J

Jacob Yang [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top