Link to home
Start Free TrialLog in
Avatar of PeteEngineer
PeteEngineerFlag for India

asked on

Break point not hitting on Response.Redirect

I am getting an error on following line which is forwarded to some other page ...

  Response.Redirect(strReportServer & "/TPFolderRedirect.aspx?DXID=" & DataXmlId.ToString & "&SDID=" & _StyleDevelopmentId & "&SID=" & StyleId & _
                              "&RTPID=" & ReportTPFolderId & "&SV=" & Request.QueryString("SV") & "&SSID=" & Me._StyleSourcingID & _
                              "&TID=" & Me.UserProperties.TeamID & "&SYID=" & Me._SeasonYearID & "&SN=" & Me._StyleSet)
                              

Open in new window



But when i put a break point on the page load event of the page TPFolderRedirect.aspx... its not hitting.

I tried putting false as a parmeter at the end of the function.
Attach to process and attched the process ..then i dont know how to see the break point which is hit

Help me!
Avatar of ingriT
ingriT
Flag of Netherlands image

Have you tried just using the line;

Response.Redirect(strReportServer & "/TPFolderRedirect.aspx")

Open in new window


to see if the line in the redirect has a syntax error?
Avatar of PeteEngineer

ASKER

errror :


The parameterized query '(@StyleID varchar(40))SELECT Variation FROM pStyleDevelopmentIte' expects the parameter '@StyleID', which was not supplied.
This is an error you get from the TPFFolderRedirect.aspx page?

That means, that now you do get to that page. Is the breakpoint in your Page_Load hitting this time?
No that error is different :

Shown below :

Error:Column 'OwnerGroup' does not belong to table Table.

Page:/almReport/TPFolderRedirect.aspx?
DXID=1a79a78b-30bc-4b35-a7b9-85381fe0988e&SDID=6dac0929-4e19-4ef1-acfc-3a367ce89eb0
&SID=dab0f156-06a8-450a-8df8-1285ab8fafee&RTPID=f1000000-0000-0000-0000-000000000010&SV=2
&SSID=3f47ed6f-584b-4cae-9ec6-6462f19d80d2
&TID=203517c2-2bd4-4ed3-9ef7-ac37de447321
&SYID=60f5b984-9def-4cb4-af17-387e2719f28b&SN=1
Exeption:System.ArgumentException

System.Data
Trace: at System.Data.DataRow.GetDataColumn(String columnName) at System.Data.DataRow.get_Item(String columnName) 
at almCore.FormHandler.GetReportSqlControls() 
at alm2Report.TPFolderRedirect.LoadXMLFile(Object XmlId) 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 339 
at alm2Report.TPFolderRedirect.GetSqlReport() 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 658 
at alm2Report.TPFolderRedirect.Page_Load(Object sender, EventArgs e) 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 155 
at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, 
Boolean includeStagesAfterAsyncPoint)

Open in new window

s the breakpoint in your Page_Load hitting this time?

No still not
I think the error says it all;

'OwnerGroup' column does not exist in the query you are doing on the TPFolderRedirect page.
There is no column names in any of my database table named ownergroup

i think its from dataset...how to solve it either ..without even seeing a break point?
Have you tried this?
http://www.sidesofmarch.com/index.php/archive/2007/03/19/debugging-visual-studio-2005-web-applications-with-firefox/

And I think you are trying to do a query on a column named OwnerGroup or you are getting a column named OwnerGroup from your recordset. Do you have some code to post?
I am getting a column named OwnerGroup from your recordset

Why u posted that link,its all about making a defualt browser in Visual Studio

Yes i have code to post
I found page load call getsqlreport and this calls loadxml

and there is a line may cousing the issue shown below :

        ReportTableInsert(conConnection, XmlId, objXmlHandler.DataColumnNumber, objXmlHandler.DataColumn, objXmlHandler.DataHeader, objXmlHandler.DataValue, i)
That column 'ownergroup' does not exist in your recordset according to the error you're getting. Test your query in the sql server management studio and see the results there first.

And by setting a different default browser, your breakpoint might be hit. Where did you put the breakpoint anyway? It's hard to be of help without any information.
From the profiler i found something like below:

exec spx_ReportTable_INSERT @DataXmlID='4c9e7128-2d75-42cf-a21a-e7840f1180a9',@DataColumnNumber=1,@DataColumnName=N'StyleType',@DataHeader=N'Style Type',@DataValue=N'Apparel',@DataSort='1'
Not the profiler, just run the query that you execute on your page and see the results.
i am ready to give any information you what?

How to  Test your query in the sql server management studio ?

I dont know where is the query calling and what is the query...how to which line is this query?
I think the one i posted above is the query :

ReportTableInsert(conConnection, XmlId, objXmlHandler.DataColumnNumber, objXmlHandler.DataColumn, objXmlHandler.DataHeader, objXmlHandler.DataValue, i)

