I registered for an SQL server at this website:
www.freesqlserver.com
I tried connecting by:
I get an error message saying (Keyword not supported: 'userid'.) . i'm not that familiar with sql, i've usually worked with ms access. Any idea how to connect to sql servers?Code:string conStr = "Data Source=www.freesqlserver.com;Initial Catalog=mytable;UserId=john1;Password=pass1;";//not actual user-pass System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(conStr); //error here System.Data.SqlClient.SqlCommand cmd; cmd = new System.Data.SqlClient.SqlCommand("Select * from mytable", con); con.Open(); cmd.ExecuteNonQuery(); con.Close();




Reply With Quote