Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2007

Tip: Looking for answers? Try searching our database.

DataSet fields not updating, no errors being generated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 28 Apr 2007 17:15 GMT
I am using a web service to update some database fields. I used the
dataset designer to define my datatable and tableadapter. I had it
automatically create the insert, update, and delete statements.

When I run the update method, all of the fields are updated except for
four datetime fields. Another attribute these fields have in common is
that they allow nulls. When the method runs, the values in the fields
are not overwritten, they are simply not changed.

Here is the code used for the updating:

PurchaseOrderTableAdapter dAdapter = new PurchaseOrderTableAdapter();

       PoDataSet.PurchaseOrderDataTable ds =
dAdapter.GetDataByPoID(poID);

       foreach (PoDataSet.PurchaseOrderRow dataRow1 in ds)
       {
           dataRow1["PONumber"] = poNumber;
           dataRow1["ConfirmingTo"] = confirmingTo;
           dataRow1["poDate"] = poDate;
           dataRow1["ReqDate"] = reqDate;
           dataRow1["CancelDate"] = cancelDate;
           dataRow1["AllowBackOrder"] = allowBackOrder;
           dataRow1["ShipTo"] = shipTo;
           dataRow1["BillTo"] = billTo;
           dataRow1["ShipVia"] = shipVia;
           dataRow1["FOBPoint"] = fobPoint;
           dataRow1["Terms"] = terms;
           dataRow1["IsPlaced"] = isPlaced;
           dataRow1["placeDate"] = datePlaced;
       }

       try
       {
           dAdapter.Update(ds);
       }
       catch (Exception e)
       {
           return 1 + e.Message;
       }
       return "0";

I am new to C# and .net in general. Any ideas as to why this method is
not updating the "placeDate", "poDate", "ReqDate", and "CancelDate"
fields? The variables used are defined as DateTime types. As I said,
there are no errors flagged during the process.

Your advice is greatly appreciated.

-- Alex
Alex - 28 Apr 2007 18:04 GMT
Figured it out. I was converting the date to a string when the dataset
was created....

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.