I've read up on attaching a dataset to a datagrid and followed all the code snippets I can, but I am still having problems viewing data.
Have a look at this code:
Private Sub ViewCustomers(ByVal vRegion As String) conn.Open() Dim SQLComm = New SqlCommand("SELECT * FROM ViewCustomers('" & vRegion & "')", conn) Dim r As SqlDataReader r = SQLComm.ExecuteReader() dgCustomers.DataSource = r conn.Close() End Sub
The SqlCommand statement within the line
Dim SQLComm = New SqlCommand("SELECT * FROM ViewCustomers('" & vRegion & "')", conn) references a multistatement table function (ViewCustomers(vRegion)) that works when I run the SELECT statement within SQL itself.
I am trying to view the table returned from the function in the datagrid, but it is not updating. What am I missing? I even rewrote the Sub to try to run the code in a dataadapter rather than an SqlCommand, but no results.
Thanks for your help!