944,134 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 1565
  • MS SQL RSS
Sep 26th, 2007
0

How to retrieve all data and pass it

Expand Post »
This is code for retrieve data from table Results. The output must display to user via SMS. Now the problem is I cannot call all the data from table RESULTS.

Dim da As New SqlDataAdapter("Select * From Results Where Metric_Number='" & content1 & "'", conn)

Dim dst As New DataTable
Dim rsRow As DataRow
dst.Clear()
da.Fill(dst)

'Dim MessageType As Long
Dim datax As String
Dim data1 As String
Dim data2 As String
Dim data3 As String
Dim data4 As String

If dst.Rows.Count <> 0 Then

Dim daa As New SqlDataAdapter("Select Sub_Code FROM Results Where Metric_Number='" & content1 & "'", conn)

Dim dsts As New DataTable
dsts.Clear()
daa.Fill(dsts)
Dim rsws As DataRow

For Each rsws In dsts.Rows
data1 = (rsws.Item("Sub_Code") & vbCrLf.ToString)
data2 = (rsws.Item("Gred") & vbCrLf)
data3 = (rsws.Item("GPA") & vbCrLf)
data4 = (rsws.Item("CGPA") & vbCrLf)
datax = (data1 & data2 & data3 & data4)
Next

msgNotification(ccrNumber, datax)

RESULT NOW: It only displaying one row of the data(1-4)
How to select all data and then pass it to msgnotification
Urgent help need!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jayz_raul is offline Offline
14 posts
since Aug 2007
Oct 1st, 2007
0

Re: How to retrieve all data and pass it

if you are using VB go to VB forum and ask them you may find a lot of help
http://www.daniweb.com/forums/forum58.html
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: For_xml_null_treatment
Next Thread in MS SQL Forum Timeline: Create table using recordset





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC