Home > Net > Is there a big tell me where there is wrong! The dataset in the data in the database!
Is there a big tell me where there is wrong! The dataset in the data in the database!
Time:10-17
I will be out on the data from the database list a gridview, can be displayed on the page! No problem, then I transfer the data to the dataset, and then into the same database table of data in a dataset b (no data) is a new table, table b, then an error: the object reference not set to an instance of an object,
The DataSet ds=new DataSet (); GridView1. The DataSource=ds; String sqlStr2="insert into getMedicine (medicine_Id medicine_Name, medicine_Spec, medicine_Price) values ('" + ds. Tables [r]. "getMedicine" Rows [0]. The ToString () + "', '" + ds. Tables [r]." getMedicine "Rows [1]. The ToString () +"', '" + ds. Tables [r]. "getMedicine" Rows [2]. The ToString () + "', '" + ds. Tables [r]. "getMedicine" Rows [3]. The ToString () + "");";
Please everybody to help! Thank you very much!
CodePudding user response:
Don't sink! Everybody to help
CodePudding user response:
GridView1. The DataSource=ds; Ds has no data, you must not go to see values Ds. Tables [r]. "getMedicine" Rows [0]. The ToString ()