Dataset Update Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikzworld
    New Member
    • Sep 2007
    • 6

    Dataset Update Issue

    hi guyz,


    I do have a dataset Ds1(Typed Dataset), containing DataTable Dt1, I have,

    textbox1.text = ds1.tables["dt1"].Rows[0]["empid"].ToString();
    textbox2.text = ds1.tables["dt1"].Rows[0]["empname"].ToString();
    -------
    -------
    -------got another 40 textboxes more ..........

    when i edit the textboxes, the changes should be made directly to the ds1.- dt1

    i tried using ds1.AcceptChang es(); but aint working. :( .......

    then tried this set......

    ds1.tables["dt1"].Rows[0]["empid"] = textbox1.text; ....... this worked

    but is it necessary to write code individually for all textboxes or is there any other method to do so?

    I am need to pass the updated ds1 values to a webservice , so dataadapter.upd ate(ds1) can be omitted !!!



    Thanks
    Last edited by nikzworld; Oct 5 '07, 04:49 AM. Reason: forgot to add a point
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    is this in windows forms or asp .net?

    it its asp .net then yes, you will have to code it for each individual item.

    if its windows form then you can do something called binding

    i almost sound "logical" with the if's and else's

    cheers!

    Comment

    Working...