Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 16-12-2008, 01:02 PM   #1 (permalink)
In The Zone
 
Pragadheesh's Avatar
 
Join Date: Jul 2006
Location: Coimbatore
Posts: 403
Unhappy problem with ms access connectivity in c#


hi,
i developed a window application(a aregistration form) and tried to store the details in a database. i used ms access. here is the method for the "submit" button that would store the details in the database. my database name is Registration and table name is Registration

private void btnRegister_Click(object sender, EventArgs e)
{

string strConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\NewReg\\Registration.mdb";
OleDbConnection con = new OleDbConnection(strConnection);
string strQuery =
"select * from Registration";
OleDbCommand aCommand1 = new OleDbCommand(strQuery, con);
OleDbDataAdapter adp = new OleDbDataAdapter(aCommand1);
con.Open();
adp.SelectCommand = aCommand1;
DataSet ds = new DataSet();
adp.Fill(ds, "Registration");
DataRow drow = ds.Tables[0].NewRow();
drow[0] = txtName.Text;

drow[1] = int.Parse(txtAge.Text);

drow[2] = txtGender.Text;

drow[3] = txtPassword.Text;

drow[4] = int.Parse(txtContact.Text);
drow[5] = txtMail.Text;
ds.Tables[0].Rows.Add(drow);

OleDbCommandBuilder builder = new OleDbCommandBuilder(adp);

adp.UpdateCommand = builder.GetUpdateCommand();
adp.Update(ds);

con.Close();


}

but i get exceptions stating "syntax insert into exception". why such an exception? help plz.
also i'm not much familiar with MS connectivity using C#. any sites or links from which i can learn more about it..
Pragadheesh is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 17-12-2008, 06:47 PM   #2 (permalink)
Legen-wait for it-dary!
 
dheeraj_kumar's Avatar
 
Join Date: Dec 2004
Location: Chennai
Posts: 2,471
Default Re: problem with ms access connectivity in c#

http://www.google.com/search?num=100...23&btnG=Search
http://www.google.com/search?client=...utf-8&oe=utf-8

Please search before posting.
__________________
If the Start Windows Restart when Windows starts check box is checked Windows Restart will start automatically every time Windows is started. - Actual excerpt from a windows program help file
dheeraj_kumar is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connectivity problem (Rapidshare) amer Software Q&A 3 16-04-2008 06:08 AM
Connectivity problem maddy_in65 QnA (read only) 6 03-04-2008 09:48 PM
Problem with PC Suite connectivity.. kumars Software Q&A 3 10-11-2006 12:21 PM
SQL VB6 connectivity Data access error CyCo Software Q&A 1 06-10-2006 11:03 AM
pls help. connectivity problem anandk QnA (read only) 3 06-06-2005 09:58 PM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:03 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2