there must be a primary key in the table you are update through adapter..



On Fri, Jan 16, 2009 at 1:29 PM, Benj Nunez <[email protected]> wrote:

>
> Yes. I did that, in fact I tested several lines of code for the Update
> () method, but still no go. :(
>
> Here's what my method looks like:
>
>
>                public void saveTrimmedResultsEx(ref DataSet ADataSet)
>                {
>                        //Console.Out.WriteLine(builder.GetUpdateCommand
> ().CommandText.ToString());
>                        //adapter.Update(ADataSet, "TBL_MFQueryResult"); //
> commit changes
> to database.
>                        try
>                        {
>                                // adapter.Update(ADataSet.Tables[0]); //no
> go
>                                // adapter.Update(ADataSet,
> "TBL_MFQueryResult"); // no go
>                                //adapter.Update(ADataSet, "TBL_MF");
>                                // adapter.Update(ADataSet);  //no go
>                                adapter.Update(ADataSet, "TBL_MF");  //
> ideal but no go
>                        }
>                        catch (Exception ex)
>                        {
>                                Console.Out.WriteLine("Error: {0}",
> ex.Message);
>                         }
>                }
>
>
>
>
> On Jan 16, 5:21 pm, Usman <[email protected]> wrote:
> > have u tried passing table name as an argument to the adapter's update
> > function, if not try this coz sometimes just
> > dataset doesn't work with this approach.
>



-- 
Muhammad Arif
Software Engineer
+923009347315

Reply via email to