<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>CodeKeep C# Feed</title>
    <description>The latest and greatest C# code snippets publicly available</description>
    <link>http://www.codekeep.net/feeds.aspx</link>
    <lastBuildDate>Fri, 10 Oct 2008 20:38:01 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CodeKeepCSharp" type="application/rss+xml" /><item>
      <title>ClientScript.RegisterStartupScript</title>
      <description>Description: Call javascript method from codebehind&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/e6119e08-b41c-48d1-ad7d-0296a7605143.aspx'&gt;http://www.codekeep.net/snippets/e6119e08-b41c-48d1-ad7d-0296a7605143.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;this.Page.ClientScript.RegisterStartupScript(this.GetType(), &amp;quot;myScript&amp;quot;, &amp;quot;&amp;lt;script language=JavaScript&amp;gt;window.print();&amp;lt;/script&amp;gt;&amp;quot;);&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/417149628" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/417149628/e6119e08-b41c-48d1-ad7d-0296a7605143.aspx</link>
      <pubDate>Fri, 10 Oct 2008 20:38:01 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/e6119e08-b41c-48d1-ad7d-0296a7605143.aspx</feedburner:origLink></item>
    <item>
      <title>Running a command line utility from C#</title>
      <description>Description: How to run a command line utility from C#.  In this case, I needed to do a secure file copy to a remote server for an activiry report.  I chose to use pscp from PuTTY.  &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7c9e3cc2-9907-4ecc-a5bc-e4b7a7f5e514.aspx'&gt;http://www.codekeep.net/snippets/7c9e3cc2-9907-4ecc-a5bc-e4b7a7f5e514.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;string cmd = &amp;quot;pscp&amp;quot;;
string arguments = String.Format(&amp;quot;-v -pw {0} \&amp;quot;{1}\&amp;quot; {2}@{3}:{4}&amp;quot;,
  _pwd,
  activityReport.UploadFilename,
  _uid,
  _url,
  _uploadDir
);

ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = cmd;
psi.Arguments = arguments;

Logger.Debug(psi.FileName + &amp;quot; &amp;quot; + psi.Arguments);

psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;

psi.WindowStyle = ProcessWindowStyle.Normal;
psi.UseShellExecute = false;

Process listFiles = Process.Start(psi);
StreamReader myOutput = listFiles.StandardOutput;
StreamReader myError = listFiles.StandardError;

listFiles.WaitForExit(10 * 60 * 1000);  // timeout when?

