database - connecting Access DB to VS using C# -


This is the first time I am using C # connection with DB, I do not even use access I just want to know the initial stages needed to connect the DB access to the Visual Studio C # windows application. I have searched the Internet though, it has helped a lot. I can not find my fault in code. I think I am getting some step in establishing relationships with DB.

Here is an error that appears when I program '' \ f38910 \ users \ kainat.baig \ Desktop \ AAA \ Database 101 'is not a valid path. Make sure the path name is spelled correctly and you are connected to the server on which the file exists. "

CODE:

  Book OleDBConConation; OLDBI Commands OD DBCMD = New OLEDB Commands (String ConnParam = @" Provider = Microsoft.Jet.OLEDB.4.0; Data source = \\ f38910 \ user \ kainat.baig \ desktop \ aaa \ database101; Permanent security information = false "; Public form 1 (bookConn = new oraclebankation); InitializeComponent ();} Private Zero Button 1_Click (Object Sender, EventArgs e) {bookConn.Open (); // * Error Line oleDbCmd .connect = bookCon; bookConn.Close ();}    

after you database code Do not forget to add .mdb or .accdb if you are using Microsoft Office Access 2007 or higher database, Also has to be changed.

  st Ring ConnParam = @ "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = \\ f38910 \ User \ kainat.baig \ Desktop \ AAA \ Database101.mdb; Constant security info = false ";   

Or you can use the connection string like this

  string connParam = @" provider = Microsoft.Jet .OLEDB.4.0; Data Source = \\ f38910 \ User \ kainat.baig \ Desktop \ AAA \ Database101.mdb; User id = admin; Password =; "ACCESS 2010 for   

Edit:

  @" Provider = Microsoft. AACE OLDB 12.0; Data source = \\ f38910 \ user \ kainat.baig \ Desktop \ AAA \ Database101.accdb "   

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -