<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WhyPad &#187; c#</title>
	<atom:link href="http://www.whypad.com/tag/c-sharp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whypad.com</link>
	<description>Tips, tricks, and hacks for life and tech...</description>
	<lastBuildDate>Tue, 06 Jul 2010 15:21:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>C# &#8211; Convert String Array to a List (.Net 2.0)</title>
		<link>http://www.whypad.com/posts/c-convert-string-array-to-a-list-net-20/674/</link>
		<comments>http://www.whypad.com/posts/c-convert-string-array-to-a-list-net-20/674/#comments</comments>
		<pubDate>Tue, 19 May 2009 15:48:13 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=674</guid>
		<description><![CDATA[So you&#8217;ve got a C# string and you want to convert it to a List&#60;string&#62;.  Lists are one of the most efficient ways of storing&#8230;well&#8230;lists of things in .Net.  If you&#8217;re in .Net 3.0, it&#8217;s quite easy to go from a string array to a list by using the .ToList() function. If you&#8217;re stuck in .Net [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.whypad.com/wp-content/uploads/logo.png"><img class="alignleft size-full wp-image-451" title="ASP.net" src="http://www.whypad.com/wp-content/uploads/logo.png" alt="ASP.net" width="108" height="44" /></a>So you&#8217;ve got a C# string and you want to convert it to a List&lt;string&gt;.  Lists are one of the most efficient ways of storing&#8230;well&#8230;lists of things in .Net.  If you&#8217;re in .Net 3.0, it&#8217;s quite easy to go from a string array to a list by using the .ToList() function.</p>
<p><span id="more-674"></span></p>
<p>If you&#8217;re stuck in .Net 2.0 because your company won&#8217;t put 3.0 or higher on the servers, then going from a string (particularly one that is delimited with something you can split on) to a List is a little longer, but not much.</p>
<p>Here&#8217;s the code:</p>
<pre class="brush: csharp;">

List&lt;string&gt; myVar = new List&lt;string&gt;(myString.Split('|'));
</pre>
<p>Note that the &#8216;|&#8217; is the delimiter in your string that you can split on to get an array.  Simple enough.</p>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=674&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/c-convert-string-array-to-a-list-net-20/674/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get ASP.NET DropDownList Selected Value with jQuery</title>
		<link>http://www.whypad.com/posts/get-aspnet-server-dropdownlist-selected-value-with-jquery/418/</link>
		<comments>http://www.whypad.com/posts/get-aspnet-server-dropdownlist-selected-value-with-jquery/418/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 22:19:00 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=418</guid>
		<description><![CDATA[With Microsoft&#8217;s recent announcement that they will begin shipping jQuery with Visual Studio, the little Javascript framework is about to hit the big time (it was already sort of big time, but this is BIG TIME).  And rightfully so. I have been a Prototype and Scriptaculous user for over a year now.  But I am [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-419" title="aspnetjquery" src="http://www.whypad.com/wp-content/uploads/aspnetjquery.gif" alt="" width="138" height="66" />With Microsoft&#8217;s <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">recent announcement </a>that they will begin shipping jQuery with Visual Studio, the little Javascript framework is about to hit the big time (it was already sort of big time, but this is BIG TIME).  And rightfully so.</p>
<p><span id="more-418"></span></p>
<p>I have been a Prototype and Scriptaculous user for over a year now.  But I am starting the transition over to jQuery, and am loving what I see.  The learning curve is easy if you&#8217;re coming in from one of the other frameworks, so don&#8217;t sweat it.</p>
<p>If you&#8217;re an ASP.net programmer and you use server controls, then you know that ASP changes the control ID into something that the server will be able to understand on postbacks.  This makes it a little tricky to reference these controls with Javascript on the client.</p>
<h2>The ASP Trick</h2>
<p><img class="alignleft size-full wp-image-420" title="ddlcycles" src="http://www.whypad.com/wp-content/uploads/ddlcycles.gif" alt="" width="142" height="78" />Well, here&#8217;s a neat little trick that I picked up on one of the forums that will allow you to get the value of an ASP.net dropdownlist using jQuery.  Place the following Javascript function at the bottom of your .aspx file.  I think you&#8217;ll need to have it after your DropDownList to insure that it works properly.</p>
<pre class="brush: jscript;">&lt;script type=&quot;text/javascript&quot;&gt;
        function getDropDownList1Value()
        {
            var SelectedVal = $('#&lt; %=&lt;strong&gt;DropDownList1.ClientID %&gt;').val();
            return SelectedVal;
        }
&lt;/script&gt;</pre>
<p>The jQuery part of this function is shown in blue here:  <span style="color: #0000ff;"><strong>$(&#8216;#</strong></span><span style="color: #ff0000;">&lt;%=DropDownList1.ClientID %&gt;</span><strong><span style="color: #0000ff;">&#8216;).val()</span> </strong></p>
<p>The real magic is the red part.  This is ASP code that will be processed on the server to write the control&#8217;s Client ID into the function.  Given such a small amount of jQuery, you could easily pull out the jQuery code and use it with other frameworks or plain old JScript as well.  The key after all, is getting your Javascript to know what the control&#8217;s DOM ID is.</p>
<p>Using the function is as simple as:</p>
<p>var myValue = getDropDownList1Value();</p>
<p>This could, of course, be used with any ASP.net server control for other purposes as well.</p>
<h2>A jQuery Alternative: The CSS Class Selector</h2>
<p>Another alternative with jQuery, would be to assign a css class to the control and use that class as your selector.  Here&#8217;s a jQuery example to select on a css class called mydropdown:</p>
<p>$(&#8216;.mydropdown&#8217;).val();</p>
<p>Just assign the mydropdown class to your ASP control in Visual Studio and jQuery will find your control.  But be careful&#8230;jQuery will find every control that has that class, so give a unique class to each control you want to try this with.</p>
<p>Hope that helps.</p>
<p>Cheers!<br />
Byron</p>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=418&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/get-aspnet-server-dropdownlist-selected-value-with-jquery/418/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C# &#8211; Get a Random Number Between x and y</title>
		<link>http://www.whypad.com/posts/csharp-get-a-random-number-between-x-and-y/412/</link>
		<comments>http://www.whypad.com/posts/csharp-get-a-random-number-between-x-and-y/412/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 17:37:30 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=412</guid>
		<description><![CDATA[Here&#8217;s a quick function for getting random numbers in C#: Random rnd = new Random(); protected int GetRandomInt(int min, int max) { return rnd.Next(min,max); } int myInt = GetRandomInt(5, 1000); //gives in random integer between 5 &#38; 1000 Notice that you have to declare your instance of the Random class outside of the GetRandomInt function if [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick function for getting random numbers in C#:</p>
<pre class="brush: csharp;">    Random rnd = new Random();
    protected int GetRandomInt(int min, int max)
    {
        return rnd.Next(min,max);
    }

    int myInt = GetRandomInt(5, 1000); //gives in random integer between 5 &amp; 1000</pre>
<p><strong><img class="alignleft size-medium wp-image-413" title="random_right" src="http://www.whypad.com/wp-content/uploads/random_right.gif" alt="" width="287" height="191" />Notice that you have to declare your instance of the Random class outside of the GetRandomInt function if you are going to be running this in a loop. </strong></p>
<p><span id="more-412"></span></p>
<p>&#8220;Why is this?&#8221; you ask.</p>
<p>Well, the Random class actually generates pseudo random numbers, with the &#8220;seed&#8221; for the randomizer being the system time. If your loop is sufficiently fast, the system clock time will not appear different to the randomizer and each new instance of the Random class would start off with the same seed and give you the same pseudo random number.</p>
<p><img class="alignleft size-medium wp-image-414" title="random_wrong" src="http://www.whypad.com/wp-content/uploads/random_wrong.gif" alt="" width="286" height="191" />I tried the function with Random rnd = new Random() inside the GetRandomInt function and ran it through a loop that had 150 iterations and several additional calculations.   I got the same random number 10-20 times before it would switch (see the image with all the 8&#8242;s highlighted).</p>
<p>Using the same instance of the Random class lets its Next() function take into account previously returned numbers, and you get some mostly random numbers <img src='http://www.whypad.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .</p>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=412&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/csharp-get-a-random-number-between-x-and-y/412/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP.NET &#8211; C# &#8211; Emulating the VB Control Array &#8211; Pt. 1</title>
		<link>http://www.whypad.com/posts/aspnet-emulating-control-array/388/</link>
		<comments>http://www.whypad.com/posts/aspnet-emulating-control-array/388/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 18:25:05 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=388</guid>
		<description><![CDATA[For you veterans of VB6, the control array probably became an old friend, or at least an annoying neighbor if you didn&#8217;t like them.  You couldn&#8217;t help run across the concept in VB6 because every time you copy and pasted a control for the first time, you got asked if you wanted to create a control array. If [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-389" href="http://www.whypad.com/posts/aspnet-emulating-control-array/388/vb6controlarray/"><img class="alignleft size-full wp-image-389" title="vb6controlarray" src="http://www.whypad.com/wp-content/uploads/vb6controlarray.gif" alt="" width="222" height="187" /></a>For you veterans of VB6, the control array probably became an old friend, or at least an annoying neighbor if you didn&#8217;t like them.  You couldn&#8217;t help run across the concept in VB6 because every time you copy and pasted a control for the first time, you got asked if you wanted to create a control array.</p>
<p><span id="more-388"></span></p>
<p>If you say yes, VB creates an array for you with the same name and type as the control you copied and begins assigning values to the index property of the original and all new copies.  Keep pasting and the array just grows.  You reference individual instances of the control like:  myControl[0].Text for first instnace, myControl[1].text for second instance, and so on.</p>
<p>But now you&#8217;ve made the switch to C#, or if you just couldn&#8217;t let it go, hopefully to VB.Net, and you&#8217;re wondering what the heck happened to the control arrays.  Well, the short answer is, they&#8217;re gone!  The control array of yore was great if you needed a bunch of textboxes, radio buttons, or checkboxes that you would run through a For Each or For Next loop.  That need hasn&#8217;t magically gone away, so what&#8217;s a developer to do?</p>
<p>This article will discuss how to emulate a control array or an array of html form elements in <strong>ASP.Net</strong> using C# code.  Translating to VB.Net should be relatively painless once you catch the drift.</p>
<h2>Server Controls vs. HTML Form Elements</h2>
<p>First, it bears remembering that in ASP.NET, you get to choose between Server Controls like the TextBox (aka <span style="font-family: Courier New;">System.Web.UI.WebControls.TextBox) and straight up HTML tags like &lt;INPUT type=&#8221;text&#8221; name=&#8221;element_name&#8221; value=&#8221;" /&gt;</span>.  Both of these can be used like a control array, but the methods are little different.</p>
<p>Lets look at the Server Control first&#8230;</p>
<h2>Emulating Control Arrays with Server Controls</h2>
<p>Before I jump into an example, here&#8217;s a rundown of the basic steps for emulating a Control Array with Server Controls:</p>
<ol>
<li>Create your controls that you want to target&#8230;give them IDs that start with a similar prefix</li>
<li>Add your controls to a PlaceHolder control or some other object that has a controls collection.  This allows you to utilize the Controls Collection for easy looping</li>
<li>Set up your function ForEach loop utilizing said Controls Collection of the parent</li>
</ol>
<h3>Jumping Right In</h3>
<p>The first thing you need to do is get your controls created on your Web Form.  You can manually create your controls at design time, dragging and dropping from the Visual Studio toolbox into your form.  Or, you can create the controls at runtime.</p>
<p>The design time creation is blindingly straight forward, so we won&#8217;t go into that, and will do a quick example of runtime creation instead.  In this example, we&#8217;ll create 12 textboxes (1 for each month):</p>
<h3>Start with a PlaceHolder</h3>
<p><img class="alignright size-full wp-image-392" title="placeholder" src="http://www.whypad.com/wp-content/uploads/placeholder.gif" alt="" width="133" height="191" />You need some means of placing your controls with some level of precision in your form.  ASP.Net provides the PlaceHolder control to which you can .Add controls.  So drag a PlaceHolder from the toolbox to the place in your document where you want your textboxes to go.  It gets a name like PlaceHolder1.</p>
<h3>Function for Creating/Adding Controls</h3>
<p>If you&#8217;re creating a whole bunch of similar controls, hopefully you&#8217;ve got a list, a datatable, or an array to loop through, else your code will be slightly more lengthy.  Here&#8217;s a simple For loop that will create the 12 textboxes for the months.  Note that it uses a little string formatting to pop the month name in the newly created textboxes.  SteveX has a super helpful <a href="http://blog.stevex.net/index.php/string-formatting-in-csharp/">reference </a> and <a href="http://blog.stevex.net/index.php/2007/09/28/string-formatting-faq/">FAQ </a>for string formatting.  Thanks, Steve!<br />
protected void addMonthTextBoxes()<br />
{<br />
//Set up the for loop<br />
for (int i = 1; i < 13; i++)<br />
{<br />
TextBox tt = new TextBox();<br />
//   Note that we are prefixing our ID with something that is smiliar<br />
tt.ID = "month" + i;<br />
tt.Text = string.Format("{0:MMMM}", DateTime.Parse( i + "/1/2008"));<br />
PlaceHolder1.Controls.Add(tt);<br />
}<br />
}<br />
Call your function from the Page_Load function, and upon execution, you should have 12 textboxes with the Month names in them.<br />
<quot></p>
<h3>Setting up a Button and a Handler Function</h3>
<p>Now that you&#8217;ve got your textboxes going, drag a button onto your Web Form and double click it to get to the codebehind function that will handle it.  Inside the button&#8217;s click function, use the following code to loop through the Controls Collection of the PlaceHolder you created.  Note that most, if not all, server controls will have a Controls Collection that you can access and do a ForEach loop on.  Here&#8217;s the code:</p>
<p>protected void btnRefresh_Click(object sender, EventArgs e)<br />
{<br />
foreach (Control c in PlaceHolder1.Controls){<br />
//In this case, we&#8217;re only looking for TextBox controls&#8230;use GetType() to test it<br />
if (c.GetType().ToString().Equals(&#8220;System.Web.UI.WebControls.TextBox&#8221;)){// We look at the Control&#8217;s ID to see if it starts with the our unique prefix<br />
if (c.ID.StartsWith(&#8220;month&#8221;)){</p>
<p>/*<br />
Note that we don&#8217;t have an index or even the good old Tag<br />
VB6.  One way to emulate those properties is to use the &#8220;suffix&#8221; of your ID.<br />
In this case, we used the Month #.  So, parsing the ID string by stripping<br />
off &#8216;month&#8217; would leave us with the month #.  And we can use as needed.<br />
*/  property from</p>
<p>//We have to cast the control as a textbox to use it<br />
TextBox tb = (TextBox)c;<br />
//Do something with &#8216;tb&#8217;, the text box we found.. e.g.  tb.Text = &#8220;Hello &#8221; + tb.Text<br />
}<br />
}<br />
}<br />
}</p>
<p>Notice that the key is being able to loop through the PlaceHolder&#8217;s Controls Collection.  You could loop through the Controls Collection of any control on your form.  Even the Form itself like so:</p>
<p>foreach ( Control c in Form.Controls){ &#8230;. }</p>
<p>This foreach only gets the immediate child controls of the Form object.  If you do not know the particular parent or parents of your target controls, you will need to use a recursive function that walks through the Children of each control on the form.  Not the most efficient means of processing, but it works.</p>
<h3>See Part 2 for Using HTML Form Elements like Control Arrays</h3>
<p>That&#8217;s it for emulating control arrays with ASP.Net Server Controls.  I&#8217;m sure there&#8217;s much more that could be written, but that&#8217;s all I&#8217;ve got in me today.  Demonstrating the recursive function that walks all the children of the Form object would be a good start&#8230;maybe later.</p>
<p>Part 2 of this post will show how to use a straight up html form element, ie INPUT tags that don&#8217;t runat server, as arrays.  For those of you with PHP background, you know how nice PHP is to place those for you in an Array through $_REQUEST, $_GET, and $_POST.  We&#8217;ll see how we can do that in ASP.Net.  Hopefully I&#8217;ll get that done in the near, near future.</p>
<p>Cheers!</p>
<p>Byron</p>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=388&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/aspnet-emulating-control-array/388/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>C#: Convert Double to Integer&#8230;and other conversions</title>
		<link>http://www.whypad.com/posts/c-convert-double-to-integerand-other-conversions/279/</link>
		<comments>http://www.whypad.com/posts/c-convert-double-to-integerand-other-conversions/279/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 02:47:45 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=279</guid>
		<description><![CDATA[Type conversions and casting in C# are so whack!  Microsoft created the System.Convert class to bring some sanity and predictability to converting from one type to another in C#.  Without further ado, to convert a Double to an Integer, you can use:   int myInt = System.Convert.ToInt32(myDouble); The System.Convert class has the following methods: ToBoolean ToByte [...]]]></description>
			<content:encoded><![CDATA[<p>Type conversions and casting in C# are so whack!  Microsoft created the System.Convert class to bring some sanity and predictability to converting from one type to another in C#.  Without further ado, to convert a Double to an Integer, you can use:   int myInt = System.Convert.ToInt32(myDouble);</p>
<p>The System.Convert class has the following methods:<span id="more-279"></span></p>
<ul>
<li>ToBoolean</li>
<li>ToByte</li>
<li>ToChar</li>
<li>ToDateTime</li>
<li>ToDecimal</li>
<li>ToDouble</li>
<li>ToInt16</li>
<li>ToInt32</li>
<li>ToInt64</li>
<li>ToSingle</li>
<li>ToString</li>
<li>and some more&#8230;.</li>
</ul>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=279&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/c-convert-double-to-integerand-other-conversions/279/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net C# &#8211; PHP  Equivalents</title>
		<link>http://www.whypad.com/posts/aspnet-c-sharp-php-equivalents/263/</link>
		<comments>http://www.whypad.com/posts/aspnet-c-sharp-php-equivalents/263/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:05:36 +0000</pubDate>
		<dc:creator>Byron Bennett</dc:creator>
				<category><![CDATA[ASP.NET/C#]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.whypad.com/?p=263</guid>
		<description><![CDATA[On this post, I will be collecting ASP.NET C# commands that I use frequently in PHP but I have to continually look up in the little bit of ASP.NET that I do.  PHP can be frustrating for its inconsistencies in syntax, but what is even more frustrating is when you&#8217;re trying to do something in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-451" title="ASP.net" src="http://www.whypad.com/wp-content/uploads/logo.png" alt="ASP.net" width="108" height="44" /><img class="alignnone size-full wp-image-450" title="php_snow_2008" src="http://www.whypad.com/wp-content/uploads/php_snow_2008.gif" alt="php_snow_2008" width="120" height="64" /></p>
<p><span id="more-263"></span></p>
<p>On this post, I will be collecting ASP.NET C# commands that I use frequently in PHP but I have to continually look up in the little bit of ASP.NET that I do.  PHP can be frustrating for its inconsistencies in syntax, but what is even more frustrating is when you&#8217;re trying to do something in C# and you&#8217;re trying to remember whether the common sense syntax is in PHP or C#&#8230;This tries to be a cheat sheet for those for me:</p>
<table border="2" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td width="50%"><strong>PHP</strong></td>
<td width="50%"><strong>ASP.net</strong></td>
</tr>
<tr>
<td>echo &#8216;string&#8217;;</td>
<td>Response.Write(&#8220;the_text_goes_here&#8221;);</td>
</tr>
<tr>
<td>$_REQUEST['parameter_name'];</td>
<td>Request.QueryString["parameter_name"];</td>
</tr>
<tr>
<td>urlencode( <em>string</em> );</td>
<td>Server.UrlEncode( <em>string</em> );</td>
</tr>
<tr>
<td><strong>Convert unix timestamp:</strong>date(&#8220;m.d.y&#8221;, $timestamp);</td>
<td>public static System.DateTime UnixToDotNet(int unixTimestamp)<br />
{<br />
System.DateTime date = System.DateTime.Parse(&#8220;1/1/1970&#8243;);<br />
return date.AddSeconds(unixTimestamp);<br />
}</td>
</tr>
<tr>
<td><strong>Connection string:</strong><br />
mysql_connect([string $server [,string $username [, string $password [,bool $new_link [, int $client_flags ]]]]] )</td>
<td><strong>Code for using conn string in Web.config:</strong></p>
<pre class="csharpcode"><span class="kwrd">string</span> dbConn = System.Configuration.ConfigurationManager.ConnectionStrings[<span class="str">"QueryStringName"</span>].ToString();</pre>
</td>
</tr>
</tbody>
</table>
<img src="http://www.whypad.com/?ak_action=api_record_view&id=263&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.whypad.com/posts/aspnet-c-sharp-php-equivalents/263/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
