Tag: ado.net

Number of total select statement for particular web page?

I was wondering what is the easiest way to see total number of database queries from my ASP.Net (.NET 2.0) application. My application heavily use sql 2005 database because all data are dynamic and everything goes through one connection string in web.config. Connection pooling is enabled there. So, I am wondering how many select statements […]

How do reduce transaction log growth for batched nvarchar(max) updates

Our app needs to add large amounts of text to SQL Server 2005 database (up to 1 GB for a single record). For performance reasons, this is done in chunks, by making a stored procedure call for each chunk (say, usp_AddChunk). usp_AddChunk does not have any explicit transactions. What I’m seeing is that reducing the […]

How do I avoid these deadlocks?

I have a routine which is updating my business entity. The update involves about 6 different tables. All the commands are being executed within a transaction. Recently, I needed to add some code into the routine which accesses a lookup table from the database. The lookup code already existed in another business object so I […]

Getting a new connection from the connection pool times out in ASP.Net application. I need suggestions for mitigation

We are getting the following error on a certain database occasionally under moderate load. “System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.” I have combed through the code and we are […]

trying to add data in SQL Server 2005 database in vb.net

Could someone please help me in here, I’m just a beginner who want to learn on manipulating SQL Server data using vb.net. I have already experienced manipulating data in ms access. So I just recycled the code that I used in here. But unfortunately I got this error: Object reference not set to an instance […]

SQL and ADO.net: Too many arguments specified with output param

ALTER PROCEDURE dbo.uspGetOrderTrackingHeaderInfo @ContractID varchar(9) , @SalesRepID int , @StatusID int , @TypeID int , @StartDate datetime , @EndDate datetime , @Identity int = null output AS INSERT INTO [dbo].[tblOrderTracking] ([ContractID] ,[StatusID] ,[TypeID] ,[SalesRepID] ,[StartDate] ,[EndDate]) VALUES (@ContractID ,@StatusID ,@TypeID ,@SalesRepID ,@StartDate ,@EndDate) SET @Identity = Scope_Identity() Using oConn As New SqlConnection(Me.Master.Master.AdminNetConnString) Try With cmd […]

When I Insert Rows into a SQL Server 2005 Table will the order be preserved?

When I select a series of rows from a sql server 2005 table using an “order by” clause and then insert them into a different (and empty) sql server 2005 table can I count on the rows staying in the same order. The reason I am asking is that I want to manipulate the rows […]

How does ADO.Net know which version of the SQL Native Client to use if you have both SQL 2005 and 2008 in your environment?

How does ADO.Net know which version of the SQL Native Client to use if you have both SQL 2005 and 2008 in your environment?

See updates in a DataReader

Is there a way to see the updates done by other users in a table using a DataReader ? For example : in my DataReader, I am on the 10th row. Another user updates the 11th row. When I do myReader.Read(), I am seeing the old values. Is there a way to see the new […]

Is this UPDATE table statement correct in an msdn topic

I have seen this type of UPDATE statement (just like insert statement) in the following msdn topic: http://msdn.microsoft.com/en-us/library/aa0416cz.aspx#Y2461 UPDATE statement:- adapter.UpdateCommand = New SqlCommand(“UPDATE Customers ” & “(CustomerID, CompanyName) VALUES(@CustomerID, @CompanyName) ” & _ “WHERE CustomerID = @oldCustomerID AND CompanyName = ” & “@oldCompanyName”, connection) Is this statement correct or not? I have tried executing […]

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