試圖訪問錶行,但是卻成爲IndexOutOfRangeException數據庫只有一個表,2行數據行System.IndexOutOfRangeException
SqlConnection^conDatabase =
gcnew SqlConnection(L"Data Source=(LocalDB)\v11.0;AttachDbFileName='C:/Users/pcusername/Documents/Visual Studio 2010/Projects/nv/nv/project/project/vn.mdf';Integrated Security='True'");
SqlCommand^cmdDatabase =
gcnew SqlCommand(L"SELECT * FROM Table;", conDatabase);
dataSet1 = gcnew DataSet("Table");
SqlDataAdapter^sda = gcnew SqlDataAdapter();
sda->SelectCommand = cmdDatabase;
dataSet1->Tables;
DataRow^recEmployee = dataSet1->Tables[1]->Rows[0];/*System.IndexOutOfRangeException*/
這是C++/CLI而不是C++。請適當地標記您的問題。 –
感謝您對此抱歉。 – DDD