Click here to Skip to main content
15,665,229 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Design as follows;

Faculty Code Combo box View(Button)


Data grid view


in the combo box all faculty code is retrieved from the data base and display in to the combo box.

it is working fine.


When i select the faculty code from combo box and click the View (Button) the particular Faculty Code details will be display into the data grid view.



private GlobalFunction GFun = new GlobalFunction();
private SqlDataReader dr;
private string sql;


for that code as follows;

sql = "select Date,Session,Faculty_Code from Tb_SCh_TIme_Table where Course = '" + cb_Faculty_Code.Text + "' order by Date,session";

dr = GFun.ReadSql(sql);
Dgv_Faculty_Code.DataSource = dr;
//Dgv_Faculty_Code.Databind();

the above Dgv_Faculty_Code.Databind();Databind();.

when i type Dgv_Faculty_Code.


after. databind(); it is not coming why.

how can i get after . databind().

help me.
Posted

1 solution

Using the below code ,Hope It's helpful to you


SqlDataAdapter da = new SqlDataAdapter("Select Idno,Firstname,Lastname,Address,Contactno from
student order by Idno asc", con);

DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900