below is a code to input data from vb.net to ms access. in the code SqlCommand is underlined and the error msg is that, is not defined. can somebody tell me how i can define it - Dim Objconn As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\chiscoTransport.mdb;Integrated Security=True;Connect Timeout=30;User Instance=True")
-
Objconn.Open()
-
-
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)
-
-
-
ObjCmd.Parameters.Add("@vehicleID", Data.SqlDbType.VarChar).Value = vehicleIDComboBox.Text
-
ObjCmd.Parameters.Add("@pname", Data.SqlDbType.Text).Value = pnameTextBox.Text
-
ObjCmd.Parameters.Add("@deptureT", Data.SqlDbType.Text).Value = deptureTComboBox.Text
-
ObjCmd.Parameters.Add("@trvllingft", Data.SqlDbType.Text).Value = trvllingftComboBox.Text
-
ObjCmd.Parameters.Add("@pssngerAD", Data.SqlDbType.Text).Value = pssngerADTextBox.Text
-
ObjCmd.Parameters.Add("@phoneNo", Data.SqlDbType.Int).Value = phoneNoTextBox.Text
-
ObjCmd.Parameters.Add("@fare", Data.SqlDbType.Int).Value = fareTextBox.Text
-
ObjCmd.Parameters.Add("@time", Data.SqlDbType.Text).Value = timeTextBox.Text
-
ObjCmd.Parameters.Add("@exptdjd", Data.SqlDbType.Text).Value = exptdjdTextBox.Text
-
ObjCmd.Parameters.Add("@date", Data.SqlDbType.Text).Value = dateTextBox.Text
-
-
-
ObjCmd.ExecuteNonQuery()
-
-
-
Objconn.Close()
2 1498
Hi,
I think , there may be something wrong in one of the paramter values especially you can check for the date.Otherwise command object declaration seems to be Right.
Plater 7,872
Recognized Expert Expert
I think your are missing a namespace include.
If you click on the SQLCommand and hover your mouse there, a little tiny underline should appear under the last character. Mousing over that should give you the option to add the correct namespace.
It could also be that you have capitalization issues. Use CTRL+SpaceBar to auto correct/complete and pick from a list of correct terms.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: RU |
last post by:
Hi,
I am working on a porting project to port C/C++ application from
unixware C++, AT&T Standard components to g++ with STL on Linux. This
application has been working properly on...
|
by: Stu |
last post by:
I am trying to build the xerces shared library with 2.3.0 version of
their source code on an AIX 5.1 32 bit machine with the following
version of the g++ compiler
/usr/local/bin/g++ -v
Reading...
|
by: Mike |
last post by:
I am having a problem when a field is spaces being undefined. I wasn't
sure if the problem was Excel or Javascript, so I thought I would post
here first.
The users are able to select from a drop...
|
by: Codemutant |
last post by:
**** Post for FREE via your newsreader at post.usenet.com ****
I just cannot find what is undefined in this code.
|
by: Foolster41 |
last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a
windows XP OS. I'm trying to compile the code for a multi user dungeon
(MUD) called circle-mud.
When I compile I get the...
| |
by: Don Vaillancourt |
last post by:
What's going on with Javascript.
At the beginning there was the "undefined" value which represented an
object which really didn't exist then came the null keyword. But
yesterday I stumbled...
|
by: Chris Beall |
last post by:
If you want your code to be bulletproof, do you have to explicitly check
for the existence of any possibly-undefined variable?
Example: window.outerHeight is defined by some browsers, but not...
|
by: matty |
last post by:
Hi,
I recently got very confused (well that's my life) about the
"undefined" value. I looked in the FAQ and didn't see anything about
it. On...
|
by: Michael Sgier |
last post by:
Hi
i get thousands of messages like below. How shall i resolve that?
Thanks
Mcihael
Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int,
int, char const*)':...
|
by: VK |
last post by:
(see the post by ASM in the original thread; can be seen at
<http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b>
as an option)
As that is not in relevance to...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |