i am doing a project on web service and window form basically i meet some problem and not sure how to solve
i want to get the data in every row in ColA of datagridview and inside into the data base through web service, to get something like this row1;row2;row3;row4......so i did a for loop but at underline with the nominal which i highlight in bold
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**) }
this is my insert method
[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;
}
FormattedValueinstead ofValue- V4Vendetta