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
Hi friends .. i need help
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
jeeva3 pointsPosted Dec 1, 2010, 7:48 PM EST
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 NairRank #93 · 22.6K pointsPosted Dec 1, 2010, 10:29 PM EST
That not a good way of codeing, refer link..
http://www.c-sharpcorner.com/UploadFile/puranindia/ParameterizedQuerySQLInjectionAttacks08102009011903AM/ParameterizedQuerySQLInjectionAttacks.aspx
1 short reply
Suthish NairRank #93 · 22.6K pointsPosted Nov 30, 2010, 4:53 AM EST