Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051

Warning: First parameter must either be an object or the name of an existing class in H:\root\home\amrsaafan-001\www\nilebits\wp-content\themes\porto\inc\functions\general.php on line 1051
2010 | Nile Bits

Yearly Archives - 2010

JavaScript regular expression to match a comma delimited list

This method uses the JavaScript String's match() method to parse a comma delimited list and show its content in a Panel control. You can try it here http://jsfiddle.net/38tXU/ function parseList(list) { var reg = list.match(/\w+(,\w+)*/g); document.getElementById('pnl').innerHTML = 'Total length:' + reg.length + '<br />'; for (var i =...

Difference between inner and outer join in SQL

Joins are used to combine the data from two tables, with the result being a new, temporary table.The temporary table is created based on column(s) that the two tables share, which represent meaningful column(s) of comparison.The goal is to extract meaningful data from the resulting temporary table.Joins are performed based on something called a...

Two Databound fields in Gridview column ASP.NET

Boundfields are great in the Gridview, but they do have their limitations.One is that it only has room for one bound field. So, what do you do when you want two or data fields.For example, First and Last names returned to the same column.Turn the BoundField into a TemplateField, with a label in it: <asp:templatefield> ...

How to check SQL Server database is exists using C#.NET

The following method using sys. schema and views such as sys.databases and sys.tables.As we know that the old style sysobjects and sysdatabases and those catalog views have been deprecated since SQL Server. private static bool CheckDatabaseExists(string connectionString, string databaseName) { string sqlQuery; bool result = false; try { ...

Select DropDownList item after declarative DataBinding

The declarative controls of ASP.NET are really great. However, there are some times, when it may not seem so.Let's say you have a DropDownList which is bound by a DataSource control. Also, you have other pages hitting this page, with querystrings, and based on the item in the querystring, you'd like the to select that...

Prevent Saving Changes That Require Table Re-creation SQL Server

I was modifying an existing table using SQL Server Management Studio, but I got this error message on saving: Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option...

How to Dynamically Select rows in SQL Server

If you want to restrict other developers from using your Stored Procedures that returns a huge amount of data which affects server performance and Application Performance weather it is a Windows or Web Application. You can use the following idea when you create Stored Procedures: -- ============================================= -- Author: Amr...

How to convert DataRow to DataRowView

Converting DataRow to DataRowView is not possible, but we can go around this by using DefaultView property of the Data Row Table. The following code example demonstrate how to get DataRowView out of DataRow: DataTable dt = new DataTable(); dt.Columns.Add("ID", typeof(int)); dt.Columns.Add("Name", typeof(string)); for (int i = 0; i < 10; i++) { DataRow tempDR = dt.NewRow(); tempDR["ID"] = (i...