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:
  1. Dim stringa, stringb As String
  2.         stringa = Server.HtmlEncode(TextBox1.Text)
  3.         stringb = Server.HtmlEncode(TextBox2.Text)
  4.         Dim cmd As SqlCommand
  5.         Dim cnn As SqlConnection
  6.         cnn = New SqlConnection("server=localhost;user=dex2;pwd=password1;database=pocketdotnet;")
  7.         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)
  8.         cnn.Open()
  9.         cmd.ExecuteNonQuery()
  10.         cnn.Close()

Thanks!