<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7232150415872926062</id><updated>2026-09-24T11:46:59.666+03:00</updated><category term="ASP.NET"/><category term="C#"/><category term="SQL Server"/><category term="JavaScript"/><category term="SQL"/><category term="Web.Config"/><category term="GridView"/><category term="ADO.NET"/><category term="CLR"/><category term="HTML"/><category term="Runtime Host"/><category term="Windows Vista"/><category term="AJAX"/><category term="Captcha Image"/><category term="Regex"/><category term="Viewstate"/><category term="Windows XP"/><category term="XML"/><category term="jQuery"/><category term=".NET Framwork"/><category term="Application Architecture"/><category term="Barcode"/><category term="CSS"/><category term="Creative Programmer"/><category term="Cross Page postback"/><category term="Encryption"/><category term="FileUpload"/><category term="HTTP Handlers"/><category term="Interview Tips"/><category term="Microsoft Windows"/><category term="Page Class"/><category term="Rad Treeview"/><category term="SEO"/><category term="SQL Injection"/><category term="SQL Reporting Services"/><category term="SQL Server 2012"/><category term="Sequence"/><category term="Session State"/><category term="SharePoint"/><category term="State Management"/><category term="Telerik"/><category term="Variable Naming"/><category term="Visual Studio"/><category term="Web 2.0"/><category term="Web Portal"/><category term="XPath"/><title type='text'>Amr Saafan</title><subtitle type='html'>Think outside the box...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>96</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-4788575915300878159</id><published>2016-07-13T20:06:00.003+02:00</published><updated>2021-09-08T14:30:12.651+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sequence"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2012"/><title type='text'>SQL Server 2012 Auto Identity Column Value Jump bug!</title><summary type="text">


    I am working on a database using SQL Server 2012. There is a table named Order has an auto Identity Column named OrderId datatype is int .
    
    I noticed that the sequence of the identity is just not right. It has jumped with 1000.
    After research about this issue, I found that this is an issue with SQL Server 2012 version.
    
    From SQL Server 2012 version, when SQL Server </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/4788575915300878159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2016/07/sql-server-2012-auto-identity-column.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/4788575915300878159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/4788575915300878159'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2016/07/sql-server-2012-auto-identity-column.html' title='SQL Server 2012 Auto Identity Column Value Jump bug!'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3581950405692180691</id><published>2015-01-01T15:01:00.001+02:00</published><updated>2026-07-03T16:55:21.983+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SEO"/><title type='text'>How to migrate a domain without losing your SEO</title><summary type="text">





1. Map All Old Domain URLs To Their New Domain Versions&amp;nbsp;
This basically required mapping all of the dynamic and static old domain URLs to new domain URLs so they could all be 301 redirected at launch.


2. Understand How Any UI Changes Might Affect SEO&amp;nbsp;
Changing UI while changing domains should be avoided whenever possible to eliminate yet another thing that could go wrong. That </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3581950405692180691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2015/01/how-to-migrate-domain-without-losing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3581950405692180691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3581950405692180691'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2015/01/how-to-migrate-domain-without-losing.html' title='How to migrate a domain without losing your SEO'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-4284619440351134850</id><published>2014-02-01T17:23:00.001+02:00</published><updated>2026-07-03T16:55:12.535+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'> Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack ASP.NET</title><summary type="text">
While I was debugging an ASP.NET Application, I wanted to get an object values I got this error message instead:

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

This problem occurs when using&amp;nbsp;Response.Redirect or Server.Transfer method, because the Response.End method ends the page execution and shifts the execution to the </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/4284619440351134850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2014/02/unable-to-evaluate-expression-because.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/4284619440351134850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/4284619440351134850'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2014/02/unable-to-evaluate-expression-because.html' title=' Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack ASP.NET'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-8298079065564096207</id><published>2013-08-23T23:05:00.001+02:00</published><updated>2026-07-03T16:54:23.430+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Web.Config"/><title type='text'>Adding the specified count to the semaphore would cause it to exceed its maximum count</title><summary type="text">
I got this unusual exception while working on an ASP.NET project:
&quot;Adding the specified count to the semaphore would cause it to exceed its maximum count error&quot;.

