J
Jason
Does anyone know how to do this?
cntHeader is my control.
When I try to set the value of lblDistributor = label1.text, I get the
following error.
Object reference not set to an instance of an object
PLEASE HELP!
Here is my current code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strSQL As String
Dim rs As ADODB.Recordset
Dim rsUser As ADODB.Recordset
Dim cntHeader As headerinfo
strSQL = "EXEC mf_Partners.dbo.spTblDistributors_Select_ByDistributorID " &
Session("DistID") & ""
rs = Global.ReturnRS(strSQL)
strSQL = "EXEC mf_Partners.dbo.spTblDistributorsContacts_Select " &
Session("DistID") & ", '" & Session("UserID") & "'"
rsUser = Global.ReturnRS(strSQL)
If Not rs.EOF Then
HEditProfile.NavigateUrl = "acct_edit.aspx?Email=" & Session("UserID") & ""
HOrderMaterial.NavigateUrl =
"http://www.jacksongroup.com/modernfold/WebLogin.asp?GRP=" & _
Trim$(rs("MaterialCode").Value & "") & "&DST=" & Session("DistID") & _
"&FNAME=" & Trim$(rsUser("UserFName").Value & "") & "&LNAME=" &
Trim$(rsUser("UserLName").Value & "") & _
"&ADDR=" & Trim$(rs("Address1").Value & "") & "&CITY=" &
Trim$(rs("City").Value & "") & _
"&ZIP=" & Trim$(rs("ZipCode").Value & "") & "&PHONE=" &
Trim$(rs("Phone").Value & "") & "&EMAIL=" & _
Session("UserID") & ""
End If
rs.Close()
rs = Nothing
rsUser.Close()
rsUser = Nothing
Label1.Text = cntHeader.lblDistributorName.Text
End Sub
cntHeader is my control.
When I try to set the value of lblDistributor = label1.text, I get the
following error.
Object reference not set to an instance of an object
PLEASE HELP!
Here is my current code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strSQL As String
Dim rs As ADODB.Recordset
Dim rsUser As ADODB.Recordset
Dim cntHeader As headerinfo
strSQL = "EXEC mf_Partners.dbo.spTblDistributors_Select_ByDistributorID " &
Session("DistID") & ""
rs = Global.ReturnRS(strSQL)
strSQL = "EXEC mf_Partners.dbo.spTblDistributorsContacts_Select " &
Session("DistID") & ", '" & Session("UserID") & "'"
rsUser = Global.ReturnRS(strSQL)
If Not rs.EOF Then
HEditProfile.NavigateUrl = "acct_edit.aspx?Email=" & Session("UserID") & ""
HOrderMaterial.NavigateUrl =
"http://www.jacksongroup.com/modernfold/WebLogin.asp?GRP=" & _
Trim$(rs("MaterialCode").Value & "") & "&DST=" & Session("DistID") & _
"&FNAME=" & Trim$(rsUser("UserFName").Value & "") & "&LNAME=" &
Trim$(rsUser("UserLName").Value & "") & _
"&ADDR=" & Trim$(rs("Address1").Value & "") & "&CITY=" &
Trim$(rs("City").Value & "") & _
"&ZIP=" & Trim$(rs("ZipCode").Value & "") & "&PHONE=" &
Trim$(rs("Phone").Value & "") & "&EMAIL=" & _
Session("UserID") & ""
End If
rs.Close()
rs = Nothing
rsUser.Close()
rsUser = Nothing
Label1.Text = cntHeader.lblDistributorName.Text
End Sub