[Solved] SQL Server with C#


Try This

SqlConnection myConnection = new SqlConnection("Data Source=Igor;Initial Catalog=Prueba;Integrated Security=True");

Edit2:

enter image description here

For the Above Picture and for TEST_DB database the Connection String should be written as

 SqlConnection myConnection = new SqlConnection("Data Source=AJMOT-PC;User ID=sa;Password=thisismypassword;Initial Catalog=TEST_DB;Integrated Security=True");

If you are using the Window authentication for sql server then you don’t need to declare the User ID=sa;Password=thisismypassword section.

1

solved SQL Server with C#