exec spx_ReportTable_INSERT @DataXmlID='4c9e7128-2d75-42cf-a21a-e7840f1180a9',@DataColumnNumber=1,@DataColumnName=N'StyleType',@DataHeader=N'Style Type',@DataValue=N'Apparel',@DataSort='1


but in the above query there is no column name called "OwnerGroup"

Will be there any other queries causing the issue ?
How did you get to this code that gives the error?

Just post the code for the .aspx and the .aspx.vb files of the page that produces the error. And on which line you put the breakpoint that it's not hitting.

You can run the query in the sql server management studio, with the button "new query".
You want the code for the redirected page ..in the page load?

I have posted the code already there is a problem

I guess the query string is wrong may be ..in that case it wont redirect and hit the break point in the redirected page ... what you say?
I don't know what you need. Just post the complete page where you get the error. A few lines in different posts don't mean anything, I need to see the complete file to see where there could be an error.
Please see the attached funtion as per the flow :
Pageload
GetSQLReport
LoadXML
The above files are from the page which is redirected

and button click event of the page has the redirect code which i pasted above.
Can't you just paste the complete pages? For the page you come from (with the button) and the page that is redirected to (TPFolderRedirect.aspx)?
Please provide your email
No. If you can't post the code, I can't help you.
OK please find attached
ClickingPage
RedirectedPage
Oké, have you tried putting a breakpoint on this line ;     strTeamId = Request.QueryString("TID") in the RedirectedPage?
Yes ..it is not hitting ...
Oké, if you put a breakpoint on this line 'InitControlLibrary(Request.Cookies("User"))' in the ClickingPage, and then reloading the page, is this breaking?

If not, some configuration in your visual studio is messed up.
Yes its hitting ..no issue in settings


I put in the following function also where my report being called:


 Private Sub btnSaveNew_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSaveNew.Click

there it is hitting ..

and

response.redirect inside this function is been traversed ..then it bypasses to the end of this function ..no breakpoint in the redirected page is getting called
Oke, so we have this function:

Private Sub btnSaveNew_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSaveNew.Click

        ' Save button from the Tech Pack tab.
        Dim strReportServer As String = plmOnCore.ConfigHandler.GetAppSettings(plmOnCore.ConfigHandler.AppSettings("SERVER"))("SQLServerReport")
        Dim ReportTechPackFolderId As String = Me.rbTechPack.SelectedValue.ToString
        Dim strSystemCultureId As String = Me.ddlLanguage1.SelectedValue

        Dim StyleId As String = Me.rbSizeClass.SelectedValue.ToString
        If StyleId = "Multi-Size" Then
            StyleId = "00000000-0000-0000-0000-000000000000"
        End If

        If ReportTechPackFolderId = String.Empty Or StyleId = String.Empty Then

        Else

            Dim strStyleColorwaySeasonYearID As String = ""
            'If strAllowSeasonality = "TRUE" Then
            '    strStyleColorwaySeasonYearID = Request("rbSelectColor")
            '    If strStyleColorwaySeasonYearID = String.Empty Then
            '        Dim strMsg As String = "<SCRIPT language='javascript' >alert('Select a " & strColorway & "');</SCRIPT>'"
            '        ClientScript.RegisterStartupScript(Me.GetType(), "ALERT", strMsg)
            '        Exit Sub
            '    End If
            'End If


            Dim DataXmlId As Guid = Guid.NewGuid
            TechPackStyleDevelopmentInsert(DataXmlId.ToString, StyleId, strStyleColorwaySeasonYearID, strSystemCultureId)
            Response.Redirect(strReportServer & "/TechPackFolderRedirect.aspx?DXID=" & DataXmlId.ToString & "&SDID=" & _StyleDevelopmentId & "&SID=" & StyleId & _
                              "&RTPID=" & ReportTechPackFolderId & "&SV=" & Request.QueryString("SV") & "&SSID=" & Me._StyleSourcingID & _
                              "&TID=" & Me.UserProperties.TeamID & "&SYID=" & Me._SeasonYearID & "&SN=" & Me._StyleSet)

         

        End If

    End Sub

Open in new window


And it seems like the Response.Redirect is not called, because the breakpoint in the next page is not being hit, right?

What is in this strReportServer parameter? Does it redirect you from your debugging version of the code to the actual production/test server url? Or do you have your exact debugging location (something like localhost:54645 in this url in the configuration?)
strReportServer  seems like my project name in visual studio where the reports are there ,, all reports are there inside that project...

I cannot check like reportproject/TechPackFolderRedirect.aspx because the page must passed with parameters ...

when i not passed parmeters i got the error like below as i said in the first post :


The parameterized query '(@StyleID varchar(40))SELECT Variation FROM pStyleDevelopmentIte' expects the parameter '@StyleID', which was not supplied.
I know, you should pass the parameters, but when you redirect, the redirect goes to this url:
strReportServer & "/TechPackFolderRedirect.aspx?DXID=" & DataXmlId.ToString & "&SDID=" & _StyleDevelopmentId & "&SID=" & StyleId & _
                              "&RTPID=" & ReportTechPackFolderId & "&SV=" & Request.QueryString("SV") & "&SSID=" & Me._StyleSourcingID & _
                              "&TID=" & Me.UserProperties.TeamID & "&SYID=" & Me._SeasonYearID & "&SN=" & Me._StyleSet
         

