hi...
Can some one find me the solution... I am getting an error while i am bing the dataset value to datatable...ParenID is of type Char(3)..
SqlConnection cnn = new SqlConnection(Conn);
SqlCommand cmd = new SqlCommand("Select * From tbChildMenu", cnn);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
ada.Fill(ds);
dt = ds.Tables[0];
DataRow[] dRowParent = dt.Select("ParentID="+ 0); //Error Line
foreach (DataRow dr in dRowParent)
{
menuBar.Items.Add(new MenuItem(dr["ParentID"].ToString(), dr["ChildID"].ToString()));
}
foreach (DataRow dr in dt.Select(""))
{
MenuItem mnu = new MenuItem(dr[""].ToString(), dr[""].ToString(), "", dr[""].ToString());
menuBar.FindItem(dr[""].ToString()).ChildItems.Add(mnu);
}
Join Hands Change lives
Thanks & Regards
Straight Edge Society