sqlexception

SQL exeption was unhandled in c#

When I want to debug this code it gives error on objConnection.Open(): sqlExeption was Unhandled and say(A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is con...

SqlException.Message duplicated when calling sqlserver stored proc

I have a stored procedure that gives a friendly enough error that I want to show to the users but when I call it from .net it comes out twice. When I call the proc from sql server management studio it only comes out once. Here is a cutdown version of the stored proc: ALTER PROC [Production].[spDoSomething] ( @PassedID int) ...

SQLException : Before start of result set

ResultSet rs; rs = this.orderedProduct.select(" sum(unitstoproduce) "," soNo = "+ soNo); int sum = Integer.parseInt(rs.getString(1)); When i try to execute the above query inside the java class i'm getting an exception as below. Here the orderedProduct(orderedZnAlProduct) is the table SELECT sum(unitstoproduce) FROM or...

SQLException - Transaction BEGIN / COMMIT mismatch

Have you encountered this exception for a stored procedure which does indeed have a balanced transaction block? I double-checked the stored procedure and it has exactly one TRANSACTION BEGIN and cooresponding TRANSACTION END Error logged SqlException - Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT ...

list of all kind sql exceptions

How can i gets the name of all SQL exceptions? For handling them in my project? Thanks. ...

How do I handle the SqlException "No Records Found" when using LINQ to SQL?

I'm using LINQ to SQL to call sprocs at my company. Normally it works great but on some queries, if nothing is found it will throw a SqlException "No Records Found". How should I handle this case? Here is an example call I would make: /// <summary> /// Gets the pending messages. /// </summary> /// <par...

Timeout exception when timeout set to infinite time

In my C# .NET 3.5 application I am using CastleProject ActiveRecord over NHibernate. This is desktop application using MS SQL Server 2008. I have set ADO command timeout to 0 to prevent timeout exception during bulk operations: <activerecord> <config> ... <add key="hibernate.command_timeout" value="0" /> </config> ...

Timeout exception when using NHibernate TransactionScope

This is continuation of http://stackoverflow.com/questions/3844327/timeout-exception-when-timeout-set-to-infinite-time (and I also see unanswered http://stackoverflow.com/questions/3752440/sqlconnection-and-transactionscope-timeout question). I am using CastleProject ActiveRecord over NHibernate, C# 3.5. I have multiple subsequent inser...

SQL Server, C#: Timeout exception on Transaction Rollback

Hey guys, I've got a strange problem. I have a .NET program and my process logic needs a long-running transaction (~20min) on a SQL Server 2005 database. That's ok, since nobody accesses the database in parallel. When something goes wrong, the transaction should be rolled back. Infrequently and without any visible pattern the Rollback(...