Hi,
In my coding it shows the following errors.i am underlying those errors.please find.please do the needful.
Error 3:-Expected class, delegate, enum, interface, or struct
public
void netamount()
Error 4 Expected class, delegate, enum, interface, or struct
SqlConnection con = new
SqlConnection ("data source=mars-104;initial catalog=marsweb.imageimpacts;integrated security=true");
Error 5 Expected class, delegate, enum, interface, or struct
SqlCommand cmd = new
SqlCommand ("select sum(Amount)from tbl_Report1 where OrderNo=@InvoiceId", con);
Error 6 Expected class, delegate, enum, interface, or struct
SqlDataAdapter da = new
SqlDataAdapter (cmd);
Error 7 Expected class, delegate, enum, interface, or struct
DataTable dt = new
DataTable ();
Error 8 Identifier expected
dt.Rows
[0] [0].ToString();
public void netamount()
{
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=marsweb.imageimpacts;integrated security=true");
SqlCommand cmd = new SqlCommand("select sum(Amount)from tbl_Report1 where OrderNo=@InvoiceId", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@invoiceid");
con.Open();
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
da.Fill(dt);
con.Close();
txt_netamount.Text = dt.Rows[0][0].ToString();
}
Best,
Sudheep.