i have a small problem.
am writting a program in c# with sql server
this that i want is to take a particular row from the database and put all the fields of that row to a 2d array
example database
ID name surname
1 prokopis prokopis
2 marios marios
i have connect the program with the database but the problem is that i don't know how to insert the specific row to the array.
the code that i use until now
SqlCommand queryDiagnosis = new SqlCommand("SEL ECT * from [Diagnosis] WHERE [IDD] = " + rowaction[0], dataConnectionD iagnosis);
SqlDataAdapter dataAdapter = new SqlDataAdapter( queryDiagnosis) ;
dataAdapter.Fil l(datasetDiagno sis, "[Diagnosis]");
SqlDataReader myreader = queryDiagnosis. ExecuteReader() ;
int[ , ] tablelist = new int[rownumber, columsize];
for exampe i want the user with id egual 2 all the data to be insert on the array tablelist.could someone help me pls???
am writting a program in c# with sql server
this that i want is to take a particular row from the database and put all the fields of that row to a 2d array
example database
ID name surname
1 prokopis prokopis
2 marios marios
i have connect the program with the database but the problem is that i don't know how to insert the specific row to the array.
the code that i use until now
SqlCommand queryDiagnosis = new SqlCommand("SEL ECT * from [Diagnosis] WHERE [IDD] = " + rowaction[0], dataConnectionD iagnosis);
SqlDataAdapter dataAdapter = new SqlDataAdapter( queryDiagnosis) ;
dataAdapter.Fil l(datasetDiagno sis, "[Diagnosis]");
SqlDataReader myreader = queryDiagnosis. ExecuteReader() ;
int[ , ] tablelist = new int[rownumber, columsize];
for exampe i want the user with id egual 2 all the data to be insert on the array tablelist.could someone help me pls???
Comment