Datatable/DataView --> DataAdapter - ThX !
I'm not sure how to do this, and at lost trying to figure it out.
Plz help.
I want to be able to do this:
objConn = CreateConnStr() 'returns sqlconnection
dataAdapter = New System.Data.SqlClient.SqlDataAdapter(strSql, objConn)
dataSet = New DataSet
If Page.IsPostBack() Then
dataAdapter.Fill(dataSet)
lblRecordCount.Text = CStr(dataSet.Tables(0).Rows.Count)
dataSet = Nothing
dataSet = New DataSet
End If
dataAdapter.Fill(dataSet, 1, 10, "TABLE01")
datalist01.DataSource = dataSet.Tables("TABLE01").DefaultView
datalist01.DataBind()
However, I have a sqlclass that returns a datatable.
When I instaniate dataadapter, I pass the connectionstring and sqlconnection.
(I don't want to re-create the sqlconnection).
Is there a way I can take advantage of my sqlclass that returns the datatable?
Again, thank you for all posts !
|