if (listFiles.HasExited)
{
  // did it exit gracefully?
  Logger.Debug(myOutput.ToString() + myError.ToString());
  listFiles.Close();
} 
else 
{
  // or did it timeout and need to kill it.
  listFiles.Kill();
  listFiles.Close();
  throw new Exception(&amp;quot;Upload timed out. &amp;quot; + myOutput.ToString() + myError.ToString());
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/416225403" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/416225403/7c9e3cc2-9907-4ecc-a5bc-e4b7a7f5e514.aspx</link>
      <pubDate>Thu, 09 Oct 2008 23:17:12 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7c9e3cc2-9907-4ecc-a5bc-e4b7a7f5e514.aspx</feedburner:origLink></item>
    <item>
      <title>Return new identity from Strongly Typed Dataset DataTable.Insert method</title>
      <description>Description: Return new identity from Strongly Typed Dataset DataTable.Insert method&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/89bf687f-9c9e-4cee-b76e-12d00e22f13a.aspx'&gt;http://www.codekeep.net/snippets/89bf687f-9c9e-4cee-b76e-12d00e22f13a.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;

Datasets are pretty good at auto generating stored procedures and wrapping c# code around them for you.

However with the insert method you often want to do something with the object that you have just inserted.

Fortunately there is an easy way to get the Sproc and the c# method to return a reference to the object.

Firstly edit your insert stored procedure adding a @return parameter and a line after the insert to set this to a suitable value.

The exmaple below assumes that you are using bigint identity fields.

ALTER PROCEDURE dbo.insMyRow
(
    @Description varchar(500),
    @Return bigint output
)
AS
    SET NOCOUNT OFF;
INSERT INTO [myTable] ([Description]) VALUES (@Description);
    
SET @Return = SCOPE_IDENTITY()

Note that SCOPE_IDENTITY() is similar to @@IDENTITY except its scope is limited to the current command and so improves scalability.

Now when you save the Dataset you see that the insert method takes two parameters, the second being a nullable long.

My first thought was that Datasets should be the end of editing stored procedures but I am still impressed that the c# method declaration changes accordingly.

You can call the updated method in the following way.

long? objId=null;

myTableAdapter d =new myTableAdapter();

d.Insert(&amp;quot;Descriptive text&amp;quot;, ref objId);

the long? just means nullable long.

After filling the table you can now use the FindByxxxID functions of the DataTable to return the DataRow object.
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/415400481" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/415400481/89bf687f-9c9e-4cee-b76e-12d00e22f13a.aspx</link>
      <pubDate>Thu, 09 Oct 2008 03:26:07 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/89bf687f-9c9e-4cee-b76e-12d00e22f13a.aspx</feedburner:origLink></item>
    <item>
      <title>Test</title>
      <description>Description: Test&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/793c56cb-e335-4324-aa59-d4c68d94d868.aspx'&gt;http://www.codekeep.net/snippets/793c56cb-e335-4324-aa59-d4c68d94d868.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;imgdiv.InnerHtml = &amp;quot;&amp;lt;a href=''&amp;gt;  &amp;lt;img src='http://imshopping.rediff.com/shopping/homepix/rediff-popunder101_070808.gif ' /&amp;gt;  &amp;lt;/a&amp;gt;&amp;quot;;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/413641641" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/413641641/793c56cb-e335-4324-aa59-d4c68d94d868.aspx</link>
      <pubDate>Tue, 07 Oct 2008 09:14:17 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/793c56cb-e335-4324-aa59-d4c68d94d868.aspx</feedburner:origLink></item>
    <item>
      <title>SendKeys.Send("{TAB}") invalid</title>
      <description>Description: can not use "Sendkeys.Send" when run unikey&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/416f5d95-8674-47a9-b6e3-13a3935436f2.aspx'&gt;http://www.codekeep.net/snippets/416f5d95-8674-47a9-b6e3-13a3935436f2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;SendKeys.Send(&amp;quot;{TAB}&amp;quot;);&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/412581761" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/412581761/416f5d95-8674-47a9-b6e3-13a3935436f2.aspx</link>
      <pubDate>Mon, 06 Oct 2008 07:47:34 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/416f5d95-8674-47a9-b6e3-13a3935436f2.aspx</feedburner:origLink></item>
    <item>
      <title>Coverage Exclude attribute.</title>
      <description>Description: An attribute used to mark pieces of code that are to be excluded from test code coverage metric.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/fd777edd-471d-4aed-b362-76f6f14832c4.aspx'&gt;http://www.codekeep.net/snippets/fd777edd-471d-4aed-b362-76f6f14832c4.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System;

public enum Reason {
    GeneratedCode,
    Framework,
    Delegate,
    Humble
}

public class CoverageExcludeAttribute : Attribute {
    public CoverageExcludeAttribute(Reason reason) {}
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/410271994" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/410271994/fd777edd-471d-4aed-b362-76f6f14832c4.aspx</link>
      <pubDate>Fri, 03 Oct 2008 13:58:20 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/fd777edd-471d-4aed-b362-76f6f14832c4.aspx</feedburner:origLink></item>
    <item>
      <title>client - server validation</title>
      <description>Description: client - server validation&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/c643890b-bf29-411d-8de3-3ba3ecdb9172.aspx'&gt;http://www.codekeep.net/snippets/c643890b-bf29-411d-8de3-3ba3ecdb9172.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot;&amp;gt;
function clientvalidation(src, args)
{
      if (args.Value != &amp;quot;&amp;quot;)
            args.IsValid = true;
      else
            args.IsValid = false;
}
&amp;lt;/script&amp;gt;

-------------------
&amp;lt;asp:textbox ID=&amp;quot;textbox1&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;

&amp;lt;asp:CustomValidator ValidateEmptyText=&amp;quot;true&amp;quot; id=&amp;quot;valCustom&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;textbox1&amp;quot; ValidationGroup=&amp;quot;vg&amp;quot; ClientValidationFunction=&amp;quot;clientvalidation&amp;quot; OnServerValidate=&amp;quot;ServerValidate&amp;quot; ErrorMessage=&amp;quot;This box1 is not valid&amp;quot; Display=&amp;quot;Dynamic&amp;quot;&amp;gt;*&amp;lt;/asp:CustomValidator&amp;gt;

------------------

 protected void ServerValidate(object source, ServerValidateEventArgs args)
    {
        //   args.IsValid = (args.Value != null);

        //args.IsValid = (args.Value.Length &amp;gt;= 8);
        
        Response.Write(args.Value);

        if (args.Value != &amp;quot;&amp;quot;)
        {
            args.IsValid = true;
        }
        else
        {
            args.IsValid = false;
        }

    }
 protected void btn_click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Response.Redirect(&amp;quot;http://www.packingmaterials.com&amp;quot;);
        }
    }&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/408161004" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/408161004/c643890b-bf29-411d-8de3-3ba3ecdb9172.aspx</link>
      <pubDate>Wed, 01 Oct 2008 23:17:54 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/c643890b-bf29-411d-8de3-3ba3ecdb9172.aspx</feedburner:origLink></item>
    <item>
      <title>ConnectionString</title>
      <description>Description: Default connection String &lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/aa1e3b7a-3c10-44ad-ba58-6c2a4e9f4eed.aspx'&gt;http://www.codekeep.net/snippets/aa1e3b7a-3c10-44ad-ba58-6c2a4e9f4eed.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;public  static string __ConnectionString = &amp;quot;server=.;uid=sa;pwd=sapass; database=GulerMUhasebe&amp;quot;;&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/408390223" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/408390223/aa1e3b7a-3c10-44ad-ba58-6c2a4e9f4eed.aspx</link>
      <pubDate>Wed, 01 Oct 2008 16:28:08 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/aa1e3b7a-3c10-44ad-ba58-6c2a4e9f4eed.aspx</feedburner:origLink></item>
    <item>
      <title>DeepCode</title>
      <description>Description: Use to deep clone an object&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/bef5e8e3-afab-4a9f-ab8f-80084ff5a672.aspx'&gt;http://www.codekeep.net/snippets/bef5e8e3-afab-4a9f-ab8f-80084ff5a672.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;public class MyObject  : ICloneable {
    public object Clone()
    {
        return ObjectUtility.CloneObject(this);
    }
  
}
public static class ObjectUtility {
	public static object CloneObject(object obj)
	{
   	 using (MemoryStream memStream = new MemoryStream())
   	 {
   	     BinaryFormatter binaryFormatter = new BinaryFormatter(null, 
   	          new StreamingContext(StreamingContextStates.Clone));
   	     binaryFormatter.Serialize(memStream, obj);
  	      memStream.Seek(0, SeekOrigin.Begin);
     	   return binaryFormatter.Deserialize(memStream);
	    }
}
}
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/407047347" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/407047347/bef5e8e3-afab-4a9f-ab8f-80084ff5a672.aspx</link>
      <pubDate>Tue, 30 Sep 2008 07:57:43 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/bef5e8e3-afab-4a9f-ab8f-80084ff5a672.aspx</feedburner:origLink></item>
    <item>
      <title>SqlCommandBuilder</title>
      <description>Description: SqlCommandBuilder object to automatically generate the DeleteCommand, the InsertCommand, and the UpdateCommand properties of the SqlCommand object for a SqlDataAdapter object,&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/9a6c1dd3-76d0-4490-8fb4-3b8d149d91aa.aspx'&gt;http://www.codekeep.net/snippets/9a6c1dd3-76d0-4490-8fb4-3b8d149d91aa.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System.Data;
