Hello engineers
I hope you all have a good holidays but not me. I am having problem with web form which I want it to post data into SQL server when user click on the button. I don't know what is "Wrong" with my sorry code!!! It bugged me for 4 days now. Can any one please point out what I did wong here: ( the following code is attached to button_click of server button control)
Dim myConnection As SqlConnection = New _
SqlConnection("server=(local);database=WebDatabase ;uid=sa;pwd=")
Dim cmdNewUser As New SqlCommand()
cmdNewUser.Connection = myConnection
cmdNewUser.CommandText = "INSERT INTO UserInfo_T " & _
"(ULastname, Ufirstname, email, Agency, Address, City, State, zip, Phone, LoginName, Password, IsAdministrator) " & _
"VALUES (@ULastname, @Ufirstname, @email, @Agency, @Address, @City, @State, @zip, @Phone, @LoginName, @Password);"
cmdNewUser.Parameters.Add("@Ulastname", txtLastName)
cmdNewUser.Parameters.Add("@firstname", txtFirstName)
cmdNewUser.Parameters.Add("@email", txtEmail)
cmdNewUser.Parameters.Add("@Agency", txtAgency)
cmdNewUser.Parameters.Add("@Address", txtAgencyAddress)
cmdNewUser.Parameters.Add("@City", txtAgencyCity)
cmdNewUser.Parameters.Add("@State", txtAgencyState)
cmdNewUser.Parameters.Add("@Zip", txtAgencyZip)
cmdNewUser.Parameters.Add("@Phone", txtAgencyPhone)
cmdNewUser.Parameters.Add("@loginname", txtLoginName)
cmdNewUser.Parameters.Add("@Password", txtPassword)
cmdNewUser.executeNonquery()
I am using ASP.NET version 1.0XXX. The page I received back said that something ... wrong with connection. Thanks very much in advance for reading my message