|
SqlConnection conn = new SqlConnection ("server = localhost; Initial catalog = LIS; uid = sa; password =;");
conn.Open ();
SqlDataAdapter adapter = new SqlDataAdapter ("SELECT XM FROM BRXX WHERE ID =" + n, conn);
SqlCommandBuilder builder = new SqlCommandBuilder (adapter);
DataSet ds = new DataSet ();
string xm = Convert.ToString (ds.Tables ["BRXX"]. Rows [6] ["XM"]);
I want to get the XM value of the 6th row in the database. This is the wrong way to write it. It always contains the error "the object reference is not set to the object instance." Is there any other way to get a value in a row, or how do I do this? change? |
|