using System.Data.SqlClient;
using System;
namespace Q308507 {

  class Class1 {
     static void Main(string[] args)	{
  
        SqlConnection cn = new SqlConnection();
        DataSet CustomersDataSet = new DataSet();
        SqlDataAdapter da;
        SqlCommandBuilder cmdBuilder;
  
        //Set the connection string of the SqlConnection object to connect
        //to the SQL Server database in which you created the sample
        //table.
        cn.ConnectionString = &amp;quot;Server=server;Database=northwind;UID=login;PWD=password;&amp;quot;;

        cn.Open();      

        //Initialize the SqlDataAdapter object by specifying a Select command 
        //that retrieves data from the sample table.
        da = new SqlDataAdapter(&amp;quot;select * from CustTest order by CustId&amp;quot;, cn);

        //Initialize the SqlCommandBuilder object to automatically generate and initialize
        //the UpdateCommand, InsertCommand, and DeleteCommand properties of the SqlDataAdapter.
        cmdBuilder = new SqlCommandBuilder(da);

        //Populate the DataSet by running the Fill method of the SqlDataAdapter.
        da.Fill(CustomersDataSet, &amp;quot;Customers&amp;quot;);

        //Display the Update, Insert, and Delete commands that were automatically generated
        //by the SqlCommandBuilder object.
        Console.WriteLine(&amp;quot;Update command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetUpdateCommand().CommandText);
        Console.WriteLine(&amp;quot;         &amp;quot;);

        Console.WriteLine(&amp;quot;Insert command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetInsertCommand().CommandText);
        Console.WriteLine(&amp;quot;         &amp;quot;);        

        Console.WriteLine(&amp;quot;Delete command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetDeleteCommand().CommandText);
	Console.WriteLine(&amp;quot;         &amp;quot;);

        //Write out the value in the CustName field before updating the data using the DataSet.
        Console.WriteLine(&amp;quot;Customer Name before Update : &amp;quot; + CustomersDataSet.Tables[&amp;quot;Customers&amp;quot;].Rows[0][&amp;quot;CustName&amp;quot;]);

        //Modify the value of the CustName field.
        CustomersDataSet.Tables[&amp;quot;Customers&amp;quot;].Rows[0][&amp;quot;CustName&amp;quot;] = &amp;quot;Jack&amp;quot;;

        //Post the data modification to the database.
        da.Update(CustomersDataSet, &amp;quot;Customers&amp;quot;);        

        Console.WriteLine(&amp;quot;Customer Name updated successfully&amp;quot;);

        //Close the database connection.
        cn.Close();

        //Pause
        Console.ReadLine();
      }
   }

}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406828158" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406828158/9a6c1dd3-76d0-4490-8fb4-3b8d149d91aa.aspx</link>
      <pubDate>Tue, 30 Sep 2008 02:19:00 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/9a6c1dd3-76d0-4490-8fb4-3b8d149d91aa.aspx</feedburner:origLink></item>
    <item>
      <title>SqlCommandBuilder</title>
      <description>Description: SqlCommandBuilder object to automatically generate the DeleteCommand, the InsertCommand, and the UpdateCommand properties of the SqlCommand object for a SqlDataAdapter object,&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/a81002c8-495b-429f-b424-996322a7a05b.aspx'&gt;http://www.codekeep.net/snippets/a81002c8-495b-429f-b424-996322a7a05b.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System.Data;
