Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changes To DataSet Not Being Saved
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Changes To DataSet Not Being Saved
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352069
Message ID:
01352069
Vues:
60
I have the dataset bound to textboxes on the form:
txtTitle.DataBindings.Add("Text", oDataSet, "ItemRow.Title");
txtCategory.DataBindings.Add("Text", oDataSet, "ItemRow.Category");
txtAuthor.DataBindings.Add("Text", oDataSet, "ItemRow.Author");
txtCatNo.DataBindings.Add("Text", oDataSet, "ItemRow.Catalogue_No");
txtIsbn.DataBindings.Add("Text", oDataSet, "ItemRow.Isbn");
txtPublisher.DataBindings.Add("Text", oDataSet, "ItemRow.Publisher");
In SaveChanges I then pass the oDataSet variable to this code in my Data Access class:
public bool UpdateDataSet(DataSet oDataSet, string sTableName)
{
	bool bRetVal = true;

	try
	{
		DataRow oRow = oDataSet.Tables[0].Rows[0];
		DataRowState state = oRow.RowState;                \\state = Unchanged

		oAdapter.Update(oDataSet, sTableName);
	}
	catch(SqlException e)
	{
		oException = e;
		bRetVal = false;
	}
	return bRetVal;
}
The DataAdapater is stored as oAdapter on the data access class. When I run this, it doesn't error, but it also doesn't save.

Anyone wanna set a newbie straight?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform