473,503 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySqlType | OleDbType

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

Oct 4 '06 #1
0 1148

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2911
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
6
1768
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and...
1
1194
by: sincethe2003 | last post by:
Which OleDbType is correct for DateTime field in Access 2000 database?
1
1937
by: voidfill3d | last post by:
I have a field in a table that is of the datatype "Text". I also have a store procedure which updates this field and has a parameter of the same datatype ("Text"). However, in ASP.NET,...
4
2671
by: Solva | last post by:
I using VB.NEt to connect to a Access Database. When I try to add a record to the customer table. It gives me this error. An unhandled exception of type 'System.Data.NoNullAllowedException'...
11
1817
by: John | last post by:
Hi I had a working vs 2003 application with access backend. I added a couple fields in a table in access db and then to allow user to have access to these fields via app I did the following; ...
1
1521
by: agent47 | last post by:
Hi, I'm trying to parameterize my queries. I'm getting an error with the field that is a memo in access database. I think it is because the OleDbType value I put in. What type should I use for memo?...
14
1591
by: =?Utf-8?B?R3JlZ2cgV2Fsa2Vy?= | last post by:
Hopefully someone can set me straight on this issue. I was testing some code where I have a method that is being overriden. The method overrides were working fine until I passed a literal 0 (int...
1
2423
by: =?Utf-8?B?QUEyZTcyRQ==?= | last post by:
How can I fill an array for each type in OleDbType where column1 is the literal and column 2 is its numeric value as string? BigInt 20 Binary 128 etc. Thanks.
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.