binding data to a textbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CT

    binding data to a textbox

    Is it possible to bind data from a stored procedure with parameters to a
    textbox that is not located in a datagrid or table?
    I also need to bind the data from the same procedure to a session variable.

    Please explain to me how to do it.

    Thanks


  • GrantMagic

    #2
    Re: binding data to a textbox

    Yes.

    This will depend on what you are returning.
    If it is just one value, you can use the ExecuteScalar command to get a
    single value from the database.

    If it is multple results, your a DataReader to loop through the stored proc
    results, setting the text to the textbox each time
    i.e.
    While(dr.Read()
    {
    tb.Text += dr[0].ToString;
    }

    "CT" <cape@town.co m> wrote in message
    news:u0K%23hgIn EHA.1296@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > Is it possible to bind data from a stored procedure with parameters to a
    > textbox that is not located in a datagrid or table?
    > I also need to bind the data from the same procedure to a session
    > variable.
    >
    > Please explain to me how to do it.
    >
    > Thanks
    >[/color]


    Comment

    • Cor Ligthert

      #3
      Re: binding data to a textbox

      CT,

      Please do not multipost, crosspost this kind of questions to dotNet
      newsgroups.

      Thanks in advance.

      Cor


      Comment

      • GrantMagic

        #4
        Re: binding data to a textbox

        Hi Cor

        What other newsgroup was this posted in?

        Just checking if there's a dotNet newsgroup i'm not using.

        Thanks

        "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
        news:uLBaSfJnEH A.536@TK2MSFTNG P11.phx.gbl...[color=blue]
        > CT,
        >
        > Please do not multipost, crosspost this kind of questions to dotNet
        > newsgroups.
        >
        > Thanks in advance.
        >
        > Cor
        >
        >[/color]


        Comment

        Working...