Hey,
I am a 13 year old developer. I was playing around with SQL Server 2k0 Eval. Edition. Can someone tell me why this wont work?
VB Code:
Dim stringa, stringb As String stringa = Server.HtmlEncode(TextBox1.Text) stringb = Server.HtmlEncode(TextBox2.Text) Dim cmd As SqlCommand Dim cnn As SqlConnection cnn = New SqlConnection("server=localhost;user=dex2;pwd=password1;database=pocketdotnet;") cmd = New SqlCommand("INSERT INTO " & Me.Session.Item("workgroup") & "News (title, disc, postedby, uid) VALUES ('" & stringa & "', '" & stringb & "', '" & Me.Session.Item("username") & "', '" & Int((999999 - 11111 + 1) * Rnd() + 11111) & "'", cnn) cnn.Open() cmd.ExecuteNonQuery() cnn.Close()
Thanks!




Reply With Quote