int BookID = Convert.ToInt32(dt.Tables[0].Rows[3][0]);请问我这个是怎么错了 10
stringstr="DataSource=.;InitialCatalog=BookStore;IntegratedSecurity=True";SqlConnecti...
string str = "Data Source=.;Initial Catalog=BookStore;Integrated Security=True"; SqlConnection conn = new SqlConnection(str); conn.Open(); // 初始化命令 SqlCommand cmd = new SqlCommand("select * from [Book]", conn); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); int BookID = Convert.ToInt32(dt.Tables[0].Rows[3][0]);
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询