Click here to Skip to main content
15,885,365 members

Comments by Khurana Dips (Top 2 by date)

Khurana Dips 19-May-17 3:11am View    
This connectionstring format--> connectionString ="Server=.; Initial Catalog=Sample; Integrated Security=True" already I've used in C# code. But nothing happened.
Then, I created this connection string --><add name="LifetimeConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\Sample.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" /> in web.config file and tried to connect with database. But no result came.

I am using SQL server database which is in visual studio.
Suggest me an way.
Khurana Dips 19-May-17 2:16am View    
No, i just want to display the name of the loaction in the dropdown and take the Id as selectedvalue for that.Please suggest me the fruitful way. it's very urgent but the above code is not working. After con.Open(), It exits from the try block. I think my database connection is not properly done here. Please show me a way. Thanks in advance.