Good day all,
I have been playing around with diffirent ways of getting data from DB's.
I have this code:
How do I get this data into a dataset? I tried:
but get an error that it cannot convert type int to type dataset.
I also want to know what you call this method of getting data from the DB. Is it ADO or what? I need to learn the terms, or else I will look like an idiot even though I know how to do the job.
Thanks
Henk.
I have been playing around with diffirent ways of getting data from DB's.
I have this code:
Code:
SqlConnection mySQLConn = new SqlConnection("workstation id=AT007359;packet size=4096;user id=sa;data source=AT007359;persist security info=True;initial catalog=Northwind;password=***********"); //password is taken out for confidentiality sake.
SqlCommand mySqlComm = new SqlCommand();
mySqlComm.CommandType = CommandType.Text;
mySqlComm.CommandText = "SELECT * FROM EMPLOYEES";
mySqlComm.Connection = mySQLConn;
mySQLConn.Open();
mySqlComm.ExecuteNonQuery();
mySQLConn.Close();
How do I get this data into a dataset? I tried:
Code:
dsEmployees = mySqlComm.ExecuteNonQuery();
but get an error that it cannot convert type int to type dataset.
I also want to know what you call this method of getting data from the DB. Is it ADO or what? I need to learn the terms, or else I will look like an idiot even though I know how to do the job.
Thanks
Henk.