473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

SQL database communication errors

33
here is an input code i wrote to input data from the user interface to database in access. error occured when i tried to run the problem. the error messages are as follow.
1. ObjCmd is not declared
2. SqlCommand is not defined.

Expand|Select|Wrap|Line Numbers
  1. Private Sub submitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submitButton.Click
  2. Dim Objconn As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector  y|\chiscoTransport.mdb;Integrated Security=True;Connect Timeout=30;User Instance=True")
  3.         Objconn.Open()
  4.  
  5. ObjCmd = 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)
  6.  
  7.  
  8. ObjCmd.Parameters.Add("@vehicleID", Data.SqlDbType.VarChar).Value = vehicleIDComboBox.Text
  9. ObjCmd.Parameters.Add("@pname", Data.SqlDbType.Text).Value = pnameTextBox.Text
  10. ObjCmd.Parameters.Add("@deptureT", Data.SqlDbType.Text).Value = deptureTComboBox.Text
  11. ObjCmd.Parameters.Add("@trvllingft", Data.SqlDbType.Text).Value = trvllingftComboBox.Text
  12. ObjCmd.Parameters.Add("@pssngerAD", Data.SqlDbType.Text).Value = pssngerADTextBox.Text
  13. ObjCmd.Parameters.Add("@phoneNo", Data.SqlDbType.Int).Value = phoneNoTextBox.Text
  14. ObjCmd.Parameters.Add("@fare", Data.SqlDbType.Int).Value = fareTextBox.Text
  15. ObjCmd.Parameters.Add("@time", Data.SqlDbType.Text).Value = timeTextBox.Text
  16. ObjCmd.Parameters.Add("@exptdjd", Data.SqlDbType.Text).Value = exptdjdTextBox.Text
  17. ObjCmd.Parameters.Add("@date", Data.SqlDbType.Text).Value = dateTextBox.Text
  18.  
  19.  
  20.         Objbtn.ExecuteNonQuery()
  21.  
  22.  
  23.         Objconn.Close()
  24.     End Sub
Jun 29 '07 #1
1 977
kenobewan
4,871 Expert 4TB
Have you checked your references?
Jun 30 '07 #2

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

Similar topics

3
by: Tim Reynolds | last post by:
I support a .Net application running on a SERVER accessing MF Db2 data. Occasionally, we have some type of connection problem that we have been unable to debug up to this point. We typically...
5
by: Paul H | last post by:
How do you folks get a reliable and complete brief of what is required before development starts? I am forever going back to a client once a project has started saying "Hang on, now that I've...
3
by: carmen | last post by:
I'm working in an aplication for a Smart Device that need to "talk" with a printer continuosly through the serial port. I'm trying to use the John Hint's sample code "Use P/Invoke to develop a .NET...
1
by: shsandeep | last post by:
Hi, I get the following error when trying to connect to a database: (I have cataloged the node and database and they show up in list node directory and list db directory): SQL30081N A...
0
by: MenakaMeena | last post by:
When i try to execute my application based on swing that runs in eclipse platform, the frame is not opening when i login and i get the error (backend is DB2) Error code: 129 Cannot connect to...
1
by: stevesnow | last post by:
---------------------------------------------- Please forward this work experience & skills summary to your Database & software development, MIS/IT/Software Department for review. ...
10
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
2
by: ink | last post by:
Hi all, My company does things in a very specific way. Meaning we never query the database directly, we always use Stored Procedures. What i would like is to develop one data provider class...
2
by: db2doubts | last post by:
Hi, I am new to DB2, i want to catalog DB2 databases in Control Center(Windows) but databases exist in AIX server I catalog the database by following commands in CLP (windows) =>catalog...
1
by: toffees | last post by:
Hi, I am having some problems getting an application server to connect to the database server. Both servers run on Windows 2000 Server. DB2 version 7.2 is running on the database server. I am able...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.