• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

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!
0
PeteEngineer
Asked:
PeteEngineer
  • 34
  • 25
1 Solution
 
ingriTCommented:
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?
0
 
PeteEngineerAuthor Commented:
errror :


The parameterized query '(@StyleID varchar(40))SELECT Variation FROM pStyleDevelopmentIte' expects the parameter '@StyleID', which was not supplied.
0
 
ingriTCommented:
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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PeteEngineerAuthor Commented:
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

0
 
PeteEngineerAuthor Commented:
s the breakpoint in your Page_Load hitting this time?

No still not
0
 
ingriTCommented:
I think the error says it all;

'OwnerGroup' column does not exist in the query you are doing on the TPFolderRedirect page.
0
 
PeteEngineerAuthor Commented:
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?
0
 
ingriTCommented:
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?
0
 
PeteEngineerAuthor Commented:
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
0
 
PeteEngineerAuthor Commented:
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)
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
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'
0
 
ingriTCommented:
Not the profiler, just run the query that you execute on your page and see the results.
0
 
PeteEngineerAuthor Commented:
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?
0
 
PeteEngineerAuthor Commented:
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 ?
0
 
ingriTCommented:
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".
0
 
PeteEngineerAuthor Commented:
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?
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
Please see the attached funtion as per the flow :
Pageload
GetSQLReport
LoadXML
0
 
PeteEngineerAuthor Commented:
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.
0
 
ingriTCommented:
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)?
0
 
PeteEngineerAuthor Commented:
Please provide your email
0
 
ingriTCommented:
No. If you can't post the code, I can't help you.
0
 
PeteEngineerAuthor Commented:
OK please find attached
ClickingPage
RedirectedPage
0
 
ingriTCommented:
Oké, have you tried putting a breakpoint on this line ;     strTeamId = Request.QueryString("TID") in the RedirectedPage?
0
 
PeteEngineerAuthor Commented:
Yes ..it is not hitting ...
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
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
0
 
ingriTCommented:
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?)
0
 
PeteEngineerAuthor Commented:
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.
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
Hope u understood

there is a project where current files posted exists ..

but the page which is redirecting is in another project
0
 
PeteEngineerAuthor Commented:
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

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

are same ..i just changed the page names ...
0
 
PeteEngineerAuthor Commented:
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?
0
 
ingriTCommented:
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?
0
 
PeteEngineerAuthor Commented:
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
0
 
ingriTCommented:
No, you should check that. And try running both projects at the same time.
0
 
PeteEngineerAuthor Commented:
Yes it hit now in the redirected page
0
 
PeteEngineerAuthor Commented:
:-) ..now what to do where to check the value :-)
0
 
ingriTCommented:
I'm glad!
0
 
ingriTCommented:
Step trough the debugging and see on which line the error occurs.
0
 
PeteEngineerAuthor Commented:
ok..problem is from this line :


        ReportTableInsert(conConnection, XmlId, objXmlHandler.DataColumnNumber, objXmlHandler.DataColumn, objXmlHandler.DataHeader, objXmlHandler.DataValue, i)
0
 
ingriTCommented:
Step into that function (with F11, not F10 when the line is hit) and see on which line in that method it breaks.
0
 
PeteEngineerAuthor Commented:
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
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
But there is not styleid coumn in  rReportTable  :-(
0
 
PeteEngineerAuthor Commented:
Is that the error for this redirect?

Nooo ...this error is for original one only
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
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?
0
 
ingriTCommented:
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.

Your table rReportTable DOES have a column StyleID and there is a constraint that will not allow a NULL value, so you can only insert a record if you do specify this column.

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

Open in new window


will probably work. But you should get the appropriate value for StyleId
0
 
PeteEngineerAuthor Commented:
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?
0
 
ingriTCommented:
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.
0
 
PeteEngineerAuthor Commented:
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!
0
 
PeteEngineerAuthor Commented:
Thanks for the help ..i will give the entire 500 point ..i might have given u 5000 but no way its max 500 :-D
0
 
ingriTCommented:
Happy programming ;)
0
 
PeteEngineerAuthor Commented:
thanks a ton!
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 34
  • 25
Tackle projects and never again get stuck behind a technical roadblock.
Join Now