Paul Clement
10/27/2006 12:46:00 PM
On Thu, 26 Oct 2006 03:05:02 -0700, Roland <Roland@discussions.microsoft.com> wrote:
¤ In my application (ASP.net) I use the following:
¤
¤ MyDataSource.InsertParameters.Clear();
¤ MyDataSource.InsertParameters.Add("AdvID", TypeCode.String, sAdvID);
¤ MyDataSource.InsertParameters.Add("Email", txtEmail.Text);
¤ MyDataSource.InsertParameters.Add("Name", txtName.Text);
¤ MyDataSource.InsertCommand = "INSERT INTO markt.advertizers " +
¤ "(AdvID, Email, Name) VALUES (@AdvertiserID,@Email,@Name)";
¤ MyDataSource.Insert();
¤
¤ When I run the app, I get the excheption:
¤ "ERROR [HYT00] [MySQL][ODBC 3.51 Driver][mysqld-5.0.24a-community-nt]Column
¤ ''AdvID'' cannot be null"
¤
¤ What do I do wrong here (except for using MySQL;-)?
It looks like your parameter is misnamed. The parameter name in your query is @AdvertiserID while
the name of the parameter you are adding to the Parameter collection is AdvID.
Paul
~~~~
Microsoft MVP (Visual Basic)