how to assign select statement value to text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramanan ram
    New Member
    • Feb 2012
    • 26

    how to assign select statement value to text box

    Code:
    string sid;
    if (Request.QueryString["empid"] != null)
    {
        sid = Request.QueryString["empid"];
        OleDbConnection conn1 = new OleDbConnection(conn);
        String sql = string.Format("SELECT * FROM ADDRESS WHERE EMPID = {0}", sid);
        conn1.Open();
    }
    the above coding empid value getting from previous page .this field primary key in the table for example:the empid value is 4 assign to sid .based on using select statement to get the single row ,this stage address table have 4 fields each value want to show the textbox.
    plz give the solution
    Last edited by PsychoCoder; Mar 27 '12, 06:58 AM. Reason: Made code more readable and formatted
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Check out this article for a quick overview of how to use a DataReader to retrieve the data from your database and display it:

    How To Use A Database In Your Program

    -Frinny

    Comment

    Working...