Now i am tring to make a data set by creating it in separte DLL file(using VB net)
the code i used in this dll fle aready workong in my form but i tried to use it by this
diffrent way ,,,but no way
this is the code of the dll file.

Bonjour tous les monde,,

Now i am tring to make a data set by creating it in separte DLL file(using VB net)
the code i used in this dll fle aready workong in my form but i tried to use it by this 
diffrent way ,,,but no way
this is the code of the dll file.

Public Class WAELDS2
    Private _MAXROWSXX As Integer
    Public Property MAXROWXX() As Integer
        Get
            MAXROWXX = _MAXROWSXX
        End Get
        Set(ByVal value As Integer)
            _MAXROWSXX = value
        End Set
    End Property
    Public Sub DATASETWAEL()
        Dim MAXROWSXX As Integer
        Dim con As New OleDb.OleDbConnection
        Dim da1 As OleDb.OleDbDataAdapter
        Dim dbprovider As String
        Dim dbsource As String
        Dim dsA As New DataSet
        Dim Tsql As String
        da1 = Nothing
        Dim cb1 As New OleDb.OleDbCommandBuilder(da1)

        dbprovider = "Provider = Microsoft.ace.OLEDB.12.0;"
        dbsource = "Data Source = D:\SoftWare\MyProjet\AL-MASRIA\WindowsApplication1\lesFactures.accdb"
        con.ConnectionString = dbprovider & dbsource
        con.Open()
        Tsql = "select * from TFACT"
        da1 = New OleDb.OleDbDataAdapter(Tsql, con)
        da1.Fill(dsA, "ZEZO")
        MAXROWSXX = dsA.Tables("ZEZO").Rows.Count
        con.Close()
    End Sub
    and that is the code for calling the dataset in the form .
 
Private Sub Button2_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim myCalc As New ClassLibrary1.WAELDS2
        Dim XYZ As Integer
        Call myCalc.DATASETWAEL()
        XYZ = myCalc.MAXROWXX
        MsgBox(XYZ)
    End Sub

it always give me 0 evenif the table contains 8 records
plz help ty;

Try setting the class variable directly instead of setting it through the property locally.
And see if it helps by changing the property as well.
Try this:

Public Property MAXROWXX() As Integer
        Get
            'Here is the change
            Return _MAXROWSXX
        End Get
        Set(ByVal value As Integer)
            _MAXROWSXX = value
        End Set
    End Property

'And in the DATASETWAEL method
_MAXROWSXX = dsA.Tables("ZEZO").Rows.Count

Also, VB.NET does not require the use of Call.
It's not wrong, just not needed. :)
Just type myCalc.DATASETWAEL() straight up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.