![]() |
| ||
| Inserting values into the database using a asp.net button click Hi all, I am new to asp.net programming and i have to design a website which should accept values from the user and store it in the databse on a button click event. I am not able to do it In fact i have written a code for button click the code is as follows: Dim conn As New SqlConnection the problem that i am facing is at cmd.ExecuteNonQuery() the error message i am getting is tht the ExecuteNonQuery is not initialized.. Thanks in advance ... Karthik. |
| ||
| Re: Inserting values into the database using a asp.net button click Maybe cmd.CommandType needs to be stated as text. |
| ||
| Re: Inserting values into the database using a asp.net button click try cmd.CommandType = CommandType.Text before cmd.CommandText = "INSERT ... |
| ||
| Re: Inserting values into the database using a asp.net button click Hi Dani, Thanks for your reply and i have a new problem with the insert command that iam using please help me out myCommand = New SqlCommand("Insert into Employee Data values(ddlid.selectedItem,'" & txtname.Text & "',ddldesig.selectedItem,'" & txtcontno & "')", "myConnection")Whats wrong with my insert command that i am using in my code... Thanks in advance Karthik. |
| ||
| Re: Inserting values into the database using a asp.net button click Try this : DdlId.SelectedItem.Text; |
| ||
| Re: Inserting values into the database using a asp.net button click Hi, you still forgot for DropDownList myCommand = New SqlCommand("Insert into Employee Data values('" & ddlid.selectedItem & "','" & txtname.Text & "','" & ddldesig.selectedItem & "','" & txtcontno.Text & "')", "myConnection") |
| All times are GMT -4. The time now is 4:20 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC