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

weird problm on odbccommand parameter.

There's some problem in my parameters.add statement, but
I just don't know where. Can someone tell me ?

I tried to change the STR =? to STR = 'Australia', my
program worked.(There is a lot of tuples with country
= 'Australia' in the table.)

But the STR = ? did not work. I guess there might be
problems on the ODBCParameter part. But I don't know
where.

Dim MyConString As String = "DRIVER={MySQL ODBC 3.51
Driver};SERVER=localhost;DATABASE=litlinker;
UID=;PASSWORD=; OPTION=3"

Dim MyConnection1 As New OdbcConnection(MyConString)
Dim cmdStr as string
cmdStr = "SELECT Name, Country FROM Tab1 Join Tab2 on
Tab1.Name = Tab2.Name Where Country = 'Australia'"
Dim cmd As New OdbcCommand(cmdstr, MyConnection1)

cmd.Parameters.Add("CountryName", OdbcType.Char, 200)
Dim strCountry as string = 'Australia'
cmd.Parameters("CountryName").Value = StrCountry

Thanks a lot!

Nov 20 '05 #1
1 2623
Hello,

"Tracey" <jo********@hotmail.com> schrieb:
There's some problem in my parameters.add statement, but
I just don't know where. Can someone tell me ?

I tried to change the STR =? to STR = 'Australia', my
program worked.(There is a lot of tuples with country
= 'Australia' in the table.)


Notice that you will have a better chance to get an answer if you post the
question to the ADO.NET newsgroup:

news://msnews.microsoft.com/microsof...amework.adonet

Web interface:

http://msdn.microsoft.com/newsgroups...amework.adonet

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

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

Similar topics

13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
2
by: pete moss | last post by:
I finally tried got around to converting an old access 2.0 databases to Access 2000 (these are backend front end databased with the back end tables still in 2.0) Most everything seems to work...
3
by: Holger (David) Wagner | last post by:
Hi all, we're currently developing an application in the .NET environment that needs to access a DLL implemented in Fortran. There is one procedure with about 17 parameters, most of them arrays....
6
by: Roger Cantillo | last post by:
Using and ODBCCommand object, can I tell whether my update command updated successfully without using a datareader?
1
by: VB Programmer | last post by:
I went to a few ASP.NET websites today. For some aspx pages I get this error (too consistently, which is why I think it's my PC): Server Error in '/CuteEditorTest' Application....
1
by: scott | last post by:
Hi all. Thank you for any help that you can offer. Im making a connection to a mySQL data base. I then use OdbcCommand to create a query and then execute it using ExecuteReader. I...
2
by: Cc | last post by:
hi, while I making my own class library using odbc.net I encounter strange problem in this class Public Sub New() ' some code doing openning connection end sub
4
by: Bo Peng | last post by:
Dear list, I spent the last 12 hours in catching this bug (?) and what I found out is very difficult to explain: Basically, I need to call a user-provided function many times, with a tuple as...
3
by: ericooi1976 | last post by:
My problem was it will prompt this message "An unhandled exception of type 'System.Data.Odbc.OdbcException' occurred in system.data.dll", when i click many time of a button "A" that will call the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.