class
public List<fst> disp()
{
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd= new SqlCommand("select * from trial",con);
cmd.Connection=con;
SqlDataReader dr = cmd.ExecuteReader();
List<fst> obj = new List<fst>();
if (dr.HasRows)
{
dr.Read();
fst k = new fst();
k.id_p = dr[0];
k.name_p = dr[1];
k.city_p = dr[2];
obj.Add(k);
}
dr.Close();
return obj;
}
i have written this code in the class to use in he select button in object data source,but when i click on configure object data source this method is not displayed for selection.In fact the class is not displayed to select.
|