Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you save the data, guys?
Message
De
06/09/2005 06:07:26
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
How do you save the data, guys?
Versions des environnements
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01046932
Message ID:
01046932
Vues:
65
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform