<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>ASP Net 2.0</title><link>http://radcom.ir/weblog/amir/category/79.aspx</link><description>ASP Net 2.0</description><managingEditor>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;&amp;#1603;&amp;#1605;&amp;#1575;&amp;#1604;&amp;#1610;</managingEditor><dc:language>fa</dc:language><generator>SAMPA Weblogs</generator><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Create ASP Net Website Administration Link</title><link>http://radcom.ir/weblog/amir/archive/2008/02/05/42292.aspx</link><pubDate>Tue, 05 Feb 2008 12:07:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2008/02/05/42292.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/42292.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2008/02/05/42292.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/42292.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/42292.aspx</trackback:ping><description>&lt;ul dir="ltr"&gt;
	&lt;li&gt;Create a virtual directory at the root of your default website &lt;/li&gt;
	&lt;li&gt;Name the virtual WebAdmin &lt;/li&gt;
	&lt;li&gt;Set the Path of the Virtual Directory to 
	&amp;quot;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\ASP.NETWebAdminFiles&amp;quot; where 
	50215 is the appropriate build version for your installed .NET 2.0 
	framework. &lt;/li&gt;
	&lt;li&gt;After the Virtual Directory has been created, right click on the Virtual 
	Directory and got to properties.&amp;nbsp; Select the ASP.NET tab and make sure the 
	ASP.NET version is set to a 2.0 version. &lt;/li&gt;
	&lt;li&gt;Open a browser and browse to the following url: &lt;br /&gt;
	http://localhost/webadmin/default.aspx?applicationPhysicalPath=D:\wwwroot\timetracker\&amp;amp;applicationUrl=/Timetracker
	&lt;/li&gt;
	&lt;li&gt;Make sure to change the applicationPhysicalPath and applicationUrl 
	querystring parameters to match whatever they are on your system.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src ="http://radcom.ir/weblog/amir/aggbug/42292.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Get Top n Row From DataTable or DataView</title><link>http://radcom.ir/weblog/amir/archive/2007/11/11/42112.aspx</link><pubDate>Sun, 11 Nov 2007 08:53:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/11/11/42112.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/42112.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/11/11/42112.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/42112.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/42112.aspx</trackback:ping><description>&lt;TABLE class=" FCK__ShowTableBorders" dir=ltr width="100%" align=center border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;public&lt;/SPAN&gt; DataView GetTopDataViewRows(DataView source, &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;int&lt;/SPAN&gt; count)
{
	DataTable output &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; source.Table.Clone();
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;int&lt;/SPAN&gt; i &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; 0; i &amp;lt; count; i++)
	{
		&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;if&lt;/SPAN&gt; (i &amp;gt;= source.Count)
			&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;break&lt;/SPAN&gt;;
		output.ImportRow(source[i].Row);
	}
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;return&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;new&lt;/SPAN&gt; DataView(output, source.RowFilter, &lt;BR&gt;	source.Sort, source.RowStateFilter);
}&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/42112.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Altering a column on a Replicated Table</title><link>http://radcom.ir/weblog/amir/archive/2007/10/29/42091.aspx</link><pubDate>Mon, 29 Oct 2007 16:34:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/10/29/42091.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/42091.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/10/29/42091.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/42091.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/42091.aspx</trackback:ping><description>&lt;P&gt;
&lt;TABLE class=" FCK__ShowTableBorders content" dir=ltr cellSpacing=1 cellPadding=1 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; 
&lt;P&gt;Sometimes the schema of a replicated table needs altering. There are many reasons this might be the case eg possibly the datatype has been incorrectly chosen, or a default is missing, or we want to rename a column. Attempting to change the table schema directly will result in the error&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;I&gt;"Cannot alter/drop the table 'tablename' because it is being published for replication".&lt;/I&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, how to change an existing column without breaking replication? Consider if we wanted to make the following schema change:&lt;/P&gt;
&lt;P&gt;&lt;IMG height=97 src="http://www.sqlservercentral.com/articles/Replication/alteringacolumnonareplicatedtable/1666/BeforeTable.GIF" width=212 border=0&gt; to &lt;IMG height=99 src="http://www.sqlservercentral.com/articles/Replication/alteringacolumnonareplicatedtable/1666/AfterTable.GIF" width=216 border=0&gt;&lt;/P&gt;
&lt;P align=left&gt;The method we choose depends in part on the replication type and size of the table, but there are 2 main options:&amp;nbsp;&lt;/P&gt;
&lt;H3 class=section&gt;(a) altering the subscriptions&lt;/H3&gt;&lt;PRE class=code style="WIDTH: 480px" calculatedWidth="480"&gt;  exec sp_dropsubscription   @publication =  'tTestFNames'&amp;nbsp;
     ,  @article =  'tEmployees'&amp;nbsp;
     ,  @subscriber =  'RSCOMPUTER'
     ,  @destination_db =  'testrep'&amp;nbsp;
  

  exec sp_droparticle  @publication =  'tTestFNames'
     ,  @article =  'tEmployees'
  

  alter table tEmployees alter column Forename varchar(100) null
  

  exec sp_addarticle  @publication =  'tTestFNames'&amp;nbsp;
     ,  @article =  'tEmployees'&amp;nbsp;
     ,  @source_table =  'tEmployees'&amp;nbsp;
  

  exec sp_addsubscription  @publication =  'tTestFNames'
     ,  @article =  'tEmployees'
     ,  @subscriber =  'RSCOMPUTER'&amp;nbsp;
     ,  @destination_db =  'testrep'&amp;nbsp;
  &lt;/PRE&gt;For &lt;B&gt;snapshot replication &lt;/B&gt;this is the obvious choice. We drop the subscription to this article, drop the article, then change the table. Afterwards the process is reversed. The next time the snapshot agent is run, it'll pick up the new schema without any issues.&lt;BR&gt;&lt;BR&gt;For &lt;B&gt;transactional replication&lt;/B&gt; we may choose to proceed using the script above. However, we must be more careful in this case. By default, an insert, update or delete statement performed on the publisher is propagated to the subscriber in the form of a stored procedure call. By changing the column definition, we may need to change the related stored procedures on all the subscribers. Addition of a default would be fine, but changing the datatype itself as above would require the stored procedure arguments to be modified. For the example table above, these 3 procedures exist on the subscriber in the form:&amp;nbsp;&lt;BR&gt;&lt;BR&gt;sp_MSins_tEmployees,&amp;nbsp;&lt;BR&gt;sp_MSupd_tEmployees,&amp;nbsp;&lt;BR&gt;sp_MSdel_tEmployees.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;They can be generated at the publisher using sp_scriptpublicationcustomprocs but this would of course require the system to be quiesced, i.e. during this (quick) change there shouldn't be any alterations made to the publisher's data and all the subscribers should be completely synchronized.&amp;nbsp; 
&lt;P&gt;This is not ideal, and there is also a hidden problem here waiting to be discovered. Usually, when you add a new article to an existing publication in transactional replication, running the snapshot agent will create a snapshot of just the new article. In our case, it'll also create a snapshot of the 'tEmployees' table. So, to avoid all the issues and complications mentioned above, it's simplest to run the snapshot agent immediately after executing sp_addsubscription and then synchronize.&lt;BR&gt;&lt;BR&gt;In &lt;B&gt;merge replication&lt;/B&gt;, there is no possibility of dropping the subscription on a per article basis using the script above, as there is in transactional and snapshot replication. If we drop the subscription entirely including all other articles (sp_dropmergesubscription), then try to run sp_dropmergearticle there will be an error if the snapshot has already been run, so we have to set @forceinvalid_snapshot to 1, make the table change on the publisher then read the article and subscriptions and initialize which would necessitate a new snapshot generation of &lt;I&gt;all&lt;/I&gt; articles in this publication. A nosync initialization is possible, but this can be extremely restrictive for future changes, and I'll leave that for another article. &lt;/P&gt;
&lt;H3 class=section&gt;(b) altering the table in-place&lt;/H3&gt;OK, in some cases the table is large and we don't want to run a new snapshot - either of the individual table (transactional) or of the whole publication (merge) - so there is an alternative method. We might use the built in stored procedures sp_repladdcolumn and sp_repldropcolumn to make the changes (note that these procedures limit the subscribers to be SQL Server 2000 only). Using these procedures we can add a dummy column to hold the data, remove the old column, add in the correct definition of the original column then transfer back the data. Now the script becomes:&lt;BR&gt;&lt;PRE class=code style="WIDTH: 480px" calculatedWidth="480"&gt;  exec sp_repladdcolumn  @source_object =  'tEmployees'
     ,  @column =  'TempForename'&amp;nbsp;
     ,  @typetext =  'varchar(100) NULL'&amp;nbsp;
     ,  @publication_to_add =  'tTestFNames'&amp;nbsp;
  

  update tEmployees set TempForename = Forename
  

  exec sp_repldropcolumn  @source_object =  'tEmployees'&amp;nbsp;
     ,  @column =  'Forename'&amp;nbsp;
  

  exec sp_repladdcolumn  @source_object =  'tEmployees'
     ,  @column =  'Forename'&amp;nbsp;
     ,  @typetext =  'varchar(100) NULL'&amp;nbsp;
     ,  @publication_to_add =  'tTestFNames'&amp;nbsp;
  

  update tEmployees set Forename = TempForename
  

  exec sp_repldropcolumn  @source_object =  'tEmployees'&amp;nbsp;
     ,  @column =  'TempForename'
    &lt;/PRE&gt;Although the above script can be used for transactional replication or merge replication, the internal methodology is different due to the differing nature of these 2 techniques. For merge replication, details of the rows updated are kept in MSmerge_contents, and if a particular row has been changed once or a hundred times, there will still only be one entry in this system table, while in transactional replication, 100 updates to a row is propagated as 100 subscriber updates. This means merge has an advantage over transactional because we need to perform 2 updates to each row to make the schema change.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;You can find the main article in: &lt;A href="http://www.sqlservercentral.com/articles/Replication/alteringacolumnonareplicatedtable/1666/" target=_blank&gt;http://www.sqlservercentral.com/articles/Replication/alteringacolumnonareplicatedtable/1666/&lt;/A&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/42091.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Open New Window After Button Click and After running Server Side Code</title><link>http://radcom.ir/weblog/amir/archive/2007/10/22/42077.aspx</link><pubDate>Mon, 22 Oct 2007 15:13:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/10/22/42077.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/42077.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/10/22/42077.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/42077.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/42077.aspx</trackback:ping><description>&lt;P dir=ltr&gt;Add your code in button click add this code (replace your link in the code)&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;private&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;void&lt;/SPAN&gt; btn_Click(object sender, EventArgs e)&lt;BR&gt;	{&lt;BR&gt;&lt;BR&gt;.....&lt;BR&gt;&lt;BR&gt;&amp;nbsp;StringBuilder script &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;new&lt;/SPAN&gt; StringBuilder();&lt;BR&gt;script.Append(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"&amp;lt;script&amp;gt;"&lt;/SPAN&gt;);&lt;BR&gt;script.AppendFormat(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"window.open('{0}', '', '');"&lt;/SPAN&gt;, link);&lt;BR&gt;script.Append(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"&amp;lt;/scri"&lt;/SPAN&gt;);&lt;BR&gt;script.Append(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"pt&amp;gt;"&lt;/SPAN&gt;);&lt;BR&gt;Page.RegisterStartupScript(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"opennewwindow"&lt;/SPAN&gt;, script.ToString());&lt;BR&gt;&lt;BR&gt;.....&lt;BR&gt;&lt;BR&gt;}&lt;/P&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/42077.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Error Access to path denied when use File.Copy when file exists!</title><link>http://radcom.ir/weblog/amir/archive/2007/09/12/41965.aspx</link><pubDate>Wed, 12 Sep 2007 17:02:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/09/12/41965.aspx</guid><description>&lt;P dir=ltr&gt;I got this strange error when tried to&amp;nbsp;overwrite file. I had full control access but i got this error.&lt;/P&gt;