I thought it is something related to SQL Server Database Connection String.
After using Query Profiler I was able to run SQL queries directly without any problems.
So this means that the issue in ASP.NET Application not with the SQL </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/8298079065564096207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/08/adding-specified-count-to-semaphore.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/8298079065564096207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/8298079065564096207'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/08/adding-specified-count-to-semaphore.html' title='Adding the specified count to the semaphore would cause it to exceed its maximum count'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-7921161210917239913</id><published>2013-07-11T22:11:00.001+02:00</published><updated>2026-07-03T16:54:30.496+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Rad Treeview"/><category scheme="http://www.blogger.com/atom/ns#" term="Telerik"/><title type='text'>How to disable some context menu items on Telerik TreeView</title><summary type="text">
There is an event named &quot;OnClientContextMenuShowing&quot; for Rad Treeview that calls javascipt function and passes 2 arguments &quot;sender, args&quot;.
The Args parameter contains The current selected TreeNode and Context Menu Items.
You can enable or disable any Context menu item based on any attributes for the Current Selected Tree Node.

Here is a code snippet for the javascript function that demonstrate </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/7921161210917239913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/07/how-to-disable-some-context-menu-items.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/7921161210917239913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/7921161210917239913'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/07/how-to-disable-some-context-menu-items.html' title='How to disable some context menu items on Telerik TreeView'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3253514945926060005</id><published>2013-05-01T18:38:00.001+02:00</published><updated>2026-07-03T16:54:39.833+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to Select from Data Table in C#</title><summary type="text">
DataTable Object has a Select Method which acts like Where in SQL Server. So if you want to write filter query you write the column name directly without Where and the filter expression you want.

I made a simple example that creates a DataTable and fill it with some data and use Select method:

DataTable dt = new DataTable(&quot;MyDataTable&quot;);
dt.Columns.Add(new DataColumn(&quot;ID&quot;, typeof(int)));
</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3253514945926060005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/05/how-to-select-from-data-table-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3253514945926060005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3253514945926060005'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/05/how-to-select-from-data-table-in-c.html' title='How to Select from Data Table in C#'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-5634995467361698602</id><published>2013-03-01T13:26:00.001+02:00</published><updated>2026-07-03T16:54:48.111+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>How to get Year, Month and Day out of SQL Date in SQL Server</title><summary type="text">
Let is say that we have the following Date&amp;nbsp;2007-04-05 10:13:14.109 and we want to get Year, Month and Day out of this date.

There is a function named&amp;nbsp;DATEPART() that can be used to archive this.
DECLARE @MyDate AS DATETIME 
SET @MyDate = &#39;2007-04-05 10:13:14.109&#39;
SELECT DATEPART(DAY, @MyDate) AS MyDay, DATEPART(MONTH, @MyDate) AS MyMonth, DATEPART(YEAR, @MyDate) AS MyYear


The result</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/5634995467361698602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/03/how-to-get-year-month-and-day-out-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5634995467361698602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5634995467361698602'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/03/how-to-get-year-month-and-day-out-of.html' title='How to get Year, Month and Day out of SQL Date in SQL Server'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-5280263791927742802</id><published>2013-02-01T01:55:00.001+02:00</published><updated>2026-07-03T16:54:56.749+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to know if a Date is in range between two Dates in C#</title><summary type="text">
Let&#39;s say that we have a DateTime = Jan 1, 2012 and we want to check if this date is between 2 other dates.
The following code example Implements IRange interface that can be used with Integers too.

public interface IRange
    {
        T Start { get; }
        T End { get; }
        bool WithInRange(T value);
        bool WithInRange(IRange range);
    }

    public class DateRange : IRange
</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/5280263791927742802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/02/how-to-know-if-date-is-in-range-between.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5280263791927742802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5280263791927742802'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/02/how-to-know-if-date-is-in-range-between.html' title='How to know if a Date is in range between two Dates in C#'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-2744561114265825195</id><published>2013-01-01T11:01:00.001+02:00</published><updated>2026-07-03T16:55:04.560+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to avoid Uncaught ReferenceError: $ is not defined in jQuery</title><summary type="text">
Sometimes while developing an existing Web Application, I wanted to use jQuery function and I get this error &quot;Uncaught ReferenceError: $ is not defined&quot;.

There are some reasons causing it and ways to avoid them:

Make sure&amp;nbsp;the references to the&amp;nbsp;jQuery&amp;nbsp;scripts is loading first, but them in the head of master page or the&amp;nbsp;page you are using.
Sometimes the&amp;nbsp;references to the</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/2744561114265825195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2013/01/how-to-avoid-uncaught-referenceerror-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/2744561114265825195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/2744561114265825195'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2013/01/how-to-avoid-uncaught-referenceerror-is.html' title='How to avoid Uncaught ReferenceError: $ is not defined in jQuery'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-8671353964798481786</id><published>2012-06-01T21:56:00.001+02:00</published><updated>2026-07-03T16:53:40.107+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to Replace the First Instance of a String in C#</title><summary type="text">
Assume that you have a string and you expect that this string might have some duplicated instances.

