I am creating a windows application.using sql server 2008. I am getting connection string problem while connecting to .mdf file which is in this location c\folder\file.mdf. what I did will explain you will get clear pucture. first of all what I did is I have created 1 database in the sql with the tables. now I de-attached it. from c:\program files\sql server\data\mydb.mdf&mydblog.ldf, I copied in desktop. now from my application when ever I am entering a text and then click create button event it ic creating a texbox1.text.mdf and textbox1log.ldf. now I want to connect to this created database file. I have give like this connection string but it is giving me connection is aborted and so on. SqlConnection con = new SqlConnection(@"Data Source=.\SQLExpress;Integrated security=true;AttachDbFilename=c:\maq\" + textbox1.Text + ".mdf;Trusted_Connection=Yes"); Help me for this I did this using .mdb it is successful but sql giving me trouble. I am new to use sql if I did any mistake please let me know I want learn a lot.
SqlConnection con = new SqlConnection("Data Source=.\\SQLExpress;Integrated security=true;AttachDbFilename=\"c:\\maq\\" + textbox1.Text + "\".mdf;Trusted_Connection=Yes");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)