saving data to the database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mercea
    New Member
    • Aug 2007
    • 35

    saving data to the database

    hi,
    i need help!
    i am developing a web application where the user inputs some data via
    textboxes and it is saved in a database. i have written the following
    code to pass the parameter values to a gridview. it generates no
    errors but nothing is displayed on the gridview page. what method do i
    use to save the data to the database since this does not work?

    public void login1_Click(ob ject sender, EventArgs e)
    {


    addstudentinfo. InsertParameter s["Surname"].DefaultValue =
    TextBox1.Text.T oString();
    addstudentinfo. InsertParameter s["Names"].DefaultValue
    =
    TextBox2.Text.T oString();
    addstudentinfo. InsertParameter s["Regno"].DefaultValue
    =
    TextBox3.Text.T oString();
    }
    Thank you
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    moved to .NET forum

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      Great you have created some parameters. How do you intend to use them?

      Comment

      • mercea
        New Member
        • Aug 2007
        • 35

        #4
        Originally posted by kenobewan
        Great you have created some parameters. How do you intend to use them?
        hi,
        i want to insert the values of the textboxes into a gridview.(i have the gridview set up on another page. it's ID=addstudentin fo). i thought the insertparameter () method takes care of saving the data to the database but the gridview comes up blank at runtime

        Comment

        Working...