DataTable table = new DataTable();
DataSet ds = SqlHelper.ExecuteDataset(Utility.GetPumaConString(),
CommandType.Text, @"SELECT name,IsBlocked FROM
ht_cust where type=14 and DealerId<>19");
return ds.Tables[0];
答案 0 :(得分:0)
请在您的项目中尝试此操作。
SqlConnection connection = new SqlConnection("your connectiongstring");
SqlCommand cmd = new SqlCommand("SELECT name,IsBlocked FROM ht_cust where type=14 and DealerId<>19", connection);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
connection.Open();
da.Fill(dt);
//bind it to the grid
gv.DataSource = dt;
gv.DataBind();
connection.Close();