asp.net chrome problem

sindhuxyz
sindhuxyz used Ask the Experts™
on
Hi,

I am facing very strange case. Below code return data in firefox, safari, IE but always return nothing(zero row) to chrome. What can be issue with chrome. It is working and returning data in all other browsers.


Dim sqlconn As New SqlConnection(ConnectionString)
        Using cmd As New SqlCommand("spGetUserStatus", sqlconn)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = email
            
            Try
                sqlconn.Open()
            Catch ex As Exception

            End Try
            Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            Dim dt As New DataTable()
            dt.Load(dr)

        End Using

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
My first thought would be that the email parameter isn't sent correctly by Chrome (event though you haven't given any detail on how and when it's passed).

If you are on a development machine, you'd better debug this code and, maybe, profile your SQL database to see the request that comes through, with the parameter.

If the email parameter, the SQL request and the result in the dt variable are correct (when you debug), you will know it's somewhere downstream, in the way the datatable is returned to the browser.

Author

Commented:
I checked using debug, till line 11th


            Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)

sqlcommand had all parameters correct and values as well. When it executed sqldatareader had "HasRows" as false. I do not know to to track it. Any advise?

Thanks
Commented:
I would recommend you use the SQL Server Profiler to see the request and diagnose the issue. Here is some information on how to use it:

http://msdn.microsoft.com/en-us/library/ms187929.aspx

It is a really useful tool in those kind of situations.

Commented:
What are you using to display your data?

Commented:
If you are using a required field validator check this out

http://dotnetguts.blogspot.com/2009/05/dropdownlist-autopostback-problem-with.html


Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial