DataGrid and DataGridView
-
Hi, I have got the Apress book Beginning C# Databases: from Novice to Professional, and have been very pleased with it, But because it was written before Microsoft Visual C# 2005 came out, some things are a bit out of date. I have managed to get around most of them except this one: It tells me to add a DataGrid to the designer view, but all I could find was DataGridView, and after some scripting, I have to "Bind the data grid at run time" using the script:
dataGrid1.SetDataBinding(dataset1, "employees");
I understand what the code is doing but the class DataGridView does not have a SetDataBinding function and so do not know how to bind the DataGridView1 object to the dataset. Please help. Thanks, Any reply is appreciated. I will also post this in the C# section -
Hi, I have got the Apress book Beginning C# Databases: from Novice to Professional, and have been very pleased with it, But because it was written before Microsoft Visual C# 2005 came out, some things are a bit out of date. I have managed to get around most of them except this one: It tells me to add a DataGrid to the designer view, but all I could find was DataGridView, and after some scripting, I have to "Bind the data grid at run time" using the script:
dataGrid1.SetDataBinding(dataset1, "employees");
I understand what the code is doing but the class DataGridView does not have a SetDataBinding function and so do not know how to bind the DataGridView1 object to the dataset. Please help. Thanks, Any reply is appreciated. I will also post this in the C# sectionfirst create a dataset then in page_load event type this for windows application adapter1.Fill(dataset1,"employees"); dataGridView1.DataSource = dataset1.Tables["employees"] for web application gridview1.datasource=dataset1.Tables["employees"] gridview1.databind()
this is code maker
-
first create a dataset then in page_load event type this for windows application adapter1.Fill(dataset1,"employees"); dataGridView1.DataSource = dataset1.Tables["employees"] for web application gridview1.datasource=dataset1.Tables["employees"] gridview1.databind()
this is code maker