Sorry guys for possibly repeating an issue that may be answered here before, but I have searched and searched and just cannot get it right. Maybe you can offer a quick solution.
I am using VS 2008 for a .aspx web page in asp.net 3.5
My coding is in VB and I am using MySQL latest version, connecting through a system DSN connection on a virtual server running MS server 2008.
I keep finding solutions that are specific to SQL server or use other types of connections. Don't know if I should be putting '?' or '@' in my query strings to do parameterization. Can you show me specifically what I need to do to translate this to parameterized code? Let's say I want to pass the data 'fielddata1'.
My typical code for a query looks like:
Dim conx As New System.Data.Odbc.OdbcConnection("DSN=mydb")
Dim strsql As String
Dim mycmd As System.Data.Odbc.OdbcCommand
conn.Open()
strsql = "UPDATE tbljunk SET field1=" & field1data & "WHERE pkjunk=1"
mycmd = New System.Data.Odbc.OdbcCommand(strsql, conn)
mycmd.ExecuteNonQuery()
Thanks for reading!
DJ
I am using VS 2008 for a .aspx web page in asp.net 3.5
My coding is in VB and I am using MySQL latest version, connecting through a system DSN connection on a virtual server running MS server 2008.
I keep finding solutions that are specific to SQL server or use other types of connections. Don't know if I should be putting '?' or '@' in my query strings to do parameterization. Can you show me specifically what I need to do to translate this to parameterized code? Let's say I want to pass the data 'fielddata1'.
My typical code for a query looks like:
Dim conx As New System.Data.Odbc.OdbcConnection("DSN=mydb")
Dim strsql As String
Dim mycmd As System.Data.Odbc.OdbcCommand
conn.Open()
strsql = "UPDATE tbljunk SET field1=" & field1data & "WHERE pkjunk=1"
mycmd = New System.Data.Odbc.OdbcCommand(strsql, conn)
mycmd.ExecuteNonQuery()
Thanks for reading!
DJ
Last edited: