Results 1 to 3 of 3

Thread: Access columns in dataset!please help

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    14

    Question Access columns in dataset!please help

    Hi Everybody!,

    i have a problem and i'd like to have your help.
    here is my problem i have a dataset with three columns including UserID,UserName,Password.I want to get the UserID to a Session variable, how do i access the dataset so that i can have a session name UserID that i get in the dataset in my web page.
    Thank you very much.

    Minh anh

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: Access columns in dataset!please help

    Try puting something like this in your data grid EditCommand procedure.
    VB Code:
    1. DataGrid1.DataKeyField = "UserID"
    2. DataGrid1.EditItemIndex = e.Item.ItemIndex
    3. DataGrid1.DataBind()
    4. Session("UserID") = e.Item.Cells(0).Text
    David Wilhelm

  3. #3
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: Access columns in dataset!please help

    Code:
    Session["UserID"] = MyDataSet.Tables[x].Rows[y]["UserID"].ToString();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width