String.Replace() is very good Function, but it will replace all the instances of the string. So to accomplish this you need to replace the first instance you find.

The next code example can be used as a helper method in your project if you are dealing with strings frequently:

public static </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/8671353964798481786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/06/how-to-replace-first-instance-of-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/8671353964798481786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/8671353964798481786'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/06/how-to-replace-first-instance-of-string.html' title='How to Replace the First Instance of a String in C#'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-7192386004601396242</id><published>2012-05-01T19:26:00.001+02:00</published><updated>2026-07-03T16:53:48.381+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to Programmatically create iFrame in ASP.NET</title><summary type="text">
Sometimes we may need to create iFrames and use it within GridView or Repeater, and we want to pass some values to it.
This example will show you how to create iFrame&amp;nbsp;Programmatically and add it to a PlaceHolder.

HtmlGenericControl myFrame = new HtmlGenericControl();

myFrame.TagName = &quot;IFRAME&quot;;
myFrame.Attributes[&quot;src&quot;] = &quot;MyPagePath&quot;;
myFrame.Attributes[&quot;id&quot;] = &quot;myFrame1&quot;;
</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/7192386004601396242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/05/how-to-programmatically-create-iframe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/7192386004601396242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/7192386004601396242'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/05/how-to-programmatically-create-iframe.html' title='How to Programmatically create iFrame in ASP.NET'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-6528489688152431459</id><published>2012-04-23T15:51:00.001+02:00</published><updated>2026-07-03T16:53:56.140+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Web.Config"/><title type='text'>Operation is not valid due to the current state of the object, Exception in ASP.NET</title><summary type="text">
I got this error when I tried to save a Page with lots of form fields to SQL Server Database.
The default max number of form fields that can be post is 1000.
In order to solve this error add this Line to your Web.Config File:

&amp;lt;appSettings&amp;gt;
  &amp;lt;add key=&amp;quot;aspnet:MaxHttpCollectionKeys&amp;quot; value=&amp;quot;10000&amp;quot; /&amp;gt;
&amp;lt;/appSettings&amp;gt;


</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/6528489688152431459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/04/operation-is-not-valid-due-to-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/6528489688152431459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/6528489688152431459'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/04/operation-is-not-valid-due-to-current.html' title='Operation is not valid due to the current state of the object, Exception in ASP.NET'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3434224511701540049</id><published>2012-03-01T17:54:00.001+02:00</published><updated>2026-07-03T16:54:03.421+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to Convert SqlDataSource to DataTable and DataView in C#</title><summary type="text">
Sometimes I want to use SqlDataSource &amp;nbsp;returned data programmatically and here is how you can do this,

In this example I will assume that SqlDataSource &amp;nbsp;ID is SqlDataSource1 which is the default ID:
DataSourceSelectArguments args = new DataSourceSelectArguments();
DataView view = SqlDataSource1.Select(args) as DataView; 
DataTable dt = view.ToTable();

</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3434224511701540049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/03/how-to-convert-sqldatasource-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3434224511701540049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3434224511701540049'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/03/how-to-convert-sqldatasource-to.html' title='How to Convert SqlDataSource to DataTable and DataView in C#'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3739865450669434832</id><published>2012-02-15T23:54:00.001+02:00</published><updated>2026-07-03T16:54:10.147+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>How to Submit a Form Using JavaScript</title><summary type="text">
Any form is submitted when the user click on the submit button.
But you may need to submit the form programmatically using JavaScript.
JavaScript has the form object that contains the submit() method.
Use the &quot;ID&quot; of the form to get the form object.
Example:
If the name of the form is &quot;Form1&quot;, JavaScript code for the submit method is:

document.forms[&quot;Form1&quot;].submit();





