Click here to Skip to main content
15,910,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everybody. I have form which getting data from table 'Selling' in this table is next columns
ID - int (have primary key)
BarCode - varchar(100)
ArtNumber - varchar(100)
ProductName - varchar(100)
Price - money
SelfPrice - money
PriceWithOutAWD - money
Comment - nvarchar(50)
DateTime - datetime
Quantity - nvarchar(50)

DataGridView DataSource is sellingBindingSource1. In this for is toolStripMenu with button this button
private void TsmRefresh_Click(object sender, EventArgs e)
        {
            sqlDataAdapter1.Fill(dataSet11);
        }

when i press this button it does not refresh it dublicates same data
next button gets this error Failed to convert parameter value from a String to a Int32. this is button:
private void TsmUpdate_Click(object sender, EventArgs e)
       {
           sqlDataAdapter1.Update(dataSet11);
       }

so my datagridview have problems. Does anybody knows where is problem?
When this form is loading this code works fine :
private void TradeLog_Load(object sender, EventArgs e)
  {
      sqlDataAdapter1.Fill(dataSet11);
  }

Thanks.
Posted
Updated 29-Oct-10 9:48am
v3

1 solution

unfortunately, DataAdapters are never that easy.

I would first try creating the TableMappings for the DataAdapter.

Without setting this first, it often does not work correctly, in my experience.
 
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