Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Update is not happening with this code .please help me to resolve it

C#
 public ProductsTableAdapter pta;
 public ProductsDS dataset;
         private void button1_Click(object sender, RoutedEventArgs e)
                {                       
                ProductsDS dataset = new ProductsDS();
                ProductsTableAdapter pta = new ProductsTableAdapter();                                                                                                                                  this.CustomerGrid.ItemsSource = dataset.Products;
                pta.Fill(dataset.Products);  
               }
private void button2_Click(object sender, RoutedEventArgs e)
        {                       
                pta.Update(dataset.Products);        

            
           
        }



Thanks in advance
Posted

1 solution

First thing to check is the UpdateCommand defined properly. Also do you get any errors when Update is executed?
 
Share this answer
 
Comments
[no name] 3-Jan-12 14:26pm    
Null Exception error is occuring
Wendelius 3-Jan-12 14:29pm    
That sounds very much like the update command is not set at all. Have you checked it? For example using debugger, see the properties of the pta

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