i am doing a project on web service and window form basically i meet some problem and not sure how to solve
i 想通过网络服务在数据网格的每行各取数据,并输入数据基,以获得像这一行文1;第2行;第3行;第4卷......索一只花了路,但用面面面面面面图显示,以黑体表示。
private void push_Click(object sender, EventArgs e) { string nominal; for (int i = 0; i < DGV.Rows.Count; i++) { nominal = Convert.ToString(DGV.Rows[i].Cells[1].Value); } WSBrand insertInto = new WSBrand(); insertInto.Insert(**nominal**) }
这是我的插入方法。
[WebMethod]
public DataSet Insert(String BrandName)
{
SqlCommand dbCommand = new SqlCommand();
dbCommand.CommandText = "INSERT INTO Brand (BrandName)VALUES (@BrandName)";
dbCommand.Connection = conn;
da = new SqlDataAdapter();
da.SelectCommand = dbCommand;
dbCommand.Parameters.AddWithValue("@BrandName", BrandName);
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}