using System.Data.SqlClient;
using System;
namespace Q308507 {

  class Class1 {
     static void Main(string[] args)	{
  
        SqlConnection cn = new SqlConnection();
        DataSet CustomersDataSet = new DataSet();
        SqlDataAdapter da;
        SqlCommandBuilder cmdBuilder;
  
        //Set the connection string of the SqlConnection object to connect
        //to the SQL Server database in which you created the sample
        //table.
        cn.ConnectionString = &amp;quot;Server=server;Database=northwind;UID=login;PWD=password;&amp;quot;;

        cn.Open();      

        //Initialize the SqlDataAdapter object by specifying a Select command 
        //that retrieves data from the sample table.
        da = new SqlDataAdapter(&amp;quot;select * from CustTest order by CustId&amp;quot;, cn);

        //Initialize the SqlCommandBuilder object to automatically generate and initialize
        //the UpdateCommand, InsertCommand, and DeleteCommand properties of the SqlDataAdapter.
        cmdBuilder = new SqlCommandBuilder(da);

        //Populate the DataSet by running the Fill method of the SqlDataAdapter.
        da.Fill(CustomersDataSet, &amp;quot;Customers&amp;quot;);

        //Display the Update, Insert, and Delete commands that were automatically generated
        //by the SqlCommandBuilder object.
        Console.WriteLine(&amp;quot;Update command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetUpdateCommand().CommandText);
        Console.WriteLine(&amp;quot;         &amp;quot;);

        Console.WriteLine(&amp;quot;Insert command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetInsertCommand().CommandText);
        Console.WriteLine(&amp;quot;         &amp;quot;);        

        Console.WriteLine(&amp;quot;Delete command Generated by the Command Builder : &amp;quot;);
        Console.WriteLine(&amp;quot;==================================================&amp;quot;);
        Console.WriteLine(cmdBuilder.GetDeleteCommand().CommandText);
	Console.WriteLine(&amp;quot;         &amp;quot;);

        //Write out the value in the CustName field before updating the data using the DataSet.
        Console.WriteLine(&amp;quot;Customer Name before Update : &amp;quot; + CustomersDataSet.Tables[&amp;quot;Customers&amp;quot;].Rows[0][&amp;quot;CustName&amp;quot;]);

        //Modify the value of the CustName field.
        CustomersDataSet.Tables[&amp;quot;Customers&amp;quot;].Rows[0][&amp;quot;CustName&amp;quot;] = &amp;quot;Jack&amp;quot;;

        //Post the data modification to the database.
        da.Update(CustomersDataSet, &amp;quot;Customers&amp;quot;);        

        Console.WriteLine(&amp;quot;Customer Name updated successfully&amp;quot;);

        //Close the database connection.
        cn.Close();

        //Pause
        Console.ReadLine();
      }
   }

}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406828159" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406828159/a81002c8-495b-429f-b424-996322a7a05b.aspx</link>
      <pubDate>Tue, 30 Sep 2008 02:18:37 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/a81002c8-495b-429f-b424-996322a7a05b.aspx</feedburner:origLink></item>
    <item>
      <title>start exe</title>
      <description>Description: start exe&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/9f355e19-1955-4874-87c7-656963978355.aspx'&gt;http://www.codekeep.net/snippets/9f355e19-1955-4874-87c7-656963978355.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;            Process notePad = new Process();

            notePad.StartInfo.FileName   = &amp;quot;notepad.exe&amp;quot;;
            notePad.StartInfo.Arguments = &amp;quot;ProcessStart.cs&amp;quot;;

            notePad.Start();&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406697832" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406697832/9f355e19-1955-4874-87c7-656963978355.aspx</link>
      <pubDate>Mon, 29 Sep 2008 23:00:08 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/9f355e19-1955-4874-87c7-656963978355.aspx</feedburner:origLink></item>
    <item>
      <title>open a document</title>
      <description>Description: open a document&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/1af1459d-0491-4b33-82b0-043e26fdb879.aspx'&gt;http://www.codekeep.net/snippets/1af1459d-0491-4b33-82b0-043e26fdb879.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;    System.Diagnostics.Process.Start(fileName);&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406697833" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406697833/1af1459d-0491-4b33-82b0-043e26fdb879.aspx</link>
      <pubDate>Mon, 29 Sep 2008 22:59:17 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/1af1459d-0491-4b33-82b0-043e26fdb879.aspx</feedburner:origLink></item>
    <item>
      <title>StringBuilder instantiation</title>
      <description>Description: Instantiates a StringBuilder and returns the result&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d0a474c9-6536-4579-9c76-9bde52606162.aspx'&gt;http://www.codekeep.net/snippets/d0a474c9-6536-4579-9c76-9bde52606162.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;StringBuilder sb = new StringBuilder();

