Values in SqlParameter Collection Editor

Last post 02-21-2006 10:36 AM by fruitopias. 0 replies.

Sort Posts:

  • Values in SqlParameter Collection Editor

    02-21-2006, 10:36 AM
    • Member
      5 point Member
    • fruitopias
    • Member since 02-21-2006, 10:35 AM
    • Posts 1
    I am working on a web form that inserts a record into a SQL database. I am trying to use Visual Studio.Net tools rather than hard-code at this point. I have configured a connection to the database using the SqlConnection control object and have configured a data adapter using the SqlDataAdapter control object. I have provided text boxes for input to the database fields. The text box values are used as the values for the parameters in the SQL Insert statement. Within the SqlDataAdapter, there is a parameters collection that can be edited to add parameters. One of the properties in the editor (called the SqlParameter Collection Editor) is Value, which I want to come from the text box input. It is indicated that the value can only be an "explicit literal." I have tried to enter the text property of a text box in this field, for example txtID.Text, hoping that it would insert the actual value into the database (e.g. 45676). What gets inserted, however is "txtID.Text", and not the text entered into the text box. My question(s) is, "How can I get the value property of this editor to use what is input into the text box?" Or is this even possible? And what use is this editor if only "explicit literals" can be entered for values?

     

    Thanks :)

Page 1 of 1 (1 items)