T
TheDude5B
Hi,
I have started looking at using Parameters to return values in my
Application. I have some code which shows me how to do this using the
System.Data.OleDb and connecting to an Access database, however I use a
MySql Server with all my information stored on it.
Everything is fine untill I get to the "OleDbType.Integer" part of the
code.
So far my code looks like this:
Dim objCmd As New MySqlCommand("SELECT * FROM sgsnews WHERE news_id =
@ID", Connection)
Dim objReader As MySqlDataReader
Dim objParam As MySqlParameter
objParam = objCmd.Parameters.Add("@ID", MySqlType.Integer) <---
Substituted OleDbType for MySqlType -->
objParam.Direction = ParameterDirection.Input
objParam.Value = tbID.Text
Try
objCmd.Connection.Open()
objReader = objCmd.ExecuteReader
DataGrid1.DataSource = objReader
DataGrid1.DataBind()
objReader.Close()
objCmd.Connection.Close()
Catch ex As Exception
End Try
However the MySqlType does not seem to be recognised. Is this correct
that it should be the MySqlType, or should it still be OleDbType?
Thanks
I have started looking at using Parameters to return values in my
Application. I have some code which shows me how to do this using the
System.Data.OleDb and connecting to an Access database, however I use a
MySql Server with all my information stored on it.
Everything is fine untill I get to the "OleDbType.Integer" part of the
code.
So far my code looks like this:
Dim objCmd As New MySqlCommand("SELECT * FROM sgsnews WHERE news_id =
@ID", Connection)
Dim objReader As MySqlDataReader
Dim objParam As MySqlParameter
objParam = objCmd.Parameters.Add("@ID", MySqlType.Integer) <---
Substituted OleDbType for MySqlType -->
objParam.Direction = ParameterDirection.Input
objParam.Value = tbID.Text
Try
objCmd.Connection.Open()
objReader = objCmd.ExecuteReader
DataGrid1.DataSource = objReader
DataGrid1.DataBind()
objReader.Close()
objCmd.Connection.Close()
Catch ex As Exception
End Try
However the MySqlType does not seem to be recognised. Is this correct
that it should be the MySqlType, or should it still be OleDbType?
Thanks