Hi friends .. i need help
i design simple program in VB .net (i.e) entering emp name , emp no , and date
by clicking the submit button i want to save the data in EXCEL or any database.
can anyone know means ... help me ,,,
My mail id : [email protected]
Thanks
Regards
vinodh
Loading
Suthish NairPosted Dec 2, 2010, 3:29 AM
That not a good way of codeing, refer link..
http://www.c-sharpcorner.com/UploadFile/puranindia/ParameterizedQuerySQLInjectionAttacks08102009011903AM/ParameterizedQuerySQLInjectionAttacks.aspx
jeevaPosted Dec 2, 2010, 12:48 AM
Try
Dim s1 As String = TextBox1.Text
Dim s2 As String = TextBox2.Text
Dim s3 As String = datetimepicker1.value
cmdstr = "insert into empl values('" & s1 & "','" & s2 & "','" & s3 & "')"
cmd = New SqlCommand(cmdstr, con)
con.Open()
cmd.ExecuteNonQuery()
MessageBox.Show("new row added successfully")
Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
con.Close()
End Try
Suthish NairPosted Nov 30, 2010, 9:53 AM