&lt;P dir=ltr&gt;The error occured when the file is read only! change the attribute of&amp;nbsp;existing file and you will be able to copy the file!&lt;/P&gt;
&lt;P dir=ltr&gt;&amp;nbsp;&lt;/P&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41965.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Select a random row in Microsoft SQL Server</title><link>http://radcom.ir/weblog/amir/archive/2007/09/04/41936.aspx</link><pubDate>Tue, 04 Sep 2007 15:57:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/09/04/41936.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/41936.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/09/04/41936.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/41936.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/41936.aspx</trackback:ping><description>&lt;P dir=ltr&gt;You can do this with adding just an order by newid()&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#000000&gt;SELECT TOP 1&amp;nbsp;* FROM TableName ORDER BY NEWID()&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;&lt;FONT style="BACKGROUND-COLOR: #ffff00" color=#0000ff&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41936.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Change FCKEditor Configuration in ASP.NET </title><link>http://radcom.ir/weblog/amir/archive/2007/06/27/41704.aspx</link><pubDate>Wed, 27 Jun 2007 11:20:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/06/27/41704.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/41704.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/06/27/41704.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/41704.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/41704.aspx</trackback:ping><description>&lt;TABLE class="content FCK__ShowTableBorders" dir=ltr width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Here is a sample for change FCKEditor Configuration :&lt;BR&gt;&lt;PRE&gt;myFCKEditor.Config[&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"EditorAreaCSS"&lt;/SPAN&gt;] &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"/skins/default/"&lt;/SPAN&gt;;
&lt;/PRE&gt;&lt;/TD&gt;&lt;T tr&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41704.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Find Index of nTh occurrence of string in DotNet</title><link>http://radcom.ir/weblog/amir/archive/2007/06/11/41618.aspx</link><pubDate>Mon, 11 Jun 2007 10:37:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/06/11/41618.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/41618.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/06/11/41618.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/41618.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/41618.aspx</trackback:ping><description>&lt;TABLE class=" FCK__ShowTableBorders" dir=ltr cellSpacing=1 cellPadding=1 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;public&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;int&lt;/SPAN&gt; FindIndexOfnThOccurrence(&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;string&lt;/SPAN&gt; source, &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;string&lt;/SPAN&gt; pattern, &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;int&lt;/SPAN&gt; occurrence)
{
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;if&lt;/SPAN&gt; (occurrence &amp;lt; 1)
	{
		throw (&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;new&lt;/SPAN&gt; ArgumentException(&lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"Cannot be less than 1"&lt;/SPAN&gt;, &lt;SPAN style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #ededed"&gt;"occurrence"&lt;/SPAN&gt;));
	}
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;// Make occurrence zero-based
&lt;/SPAN&gt;	--occurrence;
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;// Run the regex once on the source string
&lt;/SPAN&gt;	Regex RE &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;new&lt;/SPAN&gt; Regex(pattern, RegexOptions.Multiline);
	MatchCollection theMatches &lt;SPAN style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;=&lt;/SPAN&gt; RE.Matches(source);
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;if&lt;/SPAN&gt; (occurrence &amp;gt;= theMatches.Count)
	{
		&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;return&lt;/SPAN&gt; -1;
	}
	&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;else&lt;/SPAN&gt;
	{
		&lt;SPAN style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: white"&gt;return&lt;/SPAN&gt; (theMatches[occurrence].Index);
	}
}
&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41618.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>Connect to Team Foundation Server Error: The request failed with HTTP status 403: TF53011:  is not a licensed user</title><link>http://radcom.ir/weblog/amir/archive/2007/06/07/41599.aspx</link><pubDate>Thu, 07 Jun 2007 11:27:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/06/07/41599.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/41599.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/06/07/41599.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/41599.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/41599.aspx</trackback:ping><description>&lt;P dir=ltr&gt;There is a special group in Workgroup edition called &lt;FONT style="BACKGROUND-COLOR: #ffff00"&gt;"Team Foundation Licensed Users".&lt;/FONT&gt;&lt;/P&gt;
&lt;P dir=ltr&gt;Add&amp;nbsp;users to this group i team faoundation server security settings.&lt;/P&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41599.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>&amp;#1575;&amp;#1605;&amp;#1610;&amp;#1585; &amp;#1605;&amp;#1610;&amp;#1585;</dc:creator><title>مرتب سازی و جستجو در آرایه های DotNet</title><link>http://radcom.ir/weblog/amir/archive/2007/05/28/41560.aspx</link><pubDate>Mon, 28 May 2007 12:27:00 GMT</pubDate><guid>http://radcom.ir/weblog/amir/archive/2007/05/28/41560.aspx</guid><wfw:comment>http://radcom.ir/weblog/amir/comments/41560.aspx</wfw:comment><comments>http://radcom.ir/weblog/amir/archive/2007/05/28/41560.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://radcom.ir/weblog/amir/comments/commentRss/41560.aspx</wfw:commentRss><trackback:ping>http://radcom.ir/weblog/amir/services/trackbacks/41560.aspx</trackback:ping><description>&lt;P&gt;در DotNet یک Object با نام Array وجود دارد که تمامی ابزار لازم برای کار با آرایه ها را در خود دارد. البته در نسخه ی 2.0 می توان در آرایه هایی با type های متفاوت نیز جستجو کرد.&lt;/P&gt;
&lt;P&gt;نکته:&amp;nbsp;در صورت استفاده از BinarySearch حتما آرایه را ابتدا مرتب نمایید (Array.Sort)&amp;nbsp; در غیر اینصورت به نتیجه مطلوب نخواهید رسید. &lt;/P&gt;&lt;img src ="http://radcom.ir/weblog/amir/aggbug/41560.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>