Posts filed under ‘ADO.Net’

Read RowStamp column value from the SQL Database

Hey! have you ever face the problem to read the Value of“RowStamp” data type column.

When you read value through the datareader you will have that value in the data reader but in the .net Row stamp is treated as thearray of Byte types

so you need to read the value of reader by
GetSqlBinary(columnindex) method and also needs to convert to Array of bytes then it will work.
Cheers..

September 28, 2009 at 12:33 pm Leave a comment

Raise DBConcurrency Exception FROM DataAdapter

Hello!

In .Net Ado.net provides many features of database operation and also you can have disconnected architecture so you have good performance.
But for Concurrency you have to take care of one thing.
When you have used stored procedure for command and want to raise DBConcurrency Exception then it will not raise.
For that you have to set
SET NOCOUNT OFF; in stored procedure.
Then when you are going to update dataset with DataAdapter’s update method. It will raise DBConcurrency Error If no row is affected in stored procedure.
Please do this by testing. As just set SET NOCOUNT ON and same code will not generate any Exception.
This little thing will save many time to handle concurrency and also reduce many line of code.

December 17, 2008 at 7:04 am Leave a comment


Archives

Categories

 

May 2012
M T W T F S S
« Feb    
 123456
78910111213
14151617181920
21222324252627
28293031  

Blog Stats

  • 1,999

Follow

Get every new post delivered to your Inbox.