Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
Questions & Answers
Tips & Tricks
 Grid view via isert,edit,delete
Posted by Vishnukumar SR on  12/2/2009 7:08:29 AM Category: ADO.NET
Add to my favorites
Email to friend

Hi Friends,

How Can mgt datas via Grid view using Ms Access ? Here I had Read this UseFul Aricle
Then I had Modify the coding about of database Connection & query execute Code. Bcoz I dont have Ms sql open source. so i want to do it in Ms Access

But I had Some error in which is am modified Code... So If possible plz Sent me the Ms Access db Connection Code in my Mail id. My id is <>

This Is the Error Mgs :----

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'CustomersCls' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 14: {
Line 15:
Line 16: CustomersCls customer = new CustomersCls();
Line 17: protected void Page_Load(object sender, EventArgs e)
Line 18: {

Post Your Reply Post New Question

 Viewer's Reply
Binding GridView with MS Access Database
Answered By Moderator1 on 12/2/2009 7:30:53 PM

I've given the sample source code to bind gridview with ms access database. Also it has the connection string.

using System.Data.OleDb;

string strDBPath = Server.MapPath("App_Data/db1.mdb");
string strAccessConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strDBPath + ";";

string strSql = "Select * from SampleData";
OleDbDataAdapter oleda = new OleDbDataAdapter(strSql, strAccessConnString);
DataTable dt = new DataTable();

GridView1.DataSource = dt;

And your Error is because of missing CustomerCls class file. This file can be found the in downloaded source code which is available at the bottom of the article. Please check. Make sure the Class File name is same.
Post Your Reply If you still have problem, post it again under this reply for better response.

Sponsored by
Introduction to Web Applications Development
The Beginner's Guide to Joomla
Simply JavaScript - Free 150 Page Preview!