Hi,
I'm still new to C# coding and so I'm having some trouble even maybe with simple things, I have the following code, and I'm getting this particular error :
System.NullReferenceException: Object reference not set to an instance of an object.
Line 26: cmd.CommandType = CommandType.StoredProcedure; Line 27: cmd.CommandText = "ShowTag"; Line 28: cmd.Connection.Open(); Line 29: //con.Open(); Line 30: DbDataReader rdr = cmd.ExecuteReader();
The following is the code I'm using
using
public
{
con =
cmd.CommandType =
cmd.CommandText =
con.Open();
html.Load(rdr,
con.Close();
gv.DataSource = html;
gv.DataBind();
}
lbl.Style.Add(
lbl.EnableViewState =
form1.Controls.Add(lbl);
gv.Style.Add(
gv.EnableViewState =
form1.Controls.Add(gv);
Any help is appreciated
Thanks