Y
yasodhai
Hi,
I retrieved the value of the session varible SID and i convert it to
the integer variable called sid. I thought of retrieving the rows
which correspond to this varible "sid"
string secid=Session["SID"].ToString();
int sid=Convert.ToInt32(secid);
Hence I have to pass the variable "sid" to the where clause in the
select statement. I used "&" but it displays error message "Incorrect
Syntax near &".
SqlDataAdapter Fld = new SqlDataAdapter("select * from Fielddet where
SectionID=&sid& ", myConnection);
try
{
myConnection.Open();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
DataSet Fldds=new DataSet();
Fld.Fill(Fldds,"Fielddet");
DataGrid_Fields.DataSource=Fldds.Tables["Fielddet"];
DataGrid_Fields.DataBind();
myConnection.Close();
Kindly help me how to do this..
Thanks & Regards,
Yasodhai
I retrieved the value of the session varible SID and i convert it to
the integer variable called sid. I thought of retrieving the rows
which correspond to this varible "sid"
string secid=Session["SID"].ToString();
int sid=Convert.ToInt32(secid);
Hence I have to pass the variable "sid" to the where clause in the
select statement. I used "&" but it displays error message "Incorrect
Syntax near &".
SqlDataAdapter Fld = new SqlDataAdapter("select * from Fielddet where
SectionID=&sid& ", myConnection);
try
{
myConnection.Open();
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
DataSet Fldds=new DataSet();
Fld.Fill(Fldds,"Fielddet");
DataGrid_Fields.DataSource=Fldds.Tables["Fielddet"];
DataGrid_Fields.DataBind();
myConnection.Close();
Kindly help me how to do this..
Thanks & Regards,
Yasodhai