<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Comparing String to Integer Conversion Methods in VB.NET</title>
	<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/</link>
	<description>Articles on VB.NET and Software Development Team Leadership</description>
	<pubDate>Wed, 20 Aug 2008 11:47:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Hax Or</title>
		<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-1142</link>
		<author>Hax Or</author>
		<pubDate>Mon, 23 Jun 2008 19:31:08 +0000</pubDate>
		<guid>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-1142</guid>
		<description>Don't they teach you anything over there, Chandrashekhar?  Try experts exchange if you need help.

This blog article is for experienced programmers who want to know the 'best rating' for converting strings to integers.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t they teach you anything over there, Chandrashekhar?  Try experts exchange if you need help.</p>
<p>This blog article is for experienced programmers who want to know the &#8216;best rating&#8217; for converting strings to integers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandrashekhar Patil</title>
		<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-1097</link>
		<author>Chandrashekhar Patil</author>
		<pubDate>Sat, 26 Apr 2008 07:08:48 +0000</pubDate>
		<guid>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-1097</guid>
		<description>Dear Sir,
Whem I am  saving data into database with follwoing coding, I am getting  error as like "Failed to convert parameter value from a TextBox to a String."

Kindly suggest how to solve this problem.

See Following Coding :

 cmd = New OleDbCommand(M_StrAdd, StrConn)
        cmd.Parameters.Add("@Recno", OleDbType.Integer).Value = Convert.ToInt32(TxtRecno.Text)
        cmd.Parameters.Add("@Scode", OleDbType.VarChar).Value = txtSCode
        cmd.Parameters.Add("@Sname", OleDbType.VarChar).Value = TxtStudentName.Text
        cmd.ExecuteNonQuery()
        cmd.Dispose()</description>
		<content:encoded><![CDATA[<p>Dear Sir,<br />
Whem I am  saving data into database with follwoing coding, I am getting  error as like &#8220;Failed to convert parameter value from a TextBox to a String.&#8221;</p>
<p>Kindly suggest how to solve this problem.</p>
<p>See Following Coding :</p>
<p> cmd = New OleDbCommand(M_StrAdd, StrConn)<br />
        cmd.Parameters.Add(&#8221;@Recno&#8221;, OleDbType.Integer).Value = Convert.ToInt32(TxtRecno.Text)<br />
        cmd.Parameters.Add(&#8221;@Scode&#8221;, OleDbType.VarChar).Value = txtSCode<br />
        cmd.Parameters.Add(&#8221;@Sname&#8221;, OleDbType.VarChar).Value = TxtStudentName.Text<br />
        cmd.ExecuteNonQuery()<br />
        cmd.Dispose()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jfrankcarr</title>
		<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-461</link>
		<author>jfrankcarr</author>
		<pubDate>Tue, 18 Sep 2007 13:39:38 +0000</pubDate>
		<guid>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-461</guid>
		<description>Thanks for your comment Ballamber

You could use a regular expression to extract the numeric string and convert that string to an integer using TryParse. Of course, that isn't quite as simple as just using Val() but it might be more 'acceptable' in polite .NET company.

I do strongly recommend that if you use Val that you have Option Strict turned on. You should do that anyway but since Val will force conversions of just about anything this is an extra safety step you should take.</description>
		<content:encoded><![CDATA[<p>Thanks for your comment Ballamber</p>
<p>You could use a regular expression to extract the numeric string and convert that string to an integer using TryParse. Of course, that isn&#8217;t quite as simple as just using Val() but it might be more &#8216;acceptable&#8217; in polite .NET company.</p>
<p>I do strongly recommend that if you use Val that you have Option Strict turned on. You should do that anyway but since Val will force conversions of just about anything this is an extra safety step you should take.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ballamber</title>
		<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-453</link>
		<author>Ballamber</author>
		<pubDate>Tue, 18 Sep 2007 09:43:18 +0000</pubDate>
		<guid>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-453</guid>
		<description>Thanks for this article, it was quite useful. I ended up using Val for it's simplicity of gracefully stopping at the first non-numerical character. Was pretty useful when converting HTML width parameters to integers. E.g. "200px" easily converts to 200 while the other functions would fail. (I did not thoroughly tested it though.)

Can any of the other functions be used to do the same without adding extra code?</description>
		<content:encoded><![CDATA[<p>Thanks for this article, it was quite useful. I ended up using Val for it&#8217;s simplicity of gracefully stopping at the first non-numerical character. Was pretty useful when converting HTML width parameters to integers. E.g. &#8220;200px&#8221; easily converts to 200 while the other functions would fail. (I did not thoroughly tested it though.)</p>
<p>Can any of the other functions be used to do the same without adding extra code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2007-09-15 &#171; D e j a m e S e r</title>
		<link>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-347</link>
		<author>links for 2007-09-15 &#171; D e j a m e S e r</author>
		<pubDate>Sat, 15 Sep 2007 15:20:46 +0000</pubDate>
		<guid>http://vbnotebookfor.net/2007/09/14/comparing-string-to-integer-conversion-methods-in-vbnet/#comment-347</guid>
		<description>[...] Comparing String to Integer Conversion Methods in VB.NET (tags: dotnet) [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Comparing String to Integer Conversion Methods in VB.NET (tags: dotnet) [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
