While playing in data tables in .net, it may require to have some temporary values such as records counts, primary key field name, …etc. In those situations, instead of declaring new variables in the program, it is ideal way to use “ExtendedProperties” option in datatable. The property is holding the collection (hashtable) values. Here is the syntax; DataTable.ExtendedProperties.Add (object key, object value); Examples; DataTable dtObj = new DataTable("employees"); dtObj.ExtendedProperties.Add("totalCount", 500); dtObj.ExtendedProperties.Add("primaryKey", "employee_id"); dtObj.ExtendedProperties.Add("createdDate", DateTime.Now); For retrieving assigned properties, int iCount = Convert.ToInt32(dtObj.ExtendedProperties["totalCount"].ToString()); So simple and effective property.
LINQ - Language Integrated Query.It provides the Querying ability to the database and also doing the DML operations such as insert, update and delete.for more about LINQ, have a look at http://msdn.microsoft.com/en-us/library/bb308959.aspx There are infinite pages are available to describe the Linq, its functionality, and design. But for a beginner, let us go with creating a simple application using Linq and playing with database. Before writing the program, we need to know the following basic things. 1. DataContext This is a Layer or cache kind of stuff which interacts between the database and application. The application uses the datacontext to manipulate data with the database. 2. dbml - Database Markup Language Linq to SQL class is known as dbml. The dbml maintains the tables and linkings. Now we start with creating simple program. The aim of the program is to display the Northwind customers data whose names are starting with "a" in a datagrid. Step 1: Create new C# wi...
It is little harder to keep remember passwords of our Gmail accounts all the time. Recently, I have found the following chrome browser extension "Quick Login for Google Accounts" which solves the above problem. No more worries about the password maintenance. It is also secure. More details about the Quick Login chrome extension; Quick Login for Google Accounts Really good and simple extension. Thanks to the guys who created this.
Comments
Post a Comment