return sb.ToString();
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406285434" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406285434/d0a474c9-6536-4579-9c76-9bde52606162.aspx</link>
      <pubDate>Mon, 29 Sep 2008 13:54:53 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d0a474c9-6536-4579-9c76-9bde52606162.aspx</feedburner:origLink></item>
    <item>
      <title> How to Get Window NT Logged User Name Using ASP.NET</title>
      <description>Description: 
How to Get Window NT Logged User Name Using ASP.NET&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/24ed5597-f3d1-4022-a9ca-af4a20f5eac2.aspx'&gt;http://www.codekeep.net/snippets/24ed5597-f3d1-4022-a9ca-af4a20f5eac2.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;1) System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;

string strName = p.Identity.Name;

[ OR ]

2) string strName = HttpContext.Current.User.Identity.Name.ToString();

[ OR ]

3) string strName = Request.ServerVariables[&amp;quot;AUTH_USER&amp;quot;]; //Finding with name

string strName = Request.ServerVariables[5]; //Finding with index&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/406008573" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/406008573/24ed5597-f3d1-4022-a9ca-af4a20f5eac2.aspx</link>
      <pubDate>Mon, 29 Sep 2008 06:37:23 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/24ed5597-f3d1-4022-a9ca-af4a20f5eac2.aspx</feedburner:origLink></item>
    <item>
      <title>Get current windows user - username</title>
      <description>Description: Get current windows user - username&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/47a962c3-eaa1-419f-b2be-7298b69947be.aspx'&gt;http://www.codekeep.net/snippets/47a962c3-eaa1-419f-b2be-7298b69947be.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System.Security.Principal;

