R
Rich P
In VB.Net I do this:
1) Dim dr As DataRow = ds.Tables(0).Rows(i)
in VB.Net to C# converter it says this:
2) DataRow dr = ds.Tables(0).Rows(i);
but when I place 2) in my asp.net app (in C#) I get the following error:
System.Data.DataSet.Tables' is a 'property' but is used like a 'method
Here is the context:
protected void gridview1_SelectedIndexChanging(...)
{
int i = e.NewSelectedIndex;
conn1 = new
SqlConnection(ConfigurationManager.ConnectionStrings["myConnString"].Con
nectionString);
da = new SqlDataAdapter();
ds = new DataSet();
da.SelectCommand = conn1.CreateCommand();
da.SelectCommand.CommandText = "Select * From testTbl";
da.Fill(ds);
DataRow dr = ds.Tables(0).Rows(i); //<<--complains here
this.Label2.Text = dr["fName"].ToString();
this.Label3.Text = dr["lName"].ToString();
}
What do I need to do to fix this?
Rich
1) Dim dr As DataRow = ds.Tables(0).Rows(i)
in VB.Net to C# converter it says this:
2) DataRow dr = ds.Tables(0).Rows(i);
but when I place 2) in my asp.net app (in C#) I get the following error:
System.Data.DataSet.Tables' is a 'property' but is used like a 'method
Here is the context:
protected void gridview1_SelectedIndexChanging(...)
{
int i = e.NewSelectedIndex;
conn1 = new
SqlConnection(ConfigurationManager.ConnectionStrings["myConnString"].Con
nectionString);
da = new SqlDataAdapter();
ds = new DataSet();
da.SelectCommand = conn1.CreateCommand();
da.SelectCommand.CommandText = "Select * From testTbl";
da.Fill(ds);
DataRow dr = ds.Tables(0).Rows(i); //<<--complains here
this.Label2.Text = dr["fName"].ToString();
this.Label3.Text = dr["lName"].ToString();
}
What do I need to do to fix this?
Rich