473,397 Members | 1,972 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,397 software developers and data experts.

help with using parameters

I have a query which looks like this :"INSERT INTO demo (idperson,
name)SELECT idperson,name FROM ptolemy_person WHERE idperson = @original"
and I have declared a parameter in this way:
OleDbCommand1.Parameters.Add("@original", txtvalue.Text).

the query is supposed to populate a table(demo) with records from another
table(ptolemy_person) based on the id of the records which are typed in the
textbox.

when i run the progam i get this error: THe oledbparameter collection only
accepts non-null oledbparameter type objects. not strings

Can you please help
thanx
be_gentle learner
Jun 15 '06 #1
1 1035
beGentle-Learner,

Depending on the particular database and version of ADO.Net, you might need
to change the parameter placeholder to this:

"INSERT INTO demo (idperson, name) SELECT idperson,name
FROM ptolemy_person WHERE idperson = ?"

At any rate, that is the first thing I would try.

Kerry Moorman
"beGentle-Learner" wrote:
I have a query which looks like this :"INSERT INTO demo (idperson,
name)SELECT idperson,name FROM ptolemy_person WHERE idperson = @original"
and I have declared a parameter in this way:
OleDbCommand1.Parameters.Add("@original", txtvalue.Text).

the query is supposed to populate a table(demo) with records from another
table(ptolemy_person) based on the id of the records which are typed in the
textbox.

when i run the progam i get this error: THe oledbparameter collection only
accepts non-null oledbparameter type objects. not strings

Can you please help
thanx
be_gentle learner

Jun 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DOTNET | last post by:
Hi, Anybody help me regarding this error: I am assigning the values to the session variables when the button is clicked and passing these session variables to the next page and when I am...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
31
by: Extremest | last post by:
I have a loop that is set to run as long as the arraylist is > 0. at the beginning of this loop I grab the first object and then remove it. I then go into another loop that checks to see if there...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
0
by: hshah | last post by:
Hello All, I have created a .aspx page with 7 text boxes and a save button. On click event following code is fired. It save the property information to sql server and also generate a unique Id...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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.