Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem With Update
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Problem With Update
Divers
Thread ID:
01437326
Message ID:
01437326
Vues:
119
I am calling a stored proc to get back a DS of data:
CREATE PROCEDURE wit_GetPickListData
	@ItemType	VARCHAR(20)

AS
BEGIN

	SELECT ItemKey, ItemType, Caption, ItemDesc
		FROM wit_PickLists
		WHERE ItemType = @ItemType
		ORDER BY Caption

END
I then bind the data set to a listbox and a text box:
// Bind the data set to the listbox
lstItems.DataSource = dsItems.Tables[0];
lstItems.DisplayMember = "Caption";

lstItems.SelectedIndex = -1;

// Bind the caption
txtCaption.DataBindings.Add("Text", dsItems.Tables[0], "Caption");
After I change the value in the textbox I can see te change in the DS using the visualizer. I call UpdateDataSet:
public void UpdateDataSet(DataSet oDS, string sTableName)
{
    if (sTableName == null)
    {
        sTableName = oDS.Tables[0].TableName;
    }

    DataTable oTable = oDS.Tables[sTableName];

    foreach (DataRow oRow in oTable.Rows)
    {
        oRow.EndEdit();
    }

    try
    {
        _oAdapter.Update(oDS, sTableName);
    }
    catch (SqlException e)
    {
        throw e;
    }
}
It's erroring with "Procedure or function 'wit_GetPickListData' expects parameter '@ItemType', which was not supplied."

I don't understand this at all. Why does .Net care about this proc at this point?? What am I doing wrong here???
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