Hi All - I have been working with this error message all day and I cannot figure out the problem. Can someone please help???? The code is as follows:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
strDonationID = Request("cid")
If Not Me.Page.IsPostBack Then
Call LoadSelectedDonation()
End If
End Sub
Private Sub LoadSelectedDonation()
Dim rdr As SqlDataReader
Dim inParams As New UWSqlParameters
Try
inParams.CreateStringParameter("Switch", "@Switch", ParameterDirection.Input, 30)
inParams.SetString("Switch", "LoadSelectDon")
inParams.CreateStringParameter("strSearch", "@strSearch", ParameterDirection.Input, 1000)
inParams.SetString("strSearch", " AND DonDetailID = " & strDonationID)
rdr = Top.SPDatabase.ExecuteReader("uwc_DonationManagement_LoadDonSearch", inParams.AsCollection())
Do While rdr.Read
Me.txtDonDetailID.Text = rdr("DonDetailID")
Me.txtfldCount.Text = rdr("fldCount")
Me.txtSubtype.Text = rdr("SubType")
Me.txtPackaging.Text = rdr("Packaging")
Me.txtDonationDate.Text = rdr("DonationDate")
Me.txtDonor.Text = rdr("Name")
Me.txtDayPhone.Text = rdr("DayPhone")
Me.txtEvePhone.Text = rdr("EvePhone")
Me.txtCellPhone.Text = rdr("CellPhone")
Me.txtFaxPhone.Text = rdr("FaxPhone")
Me.txtNotes.Text = rdr("B.Notes")
Loop
Catch ex As System.Exception
UWFormUtilities.ErrorViewer = ex.ToString
Response.Redirect("frmErrorViewer.aspx")
Response.Write("Failed")
Response.Write(ex.ToString())
Finally
rdr.Close()
End Try
End Sub
My stored procedure is as follows:
Else if @Switch='LoadSelectDon'
Begin
SET @StrExec = ('SELECT DonDetailID,fldCount,SubType,Packaging,DonationDate,
[Organization]+''-'' + [FirstName] + '' ''+ [LastName] as Name, DayPhone, EvePhone, CellPhone, FaxPhone, B.Notes
FROM dbo.tbldonationsdetail as A, dbo.tbldonations as B,dbo.tblDonors as C
WHERE A.DonationID= B.DonationID
AND B.DonorID=C.DonorID
' + @strSearch)
EXEC(@strExec)
End
- Maria
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
strDonationID = Request("cid")
If Not Me.Page.IsPostBack Then
Call LoadSelectedDonation()
End If
End Sub
Private Sub LoadSelectedDonation()
Dim rdr As SqlDataReader
Dim inParams As New UWSqlParameters
Try
inParams.CreateStringParameter("Switch", "@Switch", ParameterDirection.Input, 30)
inParams.SetString("Switch", "LoadSelectDon")
inParams.CreateStringParameter("strSearch", "@strSearch", ParameterDirection.Input, 1000)
inParams.SetString("strSearch", " AND DonDetailID = " & strDonationID)
rdr = Top.SPDatabase.ExecuteReader("uwc_DonationManagement_LoadDonSearch", inParams.AsCollection())
Do While rdr.Read
Me.txtDonDetailID.Text = rdr("DonDetailID")
Me.txtfldCount.Text = rdr("fldCount")
Me.txtSubtype.Text = rdr("SubType")
Me.txtPackaging.Text = rdr("Packaging")
Me.txtDonationDate.Text = rdr("DonationDate")
Me.txtDonor.Text = rdr("Name")
Me.txtDayPhone.Text = rdr("DayPhone")
Me.txtEvePhone.Text = rdr("EvePhone")
Me.txtCellPhone.Text = rdr("CellPhone")
Me.txtFaxPhone.Text = rdr("FaxPhone")
Me.txtNotes.Text = rdr("B.Notes")
Loop
Catch ex As System.Exception
UWFormUtilities.ErrorViewer = ex.ToString
Response.Redirect("frmErrorViewer.aspx")
Response.Write("Failed")
Response.Write(ex.ToString())
Finally
rdr.Close()
End Try
End Sub
My stored procedure is as follows:
Else if @Switch='LoadSelectDon'
Begin
SET @StrExec = ('SELECT DonDetailID,fldCount,SubType,Packaging,DonationDate,
[Organization]+''-'' + [FirstName] + '' ''+ [LastName] as Name, DayPhone, EvePhone, CellPhone, FaxPhone, B.Notes
FROM dbo.tbldonationsdetail as A, dbo.tbldonations as B,dbo.tblDonors as C
WHERE A.DonationID= B.DonationID
AND B.DonorID=C.DonorID
' + @strSearch)
EXEC(@strExec)
End
- Maria