guoht03

guoht03

  • NA
  • 1
  • 0

Can't access sql server

Nov 19 2003 12:42 AM
origin codes follow below: SqlConnection myConnection = new SqlConnection("server=(local)\\COLIN;database=pubs;Trusted_Connection=yes"); SqlDataAdapter myCommand = new SqlDataAdapter("select * from Authors", myConnection); DataSet ds = new DataSet(); myCommand.Fill(ds, "Authors"); the error follows below: SQL Server dosen't exist or access has been denied. Exception details: System.Data.SqlClient.SqlException: SQL Server dosen't exist or access has been denied. line 14: line 15: DataSet ds = new DataSet(); line 16: myCommand.Fill(ds, "Authors"); ---------error occurs here line 17: line 18: MyDataGrid.DataSource=ds.Tables["Authors"].DefaultView I've tried to modify the security setting of sql server but the error still exists. I'm sure that instance of sql server named COLIN is running. It seems that my access has been denied. Can any one help me? Thanks!

Answers (3)