hi hope all is well..hope someone can help me. i am using asp.net.
i have a literal control which is as given below
the ReportHeader() is a function which is below
my question is that it is not allowing me to assign my STRSQL, sql statement to my datareader so that i will add it in the literal control..hope i explained me problem ok so that someone will help me out..
thanks in advance... sonia...
i have a literal control which is as given below
Visual Basic:
Dim ltcReportHeader As LiteralControl = New LiteralControl(ReportHeader())
report.Controls.Add(ltcReportHeader)
the ReportHeader() is a function which is below
Visual Basic:
Function ReportHeader() As String
Dim strHTML As String
Dim connCAN_Msg As SqlClient.SqlConnection
connCAN_Msg = conDB.Connect
connCAN_Msg.Open()
dim strSQL as string
strSQL = _
" SELECT Mobile.Label + ' ( ' + Mobile.Registration + ' / ' + CAST(CAN_Message.Locator_ID AS varchar(5)) + ' )' AS Vehicle
" FROM CAN_Message INNER JOIN " & _
" Mobile ON CAN_Message.Locator_ID = Mobile.Mobile_ID " & _
" WHERE CAN_Message.Locator_Id IN (" & strMobileList & ") " &
Dim dr As SqlClient.SqlDataReader
Dim cmd As New SqlCommand(strSQL, connCAN_Msg)
dr = cmd.ExecuteReader()
If dr.Read() Then
strMobile_Mobile = dr.strSQL
End If
strHTML += "<td class=""reportHeaderValue"">" & strMobile_Mobile & "</td>" & vbCrLf
strHTML += "</table><br><br>" & vbCrLf
Return (strHTML)
End Function
my question is that it is not allowing me to assign my STRSQL, sql statement to my datareader so that i will add it in the literal control..hope i explained me problem ok so that someone will help me out..
thanks in advance... sonia...