</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3739865450669434832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/02/how-to-submit-form-using-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3739865450669434832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3739865450669434832'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/02/how-to-submit-form-using-javascript.html' title='How to Submit a Form Using JavaScript'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-1053565372423301600</id><published>2012-01-01T15:57:00.001+02:00</published><updated>2026-07-03T16:54:16.999+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Regex"/><title type='text'>Javascript Regular Expression to match a comma delimited list</title><summary type="text">
This method uses the JavaScript String&#39;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(&#39;pnl&#39;).innerHTML = &#39;Total length:&#39; + reg.length + &#39;&amp;lt;br /&amp;gt;&#39;;
    for (var i = 0; i &amp;lt; reg.length; i++) {
        </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/1053565372423301600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2012/01/javascript-regular-expression-to-match.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/1053565372423301600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/1053565372423301600'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2012/01/javascript-regular-expression-to-match.html' title='Javascript Regular Expression to match a comma delimited list'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-1441938286237851913</id><published>2011-11-09T00:47:00.000+02:00</published><updated>2018-10-15T12:53:45.349+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Viewstate"/><title type='text'>How to Completely Disable Viewstate in ASP.NET</title><summary type="text">
I tried to disable Viewstate of a website by set EnableViewState Page directive to false.
But when I get the Page HTML Source I found the following line:

&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;__VIEWSTATE&amp;quot; id=&amp;quot;__VIEWSTATE&amp;quot;
 value=&amp;quot;/wEPDwUKMTY1NDU2MTA1MmRk7eWz8DBE7zF7MW8sS4wNndKCr5gBJPZZ/LOS1KIbBo4=&amp;quot; /&amp;gt; 

protected override void SavePageStateToPersistenceMedium(</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/1441938286237851913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/11/how-to-completely-disable-viewstate-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/1441938286237851913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/1441938286237851913'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/11/how-to-completely-disable-viewstate-in.html' title='How to Completely Disable Viewstate in ASP.NET'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3305891372178918939</id><published>2011-11-01T12:19:00.001+02:00</published><updated>2026-07-03T16:52:58.354+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Difference between Inner and Outer Join in SQL</title><summary type="text">
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 predicate, which specifies the condition to use </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3305891372178918939/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/11/difference-between-inner-and-outer-join.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3305891372178918939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3305891372178918939'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/11/difference-between-inner-and-outer-join.html' title='Difference between Inner and Outer Join in SQL'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-506455916374084697</id><published>2011-10-19T01:04:00.001+02:00</published><updated>2026-07-03T16:53:07.759+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to Copy some rows from a GridView to another in ASP.NET</title><summary type="text">
A junior developer asked me can I select some rows from a GridView and copy them to another GridView? 
I told him sure all you have to do is to create a DataTable and the columns that will be added to it.
Now you will loop for each row in the first GridView then add the selected rows to the DataTable.
Set the DataSource of the other GirdView to DataTable.
Here is the code that would do the trick</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/506455916374084697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/10/how-to-copy-some-rows-from-gridview-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/506455916374084697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/506455916374084697'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/10/how-to-copy-some-rows-from-gridview-to.html' title='How to Copy some rows from a GridView to another in ASP.NET'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-2807357404471361381</id><published>2011-10-03T14:48:00.001+02:00</published><updated>2026-07-03T16:53:15.627+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Two Databound Fields in Gridview column</title><summary type="text">
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:

&amp;lt;asp:templatefield&amp;gt;
 &amp;lt;itemtemplate&amp;gt;               
  &amp;lt;asp:label id=&amp;quot;</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/2807357404471361381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/10/two-databound-fields-in-gridview-column.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/2807357404471361381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/2807357404471361381'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/10/two-databound-fields-in-gridview-column.html' title='Two Databound Fields in Gridview column'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-3622480262090405557</id><published>2011-09-01T19:28:00.001+02:00</published><updated>2026-07-03T16:53:22.915+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Select Drop Down List Item After Declarative Databinding</title><summary type="text">
The new declarative controls of ASP.NET 2.0 are really great. However, there are some times, when it may not seem so.

Let&#39;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&#39;d like the to select that item.
In ASP.NET 1.1, you&#39;d just code it, and select it after the </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/3622480262090405557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/09/select-drop-down-list-item-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3622480262090405557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/3622480262090405557'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/09/select-drop-down-list-item-after.html' title='Select Drop Down List Item After Declarative Databinding'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-5924243481791117393</id><published>2011-01-01T01:30:00.001+02:00</published><updated>2026-07-03T16:53:32.334+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>How to check SQL Server Database is Exists using C#</title><summary type="text">
The following method using&amp;nbsp;sys.&amp;nbsp;schema and views such as&amp;nbsp;sys.databases and sys.tables.
As we know that the old style&amp;nbsp;sysobjects and sysdatabases and those catalog views have been deprecated since&amp;nbsp;SQL Server 2005.
private static bool CheckDatabaseExists(string connectionString, string databaseName)
{
    string sqlQuery;
    bool result = false;

    try
    {
        </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/5924243481791117393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2011/01/how-to-check-sql-server-database-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5924243481791117393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5924243481791117393'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2011/01/how-to-check-sql-server-database-is.html' title='How to check SQL Server Database is Exists using C#'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-6483353491443629560</id><published>2010-07-01T11:32:00.001+03:00</published><updated>2026-07-03T16:51:46.035+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><title type='text'>How to get Drop Down List Selected Text in ASP .NET by using jQuery</title><summary type="text">
The Following code sample shows how to get selected text out from ASP .NET Drop Down List.
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;

    function GetSelectedText() {
        var ddlID = &#39;#&#39; + &#39;&amp;lt;%= ddlEmployees.ClientID %&amp;gt;&#39;;
        var selectedText = $(ddlID + &amp;quot; option:selected&amp;quot;).text();
        return selectedText;
    }

&amp;lt;/script&amp;gt;

&amp;lt;asp:DropDownList ID=&amp;quot;</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/6483353491443629560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2010/07/how-to-get-drop-down-list-selected-text.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/6483353491443629560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/6483353491443629560'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2010/07/how-to-get-drop-down-list-selected-text.html' title='How to get Drop Down List Selected Text in ASP .NET by using jQuery'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-9076745455849868983</id><published>2010-06-01T23:27:00.001+03:00</published><updated>2026-07-03T16:52:07.894+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>How to Dynamically Select rows in SQL Server</title><summary type="text">
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 Saafan
-- Create date: Jan 5, 2010
-- </summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/9076745455849868983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2010/06/how-to-dynamically-select-rows-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/9076745455849868983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/9076745455849868983'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2010/06/how-to-dynamically-select-rows-in-sql.html' title='How to Dynamically Select rows in SQL Server'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-5373086753436865723</id><published>2010-05-01T23:40:00.001+03:00</published><updated>2026-07-03T16:52:18.395+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ADO.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to convert Data Row to Data Row View</title><summary type="text">
Converting Data Row to Data Row View 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 Data Row View out of Data Row:
DataTable dt = new DataTable();

dt.Columns.Add(&quot;ID&quot;, typeof(int));
dt.Columns.Add(&quot;Name&quot;, typeof(string));

for (int i = 0; i &lt; 10; i++)
{
 DataRow tempDR = dt.NewRow();
 tempDR[&quot;ID&quot;</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/5373086753436865723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2010/05/how-to-convert-data-row-to-data-row-view.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5373086753436865723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5373086753436865723'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2010/05/how-to-convert-data-row-to-data-row-view.html' title='How to convert Data Row to Data Row View'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7232150415872926062.post-5425457142607087387</id><published>2010-04-01T16:15:00.001+02:00</published><updated>2026-07-03T16:52:28.772+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Prevent Saving Changes That Require Table Re-creation SQL Server 2008</title><summary type="text">
I was modifying an existing table using SQL Server Management Studio 2008 R2, 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&#39;t be re-created or enabled the option Prevent saving changes that require the table to be re-created.

This</summary><link rel='replies' type='application/atom+xml' href='http://amrsaafan.blogspot.com/feeds/5425457142607087387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://amrsaafan.blogspot.com/2010/04/prevent-saving-changes-that-require.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5425457142607087387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7232150415872926062/posts/default/5425457142607087387'/><link rel='alternate' type='text/html' href='http://amrsaafan.blogspot.com/2010/04/prevent-saving-changes-that-require.html' title='Prevent Saving Changes That Require Table Re-creation SQL Server 2008'/><author><name>Amr Saafan</name><uri>http://www.blogger.com/profile/07434802167262444653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='25' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5jCbXtWJAedpUot0S2hEyNClaDmgRVghK_fR4OktljETQnxQWx3LyYnovqEPoV37RqhB11LOtD2gaElucxDuaL_7fOGgMBuTcURz2WqGnvfpVxtQvEewkF0Y0tlL3nQ/s144/Untitled.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivKynjpXUQv4h3rgvohjT84hii7pcVAbh_H6cko70yHLQBYgmg5j-01g-0CGC7Cb1wJwVi2xwrULYD6kA-YLYC4p9ycbEZHb9mbAMxvKqWrm_V_A_tMGE7w4XxKRNv8G6Me4tIXuwRVcXF/s72-c/Prevent+saving+changes+that+require+the+table+re-creation.JPG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>