How to retrieve all data and pass it

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 14
Reputation: jayz_raul is an unknown quantity at this point 
Solved Threads: 0
jayz_raul's Avatar
jayz_raul jayz_raul is offline Offline
Newbie Poster

How to retrieve all data and pass it

 
0
  #1
Sep 26th, 2007
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!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: How to retrieve all data and pass it

 
0
  #2
Oct 1st, 2007
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
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for MS SQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC