I'm developing my 1st website but when I'm trying to insert data into the SQLServer 2005 it inserting null record. I tried as it is on access. again their is a same problem.
Here is my code:
Public Class contactus
Protected Sub submit_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles submit.ServerClick
Dim con As New SqlConnection("Server=MADHAVI-2C085B0;Integrated Security=SSPI; database=alumniDB")
Dim str, str1, un, ua, uc, uco, up, ue, ucom As String
un = Request.Form.Get("uname")
ua = Request.Form.Get("uadd")
uc = Request.Form.Get("ucity")
uco = Request.Form.Get("ucountry")
up = Request.Form.Get("uphoneno")
ue = Request.Form.Get("uemail")
ucom = Request.Form.Get("ucomments")
str = "insert into contactus (UName, UAdd, UCity, UCountry, UPhoneno, UEmail, UComments) values('" & un & "','" & ua & "','" & uc & "','" & uco & "','" & up & "','" & ue & "','" & ucom & "');"
Dim cmd As New SqlCommand(str, con)
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!