All Forums Connectivity
jobbazar 39 posts Joined 12/09
08 Sep 2015
Result sets question on Dot Net provider

I am getting a around 200/500 lines of query results that is DDLs etc returned from my dot net query.  It works on SQL assistant okay. When I send it using the below query I only get the first DDL and not other DDLs.
Any idea, if this is a limitation or any setting that I need to take a look?
Here is my code:

 Dim pf As DbProviderFactory = DbProviderFactories.GetFactory(" Teradata.Client.Provider")

                Dim con As DbConnection = pf.CreateConnection()

                Dim sConnection As [String] = "Data Source=" + Constants.sDataSource + ";User ID=" + Constants.sUser + ";Password=" + Constants.sPassword

                con.ConnectionString = sConnection

                '                MsgBox(con.ConnectionString)



                    Dim cmd As DbCommand = pf.CreateCommand()

                    Dim ds As New DataSet()


Here is how I am handling:


                            Dim rowCount As Integer = 0

                            Dim charData As String

                            If reader.HasRows Then

                                While reader.Read()

                                    rowCount += 1

                                    charData = reader.GetString(0)

                                    Dim DatabaseName As String = charData

                                    dbMessage.Text = charData.Trim

                                End While

                            End If


MikeDempsey 94 posts Joined 10/06
08 Sep 2015

The results are probably returned as separate result sets so you will need to call NextResult() and loop through all future result sets as well as the first one.
(apparently some code is omitted/extra here as you appear to be referencing both a DataSet AND a DataReader ... which are alternatives.)

jobbazar 39 posts Joined 12/09
09 Sep 2015

Mike, Many thanks!
That worked lke a charm....!!!!
I had to use the nextResult within my loop and concatinate it with vbCrLf something like this:

  'Add to my Rich Textbox now

                                        dbMessage.Text = dbMessage.Text & vbCrLf & charData.Trim & vbCrLf

                                    End While



I am able to get what I wanted, at the end.  


You must sign in to leave a comment.