If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Asp.net vb.net Problem

Hi Everyone,

I'am two thirds of the way along with my project but for this one line.
I have 3 dropdown lists where I'am trying to take there selected values and update my database.
My program seems to be getting these values yet they wont go in.

Notice my batch parameter is a string so it must be wrapped in single quotes.
You were absolutely right I was using the wrong concatenation for strings i.e. + is wrong, & is right ...
In vb 6 it is ----> &
in vb.net it is -----> +
in vb.net and Mysql once again it is -----> &

Re: Asp.net vb.net Problem

In vb 6 it is ----> &
in vb.net it is -----> +
in vb.net and Mysql once again it is -----> &

Actually it is & in all versions of VB after VB3 including all versions of VB.Net

+ will work in all of them as well but you should always use & as of VB4 and later

You should also be using .ToString on those values that are numeric vars. such as shift should be shift.ToString
I take it that you do not have option strict enabled as it would be triggering an error complaining about mixing variable types if it were

Re: Asp.net vb.net Problem

Basically it forces a more strict method of coding and can help to eliminate runtime errors by alerting you to them when you are still in the IDE. There are options in the IDE for Option Explicit and Option Strict.

Option Explicit forces you to declare all variables before using them.
Option Strict forces you to use the correct variable types or conversions.

For example you can combine a string and an integer if Option strict is off but if it is on you must convert one of them to the type of the other. You could add a double to a long without it on but with it will require you to make a conversion or use a different var.

Basically these options force you to write better code and reduce the chance that your program will crash due to miss use of a variable