I am using this vb.net code file to call a procedure to get dates (among other things). When I execute this procedure in SQL 2005 Server Management Studio, I get about 10 columns. However when I execute this code, the dataset seems to only have one index value, maybe I am misunderstanding something. When I change this
ds.Tables(0).Rows.Count.ToString
to
ds.Tables(1).Rows.Count.ToString <---changing the index value to 1
(or higher)
I get no information. So my question is;
Does the DataSet contain the other columns, only not indexed like an array? What I want to do is choose which of the columns to filter out and turn the rest into JSON formatted strings. Any suggestions on how to accomplish that would be greatly appreciated as well
You’re talking about “columns” of data, but your code snippet is dealing with Tables of data (resultsets).
i.e.
if your sproc does something like this:
then you’ll have 1 DataTable in your dataset as 1 resultset is returned:
ds.Tables(0). This will contain 3 columns:ds.Tables(0).Columns(n)where n is 0 to 2.