473,399 Members | 2,159 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,399 software developers and data experts.

Question About MySQL and .NET

Hi all, writing a VB.NET app using the MySqlConnection client and having a
hard time with MySqlCommand Parameter queries. I create a query like this:
cmd.CommandText = "INSERT INTO Location_Lookup (Description, ID) VALUES
(@desc, @id)"
cmd.Parameters.Add("@desc", MySqlDbType.VarChar, 128).Value = val
cmd.Parameters.Add("@id", MySqlDbType.Int32).Value = seedid
cmd.ExecuteNonQuery()

I keep getting the following error mesasge: Column 'Description' cannot be
null

I've verified the values of the val ("Armenia") and seedid (10) variables.
Neither is null. I've also verified the two MySqlParameters added to the
MySqlCommand.

Can anyone offer a solution or point me in the right direction to find MySQL
sample code for the .NET connector?

TIA


Jul 23 '05 #1
1 1144
Never mind, I think I solved the problem. Instead of the @ sign, it looks
like parameter names are preceded with ?.

Thanks

"Michael C#" <xy*@abcdef.com> wrote in message
news:fo*****************@fe08.lga...
Hi all, writing a VB.NET app using the MySqlConnection client and having a
hard time with MySqlCommand Parameter queries. I create a query like
this:
cmd.CommandText = "INSERT INTO Location_Lookup (Description, ID) VALUES
(@desc, @id)"
cmd.Parameters.Add("@desc", MySqlDbType.VarChar, 128).Value = val
cmd.Parameters.Add("@id", MySqlDbType.Int32).Value = seedid
cmd.ExecuteNonQuery()

I keep getting the following error mesasge: Column 'Description' cannot
be null

I've verified the values of the val ("Armenia") and seedid (10) variables.
Neither is null. I've also verified the two MySqlParameters added to the
MySqlCommand.

Can anyone offer a solution or point me in the right direction to find
MySQL sample code for the .NET connector?

TIA


Jul 23 '05 #2

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

Similar topics

2
by: j-marvin | last post by:
hi- i have a book on mysql written for version 4 that has hard to read screen shots. i'd like to get a newer mysql book. do i have to worry about the version number of mysql i am using if i use...
0
by: MJL | last post by:
This is a mysql/php question (but a little more on the mysql side.) The two are so closely related these days, I thought it would be ok to ask here. I installed on my Suse Linux system mysql 4.0...
8
by: Tony Clarke | last post by:
Hi, Just a quick question about performance with MySQL & PHP. If I had a table in a MySQL database with about 100,000 records in it and I need to find the last record is there a quick way to do...
0
by: Ben Margolin | last post by:
I am new to subselects, and what I really want is to do them in an update, but the following shows a simpler select, that also doesn't seem to work as I think it should. Advice? Do I just...
0
by: Charles Cantrell | last post by:
I have recently set up mySQL on a Mandrake release of Linux (Version 7 of Mandrake, I believe), using the binary 4.0.13 standard release. The set up and start up all were normal, as far as I...
5
by: jayson_13 | last post by:
Hi, I need to implement a counter and i face problem of locking so hope that u guys can help me. I try to do test like this : 1st connection SELECT * FROM nextkey WHERE tblname = 'PLCN'...
2
by: kimshapiro100 | last post by:
Question on PhP, MySQL I am thinking of a consumer internet business for which I will have to have a database driven site built. I am thinking of using PhP, MySQL as the main technologies...
18
by: Frances | last post by:
I want to learn PHP.. I know JSP, Servlets, have been using Tomcat for 2 years now, and even though I know there are ways you can use PHP in conjunction with Tomcat, I'd rather not tinker with...
2
by: redefined.horizons | last post by:
I'd like to introduce myself to the group. I am currently researching the use of MySQL as a database backend for AutoCAD Map 3D. I will hopefully be doing some work with geospatial data in MySQL. ...
1
by: rockdale | last post by:
Well, I guess I did express myself very clearly. I implemented the Ent Lib 2.0 data block against SQL database successfully. The system now is a production system. But now we want to migrate the...
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
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
Oralloy
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,...
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
tracyyun
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...
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.