Showing posts with label applications. Show all posts
Showing posts with label applications. Show all posts

Monday, March 12, 2012

Help with 1205 Not raised

Hi,
I have an application that causes a dead lock at random. The issue I am
having is, when the deadlock occurs, my applications is not recieving
any errors from the DB. ie, during the deadlock SQLServer is returning
an empty recordset and user is seeing a blank screen. The app logic
does not go into the Try Catch statment in the C# code. I can't
understand why my app is not receiveing 1205 error from SQL server when
dead lock occurs.
Any ides why this is happening?

Thanks
_GJKRead the following article by Erland Sommarskog, SQL Server MVP:
http://www.sommarskog.se/error-handling-I.html#ADO.Net
especially this part: "If you use ExecuteReader, there are a few extra
precautions. If the stored procedure first produces a result set, and
then a message, you must first call .NextResult before you get an
exception, or, for an informational message, any InfoMessage event
handler is invoked."

Razvan|||In my case I am using SQLDataReader and sp being killed in the deadlock
is a simple select statement containing single resultset.
_GJK

Razvan Socol wrote:
> Read the following article by Erland Sommarskog, SQL Server MVP:
> http://www.sommarskog.se/error-handling-I.html#ADO.Net
> especially this part: "If you use ExecuteReader, there are a few
extra
> precautions. If the stored procedure first produces a result set, and
> then a message, you must first call .NextResult before you get an
> exception, or, for an informational message, any InfoMessage event
> handler is invoked."
> Razvan|||In my case I am using SQLDataReader and sp being killed in the deadlock
is a simple select statement containing single resultset.
_GJK

Razvan Socol wrote:
> Read the following article by Erland Sommarskog, SQL Server MVP:
> http://www.sommarskog.se/error-handling-I.html#ADO.Net
> especially this part: "If you use ExecuteReader, there are a few
extra
> precautions. If the stored procedure first produces a result set, and
> then a message, you must first call .NextResult before you get an
> exception, or, for an informational message, any InfoMessage event
> handler is invoked."
> Razvan

Friday, March 9, 2012

Help w/ SqlClientPermission

Hello!

I'm currently working on a project consisting in rewriting VB 6.0 applications into VS 2005 applications. I already have the form designed in VS '05 w/ the controls, and I'm connected to a SQL server 2000 database. I've also created the different data adapters and datasets, which in VS 2005, have also created BindingSources and BindingNavigators. But, when I run the project, I am getting the following error, and the form doesn't appear:

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I have been trying to find ways to get around it, but I'm not that successful. I have gone online on the Microsoft website and found a host of comments from other people, but I can't relate theirs to my problem. I understand that my program needs to be granted this permission for it to run, but I can't seem to know what and where to begin resolving it. Here's also what I've found online about how to resolve it:

To grant the required permissions to a custom assembly, follow these steps:

1. Assert permissions in your custom assembly.

2. Make the custom assembly available to your project.

3. Reference the custom assembly in your project.

4. Modify the code access security (CAS) settings for your custom assembly.

Can anyone who has encountered this kind of error tell me if these are the steps I need to take to solve it?

Also, is teh custom assembly the AssemblyInfo.vb file or is it obtained by right-clicking the project in the Solution Explorer and pointing at the properties?

Thanks very much for any help I can help.

Have a wonderful day.

This is a CAS policy which could be set at domain level and enherited by your computer. The SQLClient assembly is not rated as trusted in the domain/Area you want to run the application (either locally or over the network which is in common not allowed / trusted). YOu can see the configured permissions using the .Net Framework configuration tool.

Jens K. Suessmeyer

http://www.sqlserver2005.de