filling a table

V

vinnie

i made a little application. I have created the table in Sql server.

Now, i have put in my application a datagridView, i have a DataSet, a
Binding source and a Table Adapter.

I was adding the following code to the button "Edit", but i get en
error msg:

" No Overload for method 'Fill' takes '0' arguments "

The is:
private void BtnEdit_Click(object sender, EventArgs e)
{
CMSDataSet.Clear();
tbl_WorketTableAdapter.Fill();
}

what's wrong? What i should change to make it working?

Thanks
 
N

Nicholas Paldino [.NET/C# MVP]

vinnie,

You need to pass the table adapter a DataTable to populate and then bind
to that. Your BindingSource should use the DataTable as its data source.
 
C

Cor Ligthert[MVP]

private void BtnEdit_Click(object sender, EventArgs e)
{
CMSDataSet.Clear();
tbl_WorketTableAdapter.Fill(CMSDataSet);
}

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top