I'm tinkering around with Visual Studio .NET and I'm having problems getting basic database connectivity working.
I've got the SQL Server 2000 Desktop Engine up and running, and I've got a C# program that's trying to connect.
My code looks like this:
InitializeComponent();
string connectionString = "server=localhost; uid=sa; pwd=; database=master";
string commandString = "Select EmployeeName, ID from Employees";
SqlDataAdapter DataAdapter = new SqlDataAdapter(commandString, connectionString);
DataSet DataSet = new DataSet();
DataAdapter.Fill(DataSet,"Employees");
DataTable dataTable = DataSet.Tables[0];
The problem is that my program seems to fail on the bold line with the following error:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Has anybody experienced anything like this, or do you have any suggestions on how to resolve this connectivity problem?
Thanks,
Telstar
I've got the SQL Server 2000 Desktop Engine up and running, and I've got a C# program that's trying to connect.
My code looks like this:
InitializeComponent();
string connectionString = "server=localhost; uid=sa; pwd=; database=master";
string commandString = "Select EmployeeName, ID from Employees";
SqlDataAdapter DataAdapter = new SqlDataAdapter(commandString, connectionString);
DataSet DataSet = new DataSet();
DataAdapter.Fill(DataSet,"Employees");
DataTable dataTable = DataSet.Tables[0];
The problem is that my program seems to fail on the bold line with the following error:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
Has anybody experienced anything like this, or do you have any suggestions on how to resolve this connectivity problem?
Thanks,
Telstar