Hello,
I am adding a parameter, with only one code line, when I set a
connection to an Access database:
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title",
OleDbType.VarWChar).Value = "Title Text")
End With
I get the error: "The OleDbParameterCollection only accepts non-null
OleDbParameter type objects, not Boolean objects."
Why is that?
I have been searching for the solution in Google and I can't see why
this is not working.
Thanks,
Miguel 4 1238
Your vb.net syntax is all messy.
you have .Add( <CODE HERE > )
your <CODE HERE> looks like:
New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value =
"Title Text"
which, I guess, is doing an equallity operartion, instead of an assignment.
That is, it's checking if
New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value
IS EQUAL TO
"Title Text"
and return false...hence why it's saying you can't add false to .Add()
It should look like:
..Add(New System.Data.OleDb.OleDbParameter("@title",
OleDbType.VarWChar)).Value = "Title Text"
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eG**************@tk2msftngp13.phx.gbl... Hello,
I am adding a parameter, with only one code line, when I set a connection to an Access database:
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value = "Title Text")
End With
I get the error: "The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not Boolean objects."
Why is that? I have been searching for the solution in Google and I can't see why this is not working.
Thanks, Miguel
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eG**************@tk2msftngp13.phx.gbl... Hello,
I am adding a parameter, with only one code line, when I set a connection to an Access database:
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value = "Title Text")
End With
I get the error: "The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not Boolean objects."
Why is that? I have been searching for the solution in Google and I can't see why this is not working.
Because
.Add(New System.Data.OleDb.OleDbParameter("@title",
OleDbType.VarWChar).Value = "Title Text")
is the same as
dim p as New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar)
dim b as Boolean = (p.Value = "TitleText")
..Add(b);
David
New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value =
"Title Text"
is a boolean expression that returns true if New
System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value is
equal "Title Text" and false otherwise.
Eliyahu
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:eG**************@tk2msftngp13.phx.gbl... Hello,
I am adding a parameter, with only one code line, when I set a connection to an Access database:
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value = "Title Text")
End With
I get the error: "The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not Boolean objects."
Why is that? I have been searching for the solution in Google and I can't see why this is not working.
Thanks, Miguel
Hi Karl,
I had tried that before but I get this error message:
error BC30456: 'Value' is not a member of 'Integer'
In Visual Studio the part
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title",
OleDbType.VarWChar)).Value
End With
Is underlined and associated with that error.
Any idea?
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:karl REMOVE @ REMOVE openmymind REMOVEMETOO .
ANDME net: Your vb.net syntax is all messy.
you have .Add( <CODE HERE > )
your <CODE HERE> looks like:
New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value = "Title Text"
which, I guess, is doing an equallity operartion, instead of an assignment. That is, it's checking if New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value IS EQUAL TO "Title Text"
and return false...hence why it's saying you can't add false to .Add()
It should look like:
.Add(New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar)).Value = "Title Text"
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!)
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message news:eG**************@tk2msftngp13.phx.gbl...
Hello,
I am adding a parameter, with only one code line, when I set a connection to an Access database:
With dbCommand.Parameters
.Add(New System.Data.OleDb.OleDbParameter("@title", OleDbType.VarWChar).Value = "Title Text")
End With
I get the error: "The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not Boolean objects."
Why is that? I have been searching for the solution in Google and I can't see why this is not working.
Thanks, Miguel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: learningGuy |
last post by:
Can someone tell me what is wrong with this simple code?
I get an exception every time at the myFile.Open() line.
I have included the code that I think is needed to for you to answer this
below:...
|
by: Sarah Tanembaum |
last post by:
Beside its an opensource and supported by community, what's the fundamental
differences between PostgreSQL and those high-price commercial database (and
some are bloated such as Oracle) from...
|
by: E. Robert Tisdale |
last post by:
What makes a good C/C++ programmer?
Would you be surprised if I told you that
it has almost nothing to do with your knowledge of C or C++?
There isn't much difference in productivity, for...
|
by: Qiangning Hong |
last post by:
I decide to seperate my data collection routine from my data analysis
and storage program to a seperate process, so I try to use the new
subprocess model in Python 2.4.
The main program spawns...
|
by: typingcat |
last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so
on. I've tried many PHP IDEs today, but almost non of them supported
Unicode (UTF-8) file.
I've found that the only Unicode...
|
by: WindAndWaves |
last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one
of those NEVER USE.
I can understand that it may lead to confusing code, but I often use it like
this:
is this...
|
by: ben |
last post by:
this programme from sedgewick's 'algorithms in c parts 1-4' "is a
sample client program that ... uses a symbol table to find the distinct
values in a sequence of keys (randomly generated or read...
|
by: Enkidu |
last post by:
Beginner question, sorry!
I am using indexers to access an array of StringBuilders in an instance
of a class:
Getting:
value = board1;
Setting:
board1 = value1 ;
|
by: Kid Programmer |
last post by:
Hello guys. I have a question. What's wrong with my compiler. In a simple number averaging program in a GUI window have way into the project I compile the program and I get the following errors:
...
|
by: hirsh.dan |
last post by:
i have a functions that writes information to a file.
inside that function i have a line in which i call another function.
if this line is executed, nothing is written to the file, but if i
remark...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: 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,...
| |