Tag: ado.net

How to set XACT_ABORT within ADO.NET

How can I set XACT_ABORT to ON (or OFF) from within ADO.NET ?

How to resolve SqlConnection error “Keyword not supported: 'decr pool size'.”

I am creating Windows Application and using System.Data.SqlClient.SqlConnection object SqlConnection targetDatabaseConnection = new SqlConnection(ConnectionString); Following is the connection string Data Source=.;Initial Catalog=TestBCP_12;User ID=sa;Password=sa;Min Pool Size=100; Max Pool Size=100; Decr Pool Size=100; Incr Pool Size=100; Getting error with the following two settings Decr Pool Size=100; Incr Pool Size=100; I know all the sizes are 100 , […]

Sql Connection Error 40 Under Load

My database connections from my web servers work fine normally, but when a write heavy windows service I have triggers, I will randomly get “A network-related or instance-specific error occurred while establishing a connection to SQL Server. Error 40.” from my webservers. I have tried turning connection pooling off for my web servers since they […]

Query times out when run from ADO.NET but runs fine in Query Analyer

On local development machine my query times out indefinitely when run via website (ASP.NET – ADO.NET) Same query was running just yesterday fine. It runs fine when I execute it from local machine. I even resorted to rebooting machine. What can it be? Explanations per requests: Query times out after default 30 seconds (in ADO.NET). […]

Why change in CommandTimeout not working

I have MVC2 application using Entity Framework and ADO.net. In ADO.net SqlCommand connection, it get, Server Error in ‘/’ Application. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The code is, using (SqlCommand command = conn.CreateCommand()) { var commandText = “exec ‘stored producedure name'”; command.CommandTimeout […]

Copy records from one database to another (Teradata to SQL Server)

I have a project where I need to query a Teradata database and then copy the records returned to a SQL Server database. I can hit the Teradata db no problem and I can get the results into a DataTable. The SQL server db is already setup and has the same columns as the Teradata […]

Should snapshot transaction isolation be avoided in client ADO.NET applications? then, what was its main purpose?

Having read in [1]: “The persistent database connection requirement limits SNAPSHOT isolation scalability so it shouldn’t be used as a general means of implementing optimistic concurrency” I’d like to understand: What is persistent connection in ADO.NET? I simply do not remember that, while programming .NET apps, I configured any persistence of SQL Server connections. Where […]

dynamic sql generation is not supported against multiple base tables

I tried to add a new row to a Table in an SQL DB, but I had a problem : dynamic sql generation is not supported against multiple base tables this is the code I tried : private MyClass myClass = new MyClass(); private SqlDataAdapter adapter; private SqlDataAdapter adapter2; private void GestionCollections_Load(object sender, EventArgs e) […]

Get columns size along with column name and datatype

I am trying to fetch columns, datatypes and size of columns of selected table and database from sql server database. So far I am successfull in fetching column names and datatypes but I want to fetch size also. Example: Consider I have 2 columns in sql server database tables like below: 1) Name nvarchar(30) 3) […]

How to achieve functionlity i.e. controlling “Incr Pool Size” or “Decr Pool Size” while establishing connection to SQL? similar to ORACLE

I have asked a question about “Incr Pool Size” or “Decr Pool Size” How to resolve SqlConnection error "Keyword not supported: 'decr pool size'." This is another but different question related to that , in brief ORACLE connection string provides these two option to increase/decrease connection objects when connection pool is empty or full respectively. […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.