Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you save the data, guys?
Message
From
06/09/2005 06:07:26
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
How do you save the data, guys?
Environment versions
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01046932
Message ID:
01046932
Views:
66
Ok, here's the deal:

A winform containing several textboxes. The textboxes are bound to a dataset through code like this:
txtBookTitle.DataBindings.Add(new Binding("Text", dsBook, dsBook.Tables[0].ToString() + ".Title"));
I change the textbox's contents, then in Save button I have the following:
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(BookDataAdapter);
BookDataAdapter.UpdateCommand = cmdBuilder.GetUpdateCommand;
BookDataAdapter.Update(dsBook, "Books");
However, nothing happens. dsBook.HasChanges() returns false. Why? What I am missing and where to get this info from? I tried MSDN, but the examples I've found just say DbAdapter.Update(). Well.... i did that and it doesn't update. I have looked into UpdateCommand text, it looks ok. So it has to be something else. What?

Thank you.
Grigore Dolghin
Class Software.
Next
Reply
Map
View

Click here to load this message in the networking platform