The following code will connect to an SQL Server 2000 database, retrieve
records from a table, fill a dataset, and bind the dataset to a datagrid
object.
dim conn as SqlConnection = new SqlConnection("Data
Source=(local);Integrated Security=SSPI; Initial Catalog=northwind")
dim da as SqlDataAdapter = new SqlDataAdapter("SELECT CustomerID,
ContactName FROM Customers", thisConnection)
dim ds as dataset = new DataSet
da.Fill(ds, "Customers")
datagrid1.datasource = ds
datagrid1.databind
It isn't necessary to call the databind method if you're creating a Windows
Forms application, but is required for ASP.NET.
"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
I have a stored procedure on Sql Server2k. I can fill a data table which I
can append to a dataset using an ADODB recordset object which gets
populated
from a command object that runs the sp. I was hoping to use a
DataAdapter.
But I think the data adapter only uses select statements. I could write
the
sp in my vb.net app, but the sp references UDF's I wrote in the Sql Sever.
I
will guess that I will need to stick with the ADODB recordset object for
this. But I am open to any better suggestions on how to fill the
datatable/dataset with the data from the stored procedure.
Thanks,
Rich