Hi,
I have created a Dataset using the wizard that has a table "Employee"... How do i bind this dataset to the DataGridView control to display records on Form_Load()?
TY
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
jingeRank #2,527 · 554 reputationPosted Nov 1, 2009, 7:33 PM EST
public partial class Form1 : Form { DataSet1.EmployeeDataTable employeeDt = new DataSet1.EmployeeDataTable(); public Form1() { InitializeComponent(); this.Load += new EventHandler(Form1_Load); } void Form1_Load(object sender, EventArgs e) { try { EmployeeTableAdapter adapter = new EmployeeTableAdapter(); adapter.Fill(employeeDt); this.dataGridView1.DataSource = employeeDt; } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } }Please do not forget to accept it as asnwer if it helps you solve the problem.
jingeRank #2,527 · 554 reputationPosted Nov 1, 2009, 6:13 PM EST
petre ricardo155 reputationPosted Nov 1, 2009, 6:19 PM EST
PS: I have created the dataset (dataset1.xsd) using the wizard
jingeRank #2,527 · 554 reputationPosted Nov 1, 2009, 6:25 PM EST
petre ricardo155 reputationPosted Nov 1, 2009, 6:56 PM EST
I still cannot solve the problem...however i;ve sent you an email asking to receive an attachment .....: )
TY
jingeRank #2,527 · 554 reputationPosted Nov 1, 2009, 7:03 PM EST