namespace ConsoleApplicationWindowsUser
{
    class Program
    {
        static void Main(string[] args)
        {
            string a;
            a = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();

            Console.WriteLine(a);
            Console.Read();
        }
    }
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/405999940" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/405999940/47a962c3-eaa1-419f-b2be-7298b69947be.aspx</link>
      <pubDate>Mon, 29 Sep 2008 06:32:12 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/47a962c3-eaa1-419f-b2be-7298b69947be.aspx</feedburner:origLink></item>
    <item>
      <title>Tokenizer with delimeters</title>
      <description>Description: tokenizer with delimeters&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/cb1142ef-cf37-4f95-b328-7bea2723ac9a.aspx'&gt;http://www.codekeep.net/snippets/cb1142ef-cf37-4f95-b328-7bea2723ac9a.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;using System;
using System.Text.RegularExpressions;
 
public static string[] Tokenize(string equation)
{
   Regex RE = new Regex(@&amp;quot;([\+\-\*\(\)\^\\])&amp;quot;);
   return (RE.Split(equation));
}

public void TestTokenize( )
{
   foreach(string token in Tokenize(&amp;quot;(y - 3)(3111*x^21 + x + 320)&amp;quot;))
      Console.WriteLine(&amp;quot;String token = &amp;quot; + token.Trim( ));
}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/405472449" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/405472449/cb1142ef-cf37-4f95-b328-7bea2723ac9a.aspx</link>
      <pubDate>Sun, 28 Sep 2008 14:52:32 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/cb1142ef-cf37-4f95-b328-7bea2723ac9a.aspx</feedburner:origLink></item>
    <item>
      <title>string to Color convertion</title>
      <description>Description: string to Color convertion&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/d8cfe6ef-6dd0-4534-8170-216a84ec3aeb.aspx'&gt;http://www.codekeep.net/snippets/d8cfe6ef-6dd0-4534-8170-216a84ec3aeb.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;            System.Drawing.ColorConverter ccv = new System.Drawing.ColorConverter();
            return (Color)ccv.ConvertFromString(color); 
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/405117174" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/405117174/d8cfe6ef-6dd0-4534-8170-216a84ec3aeb.aspx</link>
      <pubDate>Sun, 28 Sep 2008 02:26:40 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/d8cfe6ef-6dd0-4534-8170-216a84ec3aeb.aspx</feedburner:origLink></item>
    <item>
      <title>How to create custom error reporting in ASP.NET (C#)</title>
      <description>Description: This sample shows how to use Visual C# .NET code to trap and respond to errors when they occur in ASP.NET, using Page_Error  and Application_Error.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/b42334d2-afe6-4c53-a62a-6fba533a8739.aspx'&gt;http://www.codekeep.net/snippets/b42334d2-afe6-4c53-a62a-6fba533a8739.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;How to use the Page_Error method:
public void Page_Error(object sender,EventArgs e)
{
	Exception objErr = Server.GetLastError().GetBaseException();
	string err =	&amp;quot;&amp;lt;b&amp;gt;Error Caught in Page_Error event&amp;lt;/b&amp;gt;&amp;lt;hr&amp;gt;&amp;lt;br&amp;gt;&amp;quot; + 
			&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Error in: &amp;lt;/b&amp;gt;&amp;quot; + Request.Url.ToString() +
			&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Error Message: &amp;lt;/b&amp;gt;&amp;quot; + objErr.Message.ToString()+
			&amp;quot;&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Stack Trace:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&amp;quot; + 
	                  objErr.StackTrace.ToString();
	Response.Write(err.ToString());
	Server.ClearError();
}

How to use the Application_Error method (Global.asax):
protected void Application_Error(object sender, EventArgs e)
{
	Exception objErr = Server.GetLastError().GetBaseException();
	string err =	&amp;quot;Error Caught in Application_Error event\n&amp;quot; +
			&amp;quot;Error in: &amp;quot; + Request.Url.ToString() +
			&amp;quot;\nError Message:&amp;quot; + objErr.Message.ToString()+ 
			&amp;quot;\nStack Trace:&amp;quot; + objErr.StackTrace.ToString();
	EventLog.WriteEntry(&amp;quot;Sample_WebApp&amp;quot;,err,EventLogEntryType.Error);
	Server.ClearError();
	//additional actions...
} 
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/403140698" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/403140698/b42334d2-afe6-4c53-a62a-6fba533a8739.aspx</link>
      <pubDate>Thu, 25 Sep 2008 20:47:08 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/b42334d2-afe6-4c53-a62a-6fba533a8739.aspx</feedburner:origLink></item>
    <item>
      <title>Sting IsIP Extension (C# 3.0)</title>
      <description>Description: When put into a static class, extends the string class to include an IsIP function.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/28224f54-4eb9-4f74-b4ab-bab629f52390.aspx'&gt;http://www.codekeep.net/snippets/28224f54-4eb9-4f74-b4ab-bab629f52390.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;public static bool IsIP( this string strIPAddressField )
{
	return regIP.IsMatch( strIPAddressField );
}

private static Regex regIP = new Regex(@&amp;quot;(?&amp;lt;First&amp;gt;  2[0-4]\d | 25[0-5] | [01]?\d\d? )\.
                                         (?&amp;lt;Second&amp;gt; 2[0-4]\d | 25[0-5] | [01]?\d\d? )\.
                                         (?&amp;lt;Third&amp;gt;  2[0-4]\d | 25[0-5] | [01]?\d\d? )\.
                                         (?&amp;lt;Fourth&amp;gt; 2[0-4]\d | 25[0-5] | [01]?\d\d? )&amp;quot;,
		            RegexOptions.IgnoreCase | 
		            RegexOptions.CultureInvariant |
		            RegexOptions.IgnorePatternWhitespace |
		            RegexOptions.Compiled
		            );&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/403041864" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/403041864/28224f54-4eb9-4f74-b4ab-bab629f52390.aspx</link>
      <pubDate>Thu, 25 Sep 2008 18:34:59 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/28224f54-4eb9-4f74-b4ab-bab629f52390.aspx</feedburner:origLink></item>
    <item>
      <title>Log an Error to Event Viewer</title>
      <description>Description: Log an Error to Event Viewer&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/725edbe3-b354-4419-bd41-95e2a9beabf6.aspx'&gt;http://www.codekeep.net/snippets/725edbe3-b354-4419-bd41-95e2a9beabf6.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;
EventLog.WriteEntry(&amp;quot;Your category&amp;quot;, &amp;quot;Your error message&amp;quot;, EventLogEntryType.Error);&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/401807594" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/401807594/725edbe3-b354-4419-bd41-95e2a9beabf6.aspx</link>
      <pubDate>Wed, 24 Sep 2008 13:32:15 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/725edbe3-b354-4419-bd41-95e2a9beabf6.aspx</feedburner:origLink></item>
    <item>
      <title>Class Regions</title>
      <description>Description: Empty regions for a new class&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/12aadb9c-ad4d-4126-b17e-5d21cf386482.aspx'&gt;http://www.codekeep.net/snippets/12aadb9c-ad4d-4126-b17e-5d21cf386482.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;        #region Fields

        #endregion

        #region Constructors

        #endregion

        #region Properties

        #endregion

        #region Methods

        #endregion&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/400725685" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/400725685/12aadb9c-ad4d-4126-b17e-5d21cf386482.aspx</link>
      <pubDate>Tue, 23 Sep 2008 11:45:00 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/12aadb9c-ad4d-4126-b17e-5d21cf386482.aspx</feedburner:origLink></item>
    <item>
      <title>To Check weather typed text in combobox exists in combobox members.</title>
      <description>Description: To Check weather typed text in combobox exists in combobox members.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/aae33d50-d779-49e2-b747-1cb43761cb65.aspx'&gt;http://www.codekeep.net/snippets/aae33d50-d779-49e2-b747-1cb43761cb65.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;  let combobox name is &amp;quot;cmbcity&amp;quot;
------------------------------------ 

int index = cmbcity.FindStringExact(cmbcity.Text);
                    if (index &amp;gt;= 0)
                    {
                        MessageBox.Show(&amp;quot;City already exists in dropdownlist.&amp;quot;);
                       
                    }&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/400620510" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/400620510/aae33d50-d779-49e2-b747-1cb43761cb65.aspx</link>
      <pubDate>Tue, 23 Sep 2008 08:54:36 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/aae33d50-d779-49e2-b747-1cb43761cb65.aspx</feedburner:origLink></item>
    <item>
      <title>Scurve forecast calculation</title>
      <description>Description: If you need to calculate the percentage for a Scurve, this function will do it for you.
Input parameters - The actual period
                                - Number of periods 
	             - The percentage to be used. (ie 25%, 45% etc) 
&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/7901a587-1c49-4ca1-b043-1f0212c07619.aspx'&gt;http://www.codekeep.net/snippets/7901a587-1c49-4ca1-b043-1f0212c07619.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;        public static double DeterminePercentage(double Period, double NumberOfPeriods, int RPercentage)
        {
            switch (RPercentage)
            {
                case 25: //25%
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period*10.0/NumberOfPeriods==10.0)
                        return 100;

                    return  -0.524475524475441 + (8.91608391608395 * (Period * 10 / NumberOfPeriods)) - 
                            (4.23193473193476 *  Math.Pow((Period * 10 / NumberOfPeriods), 2)) + 
                            (0.970862470862476 * Math.Pow((Period*10/NumberOfPeriods),3)) -                                                                                                                                                                                                                                                                                                                                                                         
                            (0.0536130536130539* Math.Pow((Period*10/NumberOfPeriods),4));

                case 35: //35%
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period * 10.0 / NumberOfPeriods == 10.0)
                        return 100;

                    return 0.104895104895199 + 6.35722610722612*(Period * 10 / NumberOfPeriods) - 
                           2.19201631701633 * Math.Pow((Period*10/NumberOfPeriods),2) + 
                           0.666083916083919* Math.Pow(( Period * 10/NumberOfPeriods),3) - 
                           0.0410839160839162*Math.Pow((Period * 10/ NumberOfPeriods),4);

                case 45: //45%
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period * 10.0 / NumberOfPeriods == 10.0)
                        return 100;

                    return 0.769230769230784 + 4.05244755244754*(Period *10/NumberOfPeriods)+ 
                           0.403846153846159*Math.Pow((Period*10/NumberOfPeriods),2) +
                           0.22144522144522*Math.Pow((Period*10/24),3)-
                           0.0203962703962703*Math.Pow((Period*10/NumberOfPeriods),4);
                case 55: //55%
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period * 10.0 / NumberOfPeriods == 10.0)
                        return 100;

