| | |
connection to database
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2009
Posts: 54
Reputation:
Solved Threads: 0
HI ME AGAIN=|
I'm basically new to connecting to database.
MY PROBLEM is that i do not know how to connected to database[ microsoft access]
eg. the password entered, is stored at microsoft access database. how do i connect the window application to database so that when i run the window application the password enter and saved is store into the database. and we can refer to database to see if they have type the wrong password.
I'm kinda stuck here that i can't proceed with my projext so i desperately need some advice=| thankss=))
I'm basically new to connecting to database.
MY PROBLEM is that i do not know how to connected to database[ microsoft access]
eg. the password entered, is stored at microsoft access database. how do i connect the window application to database so that when i run the window application the password enter and saved is store into the database. and we can refer to database to see if they have type the wrong password.
I'm kinda stuck here that i can't proceed with my projext so i desperately need some advice=| thankss=))
I have posted a sample application using an SQL Connection, but you change the SqlConnection to OleDbConnection, SqlCommand to OleDbCommand, etc.
http://www.daniweb.com/code/snippet217409.html
For generating the access connection string:
http://www.daniweb.com/code/snippet217409.html
For generating the access connection string:
C# Syntax (Toggle Plain Text)
public static string BuildAccessConnectionString(string Filename, string Username, string Password, string DatabasePassword) { return string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='{0}';User Id={1};Password={2};Jet OLEDB:Database Password={3};", Filename.Replace("'", "''"), Username, Password, DatabasePassword); } public static string BuildAccess2007ConnectionString(string Filename, string DatabasePassword) { return string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='{0}';Persist Security Info=False;Jet OLEDB:Database Password={1};", Filename.Replace("'", "''"), DatabasePassword); }
You can always use www.connectionstrings.com =)
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- JSP connection to database (JSP)
- VB6 ACCESS database Connection Query (Visual Basic 4 / 5 / 6)
- How to make connection to database more dynamically using hibernate. (Java)
- establishing connection with more than one database (VB.NET)
- When should you close a database connection? (ASP.NET)
- database connection (ASP.NET)
- Problem with database connection (JSP)
- Database Connection in Visual Studio 2005 (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Validation of Textbox C# window application
- Next Thread: How to change folder or file name using C# ?
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop picturebox pixelinversion post programming radians regex remote remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