Open in new window


This URL starts with the strReportServer variable, that is set from your config in the first line of your method:

Dim strReportServer As String = plmOnCore.ConfigHandler.GetAppSettings(plmOnCore.ConfigHandler.AppSettings("SERVER"))("SQLServerReport")

Open in new window


If this string in your configuration setting (in the web.config, or an app.config or something) does not have the same value as the website you are debugging in (see you address bar for something like localhost:23232) then your breakpoint in the other page will never hit, because you are going to another url.
Hope u understood

there is a project where current files posted exists ..

but the page which is redirecting is in another project
u can see from the error the exact url



Error:Column 'OwnerGroup' does not belong to table Table.

Page:/almReport/TPFolderRedirect.aspx?
DXID=1a79a78b-30bc-4b35-a7b9-85381fe0988e&SDID=6dac0929-4e19-4ef1-acfc-3a367ce89eb0
&SID=dab0f156-06a8-450a-8df8-1285ab8fafee&RTPID=f1000000-0000-0000-0000-000000000010&SV=2
&SSID=3f47ed6f-584b-4cae-9ec6-6462f19d80d2
&TID=203517c2-2bd4-4ed3-9ef7-ac37de447321
&SYID=60f5b984-9def-4cb4-af17-387e2719f28b&SN=1
Exeption:System.ArgumentException

System.Data
Trace: at System.Data.DataRow.GetDataColumn(String columnName) at System.Data.DataRow.get_Item(String columnName) 
at almCore.FormHandler.GetReportSqlControls() 
at alm2Report.TPFolderRedirect.LoadXMLFile(Object XmlId) 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 339 
at alm2Report.TPFolderRedirect.GetSqlReport() 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 658 
at alm2Report.TPFolderRedirect.Page_Load(Object sender, EventArgs e) 
in D:\Jais\JaisPLM\Trunk\Software\padawan\Application\alm2Report\TPFolderRedirect.aspx.vb:line 155 
at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, 
Boolean includeStagesAfterAsyncPoint)

Open in new window

If it is another project, is it running then for debug as well at the same time?
and TPFolderRedirect and TechPackFolderRedirect

are same ..i just changed the page names ...
is it running then for debug as well at the same time?

means? Actually i cannot run this induvitualy as it will asks parameters from another project..that what you trying to ask?
If the page you have a breakpoint in is not running (on the url you are requesting it on) then it won't hit. Right?
yes chances are there but how to check?

and if the project redirected will be from another project will it hit?

Check this :

http://stackoverflow.com/questions/8749861/response-redirect-from-one-asp-net-web-app-to-another
No, you should check that. And try running both projects at the same time.
Yes it hit now in the redirected page
:-) ..now what to do where to check the value :-)
I'm glad!
Step trough the debugging and see on which line the error occurs.
ok..problem is from this line :


        ReportTableInsert(conConnection, XmlId, objXmlHandler.DataColumnNumber, objXmlHandler.DataColumn, objXmlHandler.DataHeader, objXmlHandler.DataValue, i)
Step into that function (with F11, not F10 when the line is hit) and see on which line in that method it breaks.
Cannot insert the value NULL into column 'StyleID', table 'almOn4.2.x.dbo.rReportTable'; column does not allow nulls. INSERT fails. The statement has been terminated.

this is the actual error
Is that the error for this redirect?
Response.Redirect(strReportServer & "/TPFolderRedirect.aspx")

Open in new window


Put back your original one.

And go debug your query.
But there is not styleid coumn in  rReportTable  :-(
Is that the error for this redirect?

Nooo ...this error is for original one only
There is according to the query you are running. Go find the query or stored procedure.

Or find a colleague who does know what the code does.
yes i found


INSERT INTO rRptTable (DataXmlId, DataColumnNumber, DataColumnName, DataHeader, DataValue, DataSort)
            VALUES
            (@DataXmlId, @DataColumnNumber, @DataColumnName, @DataHeader, @DataValue, @DataSort)

This is what its doing ..there is no styleid here inserting as NULL

then where the error here?
ASKER CERTIFIED SOLUTION
Avatar of ingriT
ingriT
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Your table rReportTable DOES have a column StyleID

No i checked all columns and no    StyleID :-(


    colFields.Add(String.Format("pkiStyleID|{0}", strStyleId))  

anywhere above line causing error?
I don't know, really. I think I've been of enough help. Maybe you should hire someone with enough knowledge to help you solve this.
Owkay ..i found out

there is a same tablename in another database which have a styleid

this is causing error ...
so either i need to drop this table or pass style id in the SQL ...


Yipeeeeeeeeeeeeeeeeeeeeeeeeeee!
Thanks for the help ..i will give the entire 500 point ..i might have given u 5000 but no way its max 500 :-D
Happy programming ;)
thanks a ton!