I can´t load Data

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Guest

I can´t load Data

Post by Guest » Wed 16 Mar 2005 14:38

Hi,

I have installed an mysql Server on my PC.
than i have installled Mysql Direct!

On a new form i have load "Mysql Connection 1".
When i test the connection, it came "Successfully connected".


I have the table "users" in my Database! I want to read all data in this table.

How i can make it?

( sorry for my bad englisch )


Thanks :)

Serious

Post by Serious » Wed 16 Mar 2005 15:18

Please see DataSet and DbTable samples (you can find it in MySqlDirect .NET installation folder).

Guest

Post by Guest » Thu 17 Mar 2005 16:42

Hello,


Now i Have this:

Code: Select all

Imports CoreLab.Mysql

Public Class Form1
    Inherits System.Windows.Forms.Form
    Friend Connection As MySqlConnection
    Friend Retries As Integer = 3


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub


    Private Sub btConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btConnect.Click

        Connection.Close()

        Connection.UserId = TextBox1.Text
        Connection.Password = TextBox2.Text
        Connection.Host = TextBox4.Text
        Connection.Port = Convert.ToInt32(TextBox5.Text)
        Connection.Database = TextBox3.Text

        Try
            Connection.Open()
            DialogResult = DialogResult.OK
        Catch Exc As MySqlException


            Retries = Retries - 1
            If Retries = 0 Then
                DialogResult = DialogResult.Cancel
            End If

            Select Case Exc.Code
                Case 1045
                    ActiveControl = Connection.Password
                Case 2003
                Case 2005
                    ActiveControl = Connection.Host
            End Select

            Throw
        End Try
    End Sub
End Class

The Problem is, "MySqlException" becomes the error:

Code: Select all

Error3		Reference required to assembly 'System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' containing the base class 'System.Data.Common.DbException'. Add one to your project.	C:\Dokumente und Einstellungen\Stephan\Lokale Einstellungen\Anwendungsdaten\Temporary Projects\WindowsApplication1\Form1.vb	27	21	

what can i do?


Thanks

Serious

Post by Serious » Fri 18 Mar 2005 11:59

We are using .NET Framework v2.0.40607 to build and test corresponding version of MySQLDirect .NET. Probably you are using another version of Microsoft ® .NET Framework 2.
We plan to perform testing of our product with other versions of .NET Framework 2 in the nearest future.

Guest

Post by Guest » Fri 18 Mar 2005 13:19

Hello,

Now, I have load the Sample "SetData" and I see, the data from the Table "users" are loaded.


But now in My Projekt it doesnt work.

Can you help me, please?

The Connection with "MySQLConnection1" works!
I have a Connection open.

And now i want to load Data from users!

Thank you

Serious

Post by Serious » Fri 18 Mar 2005 15:48

If DataSet demo sample suits you to some point you can use it as you wish adding the needed functionality.

Post Reply