TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dobby
NA
53
0
Please assist with Sql and Access issue.
Jul 7 2008 3:35 PM
hi i have tried to connect and write to an access database using a Sql connection string. with no success, i dont know what else to say, the source is below. it keeps giving me unknown provider, i have also tried using oledb but to no success (kept getting problems with Not all agruments present or something)
{
SqlConnection sqlClient = new SqlConnection(@"Provider=Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\yourname\Documents\ClientBrowser\Clients.accdb;");
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = String.Format("INSERT Clients (ClientName, Wage) VALUES ({0}, {1})", txtName.Text, int.Parse(txtWage.Text));
cmd.Connection = sqlClient;
sqlClient.Open();
cmd.ExecuteNonQuery();
sqlClient.Close();
MessageBox.Show("done");
}
many thanks, im sorry if it is a dumb question, but really, im new.
Reply
Answers (
3
)
How to create dynamic connection string in Ado.Net (visual studio 2005)?
Feedback - http://www.dotnetcharting.com