MySqlType | OleDbType

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top