cj said:
Armin, you and Cor sound like you know what your doing. I'm pretty
new to .net. I really don't understand why I need to set parameters
and I'm not using ADO.Net.
No, you do use ADO.Net. The SqlConnection, OdbcConnection, Oledbconnection
and OracleConnection are all part of ADO.net:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconadonetconnections.asp
What I was trying to say is that I thought your problem is not related to
VB.Net. It is a more common problem, /not related/ to a specific
programming language even though you are /using/ a specific language.
I think I know VB.Net quite well and I hope I can help with many VB.Net
language related problems, but ADO.Net is nothing that is related to the
language. It is a part of the Framework that can be discussed even without
any language (apart from English ;-) ). If I wanted to help people having
ADO.Net problems, I would read the ADO.Net group. Now I am reading here and
still find ADO.net specific discussions. That's why I tried to kindly point
you to the ADO.Net group.
Nevermind, we can keep on leading the started discussion /here/, of course.
Perhaps this would help. Below is my entire program. Only the
connection
strings have been removed for security. It isn't long. I'm sure an
expert like one of you would have no problem showing me how to fix it. I
have commented the code as best I can to show the problem area.
Please do not simply say the code is junk and suggest I try another way
completely. To help me learn and understand what is happening I need to
see what is wrong with what I am doing. Eventually I might find a better
way to write all this.
Thanks for your help. Below is the code you can paste it right into a
blank windows application.
First, you should enable Options Strict. Turning off compiler checks can
lead to unnecessary faults at runtime.
I didn't analyze the code completely, but maybe all you are looking for are
the QuotePrefix and QuoteSuffix properties of the SqlCommandBuilder. If you
set
MySqlCmdBuilder.QuotePrefix = "["
MySqlCmdBuilder.QuoteSuffix = "]"
then you probably don't have to parse the Insertcommand. I can't test it
because I don't have an SqlServer here.
Armin