Author: PetraSwed | Posted on: 5/14/2009 4:44:09 AM | Views : 267

Hi, I have a typicall beginners question: WHAT´S WRONG? Anybody could tell me what I do wrong that Update doesnt work?

protected void DataList1_UpdateCommand(object source,
DataListCommandEventArgs e)
{
String Fr_ID = DataList1.DataKeys[e.Item.ItemIndex].ToString();
String Fr_Text = ((TextBox)e.Item.FindControl("TB_FrEdit")).Text;
String Enk_Id = ((DropDownList)e.Item.FindControl("DDL_EnkEdit")).SelectedValue;

QuestionsDS.UpdateParameters["Fr_ID"].DefaultValue = Fr_ID;
QuestionsDS.UpdateParameters["Fr_Text"].DefaultValue = Fr_Text;
QuestionsDS.UpdateParameters["ID_Enk"].DefaultValue = Enk_Id;
QuestionsDS.Update();

LBL_Message.Text = QuestionsDS.UpdateCommand;
DataList1.EditItemIndex = -1;
DataList1.DataBind();
}

-----------------------

 

<asp:DataList ID="DataList1" runat="server" Data ...

Go to the complete details ...