Browse by Tags
All Tags »
"Programming Microsoft ADO.NET 2.0 applications Advanced topics" book (
RSS)
What is a transaction , in one word? ACID . A tomicity: One block that can't be broken into smaller parts. C onsistency: Works on consistent view and leaves the DB in a constituently state. I solation: Effects only the transaction. D urability: Writes the committed transactions to the database. Single transaction vs. Distributed transactions: Single transaction – a transaction that works on only one durable resource and on a single open connection (also called local lightweight transaction).These...
In SQL server 2005 you can run .Net code within the DB-Server process (code name SQLCLR or integrated CLR). The SQLCLR family include stored procedure, user defined function, aggregates, triggers and user-define types. For example, you can create a user define aggregate which execute an operation on each row in the query result (this is a function like others system function: sum, average, count, min and max). In my next post I'll show you an example to implement on of these functions.
In our project we had a dilemma if we should store image files in database or in file system directory. There are some pros' and cons' for each option, but the most important issue that influenced our decision was that we work with ESRI tools. If the image is small it's better to store it in the file system and not in the database. If we store the image in database (using SDE ), it will takes some time and this operation couldn't be in real-time reaction (because the SDE will create a pyramids and...
There are three approaches to implement a primary key: Natural key: 1. A column or collection of columns that define the table uniqueness (existing column\columns from data table). Surrogate primary key: an auto-generated keys without any business relationship: 2. Auto-increment column (Aka sequence) that store in an ID column. 3. Auto-generated key using the Global Unique Identifier(GUID). No. Subject Natural primary key Sequence key GUID key 1 Extra data size(tables and indexes) Big index data...
When commands are executed synchronously, the thread is waiting for a response from the database server and it is getting into a blocking state (until the command is finishing to be executed). protected void ExecuteCommandInSynchronousAccess() { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); using (SqlCommand command = connection.CreateCommand()) { command.CommandText( "UPDATE CUSTOMERS SET NAME='Yuval'" ); // Processing the command on the SQL server....
Creating and opening a connection to a database is very expensive operation (In time & resource). To handle that problem we should use connection pooling that holds a number of existing connections. Each connection pooling has a minimum pool size and maximum pool size. The minimum pool size is use to determine the minimum number of connection that the pool must hold, and the maximum pool size define the maximum connection that the pool can hold at the same time. If the pool reaches to maximum...
I started to read the book "Programming Microsoft ADO.NET 2.0 applications Advanced topics", and I want to share you with a short summary that I wrote. DataSet: Memory based relational representation of data (or cache data) without any transaction properties. Typed DataSet comes to improve the regular DataSet to a stronger type (it gets the errors in a compile time, the VS IntelliSense helps to reduce incorrect spelling). The creation is manually or by XSD (XML schema definition) file. Serialization...