How to do database connectivity...
Hi, i'm currently working on a project where i need to design the front end in WPF and connect it to the database through WCF...
I'm really lost in the process...
Can anybody tell me the process step by step...
I'll be very thankfull to u...
regards,
Pavithra
RaulPosted Feb 19, 2009, 9:24 AM
edit: default path is C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
pavi thraPosted Feb 19, 2009, 7:52 AM
RaulPosted Feb 19, 2009, 7:47 AM
string connectionString = "Data Source=.\\SQLEXPRESS AttachDbFilename=C:\\dados\\NORTHWND.MDF;Integrated Security=True; Connect Timeout=30;User Instance=True";
SqlConnection sqlConn = new SqlConnection(connectionString);
SqlConn.Open();
the first line is used do make a connection with the database. attachdbfilename is where you db is. And voyla you have made a connection with the db.