                    return 0.94405594405594 + 4.25602175602171*(Period*10/NumberOfPeriods)+ 
                           1.81351981351983*Math.Pow((Period*10/NumberOfPeriods),2)-
                           0.0788655788655822*Math.Pow((Period*10/NumberOfPeriods),3) -
                           0.00466200466200449*Math.Pow((Period*10/NumberOfPeriods),4);
                case 65: //65%
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period * 10.0 / NumberOfPeriods == 10.0)
                        return 100;

                    return 1.08391608391604 + 3.95979020979014*(Period*10/NumberOfPeriods) +
                           3.80681818181822*Math.Pow((Period*10/NumberOfPeriods), 2) -
                           0.505244755244762*Math.Pow((Period*10/NumberOfPeriods), 3) +
                           0.0183566433566437*Math.Pow((Period*10/NumberOfPeriods), 4);

                case 99: //SL
                    if (Period * 10.0 / NumberOfPeriods == 0.0)
                        return 0.0;

                    if (Period * 10.0 / NumberOfPeriods == 10.0)
                        return 100;

                    return 10*(Period*10/NumberOfPeriods);
            }

            return 0;
        }
&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/400468751" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/400468751/7901a587-1c49-4ca1-b043-1f0212c07619.aspx</link>
      <pubDate>Tue, 23 Sep 2008 04:56:07 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/7901a587-1c49-4ca1-b043-1f0212c07619.aspx</feedburner:origLink></item>
    <item>
      <title>Remove an item from an ArrayList</title>
      <description>Description: If you want to remove an array item, this routine will do it for you.&lt;br /&gt;&lt;br /&gt;Link: &lt;a href='http://www.codekeep.net/snippets/eb9a18c1-b9b9-4ef9-a064-9b5b0bcc426c.aspx'&gt;http://www.codekeep.net/snippets/eb9a18c1-b9b9-4ef9-a064-9b5b0bcc426c.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style='font-size: 9pt;'&gt;int count = myArrayList.Count;
for(int i=0; i&amp;lt;count;)
{
        myArrayListItem item = (myArrayListItem)myArrayList[i];
        if (myArrayListItem.MyPropery &amp;gt; someValue)
        {
                myArrayList.RemoveAt(i);
                count--;
        } else {
                i++;
        }

}&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/CodeKeepCSharp/~4/400458500" height="1" width="1"/&gt;</description>
      <link>http://feeds.feedburner.com/~r/CodeKeepCSharp/~3/400458500/eb9a18c1-b9b9-4ef9-a064-9b5b0bcc426c.aspx</link>
      <pubDate>Tue, 23 Sep 2008 04:48:26 GMT</pubDate>
    <feedburner:origLink>http://www.codekeep.net/snippets/eb9a18c1-b9b9-4ef9-a064-9b5b0bcc426c.aspx</feedburner:origLink></item>
  </channel>
</rss>
