AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
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
<----http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx----->
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 <srvishnukumar@gmail.com>

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
Hi,

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();
oleda.Fill(dt);

GridView1.DataSource = dt;
GridView1.DataBind();

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
Building a Web Application Security Program
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
The ASP.NET 2.0 Anthology: 101 Essential Tips, Tricks & Hacks - Free 156 Page Preview