6
Answers

Get data from database and display it on the grid ERROR

soonhuat81

soonhuat81

20y
1.8k
1
I try to get the data from the database and then display it in gridcontrol, but it seems like not working.. I already created the dtArea table in dataset1, and here is the code i write : private void Form1_Load(object sender, System.EventArgs e) { sqlConnection1.ConnectionString = " .....MyConnectionString...."; sqlConnection1.Open(); sqlDataAdapter1.Fill(this.dataSet1, "dtArea"); sqlConnection1.Close(); gridControl1.DataSource = dtArea; } Whenever i run the program, the system stop at sqlDataAdapter.Fill(this.dataset, "dtArea") statement ... and the error message is as follwing: "An unhandled exception of type 'System.Data.SqlClient.SqlException" occured in system.data.dll. Additional information : System error " Can anyone help as i've tried so many times but still it's not working. Thanks in advance for the help.
Answers (6)