Internet is growing Every Seconds :: Industry is growing Every Year

Thursday, July 15, 2004

Public Function Get_Rec :

Public Function Get_Rec :

This method is used to get number of records from the specified table.
It accepts one argument namely sqlstr.
Da is the object of sqlDataAdapter class
Ds is the object of Dataset class
Dt is the object of DataTable.
Fill method of sqlDataadapter class get the records from specified database and stores in the dataset object
This method returns datatable object


Public Function Get_Rec(ByVal sqlstr As String) As DataTable
Dim da As New SqlDataAdapter(sqlstr, con)
Dim ds As New DataSet
Dim dt As DataTable
Try
'MsgBox(sqlstr)
da.Fill(ds)
dt = ds.Tables(0)
da = Nothing
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Return dt
End Function