469,592 Members | 1,788 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

undefined SqlCommand

33
i hv done the correction as i was directed here but the Sqlcommand is still not defined. is still underlined with red. Below is the code again. pls i need help.
the particular SqlComand is on bold.



Expand|Select|Wrap|Line Numbers
  1. Dim Objconn As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector        y|\chiscoTransport.mdb;Integrated Security=True;Connect Timeout=30;User Instance=True")
  2.         Objconn.Open()
  3.  
  4.         Dim ObjCmd As SqlCommand = New SqlCommand("INSERT INTO seatReservation (vehicleID, pname, deptureT, trvllingft, pssngerAD, phoneNo, fare, time, exptdjd, date) VALUES (@vehicleID, @pname, @deptureT, @trvllingft, @pssngerAD, @phoneNo, @fare, @time, @exptdjd, @date)", Objconn)
  5.  
  6.  
  7.         ObjCmd.Parameters.Add("@vehicleID", Data.SqlDbType.VarChar).Value = vehicleIDComboBox.Text
  8.         ObjCmd.Parameters.Add("@pname", Data.SqlDbType.Text).Value = pnameTextBox.Text
  9.         ObjCmd.Parameters.Add("@deptureT", Data.SqlDbType.Text).Value = deptureTComboBox.Text
  10.         ObjCmd.Parameters.Add("@trvllingft", Data.SqlDbType.Text).Value = trvllingftComboBox.Text
  11.         ObjCmd.Parameters.Add("@pssngerAD", Data.SqlDbType.Text).Value = pssngerADTextBox.Text
  12.         ObjCmd.Parameters.Add("@phoneNo", Data.SqlDbType.Int).Value = phoneNoTextBox.Text
  13.         ObjCmd.Parameters.Add("@fare", Data.SqlDbType.Int).Value = fareTextBox.Text
  14.         ObjCmd.Parameters.Add("@time", Data.SqlDbType.Text).Value = timeTextBox.Text
  15.         ObjCmd.Parameters.Add("@exptdjd", Data.SqlDbType.Text).Value = exptdjdTextBox.Text
  16.         ObjCmd.Parameters.Add("@date", Data.SqlDbType.Text).Value = dateTextBox.Text
  17.  
  18.  
  19.         ObjCmd.ExecuteNonQuery()
  20.  
  21.  
  22.         Objconn.Close()
Aug 3 '07 #1
0 801

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Guinness Mann | last post: by
10 posts views Thread by Henrik Dahl | last post: by
2 posts views Thread by Jim Owen | last post: by
1 post views Thread by Tom | last post: by
3 posts views Thread by Jason Huang | last post: by
reply views Thread by Agnes | last post: by
1 post views Thread by job | last post: by
2 posts views Thread by menyki | last post: by
2 posts views Thread by menyki | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.