<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Data Access and ObjectDataSource Control</title><link>http://forums.asp.net/23.aspx</link><description>Questions and discussions related to using ADO.NET for data access, and the ObjectDataSource control. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=9&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3273946.aspx</link><pubDate>Fri, 03 Jul 2009 19:23:41 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273946</guid><dc:creator>qwe123kids</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273946.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3273946</wfw:commentRss><description>&lt;p&gt;If U use dataType in Your Application it helps In Unserstanding The Databse. Structure and Help U send proper Data on Runtime..&lt;/p&gt;&lt;p&gt;Example : If data base Name in Nvarchar , In Application also Uhave provided It Will help andTo Prevent Runtime eror.. Because U Know what U have provide To Database..&lt;/p&gt;&lt;p&gt;As I Told Numer is Not Important.. Because Nu7mer Limit Your Entery.Take Scenario If U have Deployed Application to 200 People and U have Decreased The Legth of Surname and All Application is having Single Database.. Know U cannot Go on Each PC Deploy The Code.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3273938.aspx</link><pubDate>Fri, 03 Jul 2009 19:16:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273938</guid><dc:creator>Mikesdotnetting</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273938.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3273938</wfw:commentRss><description>&lt;p&gt;There are a number of methods that come with the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection_methods.aspx"&gt;SqlParameterCollection&lt;/a&gt; class for adding parameters.&amp;nbsp; AddWithValue() does not accept the datatype or size as an argument.&amp;nbsp; The datatype is inferred from the value.&amp;nbsp; If you use one of the overloads that requires the type to be passed, you need to provide it.&amp;nbsp; Which method you choose to use is a matter of choice largely, although I&amp;#39;m sure that some development shops will insist on the really long version being used: &lt;a href="http://msdn.microsoft.com/en-us/library/e5xwx8sc.aspx"&gt;http://msdn.microsoft.com/en-us/library/e5xwx8sc.aspx&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Generally, I find life is too short. I prefer less typing.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3273879.aspx</link><pubDate>Fri, 03 Jul 2009 17:44:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273879</guid><dc:creator>demoninside9</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273879.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3273879</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;may be my question be foolish &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;qwe123kids&lt;/strong&gt; says &lt;strong&gt;datatype&lt;/strong&gt; is important&lt;/p&gt;
&lt;p&gt;but you says &lt;strong&gt;datatype is not impotant&lt;/strong&gt;.(according to your code explanation)&lt;/p&gt;
&lt;p&gt;which way i should follow...&lt;/p&gt;
&lt;p&gt;please tell me&lt;/p&gt;
&lt;p&gt;please&lt;/p&gt;
&lt;p&gt;thank you both&lt;/p&gt;
&lt;p&gt;thanx&lt;/p&gt;</description></item><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3272924.aspx</link><pubDate>Fri, 03 Jul 2009 07:23:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272924</guid><dc:creator>demoninside9</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272924.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3272924</wfw:commentRss><description>&lt;p&gt;thanx for replying&lt;br /&gt;&lt;/p&gt;&lt;p&gt;U didnt specify type and length.... in ur doce line. u just specified control TextBox1.Text&lt;/p&gt;&lt;p&gt;that means the below code is not ok(bt it si working fine..)&lt;/p&gt;&lt;p&gt;string strSql = &amp;quot;update mtblCentreNews set NewsSection=?,NewsSectiont=?,NewsDate=?,NewsHeading=?,NewsDetail=?,Image1=? where NewsId=&amp;quot;+lblNewsId.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OleDbCommand com = new OleDbCommand(strSql, con);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OleDbParameter param;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@NewsSection&amp;quot;, OleDbType.VarChar, 250);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = ddlNewsSection.SelectedValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@NewsSectiont&amp;quot;, OleDbType.VarChar, 250);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = ddlNewsSection.SelectedItem.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@NewsDate&amp;quot;, OleDbType.VarChar, 250);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = ddlDay.SelectedValue + &amp;quot;/&amp;quot; + ddlMonth.SelectedItem.Text + &amp;quot;/&amp;quot; + ddlYear.SelectedValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@NewsHeading&amp;quot;, OleDbType.VarWChar);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = txtHeading.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@NewsDetail&amp;quot;, OleDbType.VarWChar);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = txtMessage.Value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = com.Parameters.Add(&amp;quot;@Image1&amp;quot;, OleDbType.VarWChar);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param.Value = lblImage.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int row = com.ExecuteNonQuery();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;reply please&lt;/p&gt;&lt;p&gt;thanx&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3272896.aspx</link><pubDate>Fri, 03 Jul 2009 07:09:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272896</guid><dc:creator>qwe123kids</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272896.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3272896</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;250 is Not important but Datatype yes&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Check the Below 2 links..&lt;br /&gt;&lt;br /&gt;http://aspnet101.com/aspnet101/tutorials.aspx?id=1&lt;br /&gt;&lt;br /&gt;http://aspnet101.com/aspnet101/tutorials.aspx?id=10&lt;/p&gt;</description></item><item><title>Re: a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3272895.aspx</link><pubDate>Fri, 03 Jul 2009 07:09:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272895</guid><dc:creator>Mikesdotnetting</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272895.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3272895</wfw:commentRss><description>&lt;p&gt;No - it&amp;#39;s not necessary to specify the type.&amp;nbsp; You can use the AddwithValue() overload just to pass the name and the value:&lt;/p&gt;&lt;p&gt;com.Parameters.AddWithValue(&amp;quot;param1&amp;quot;, TextBox1.Text);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>a bit confusion about parameterized query</title><link>http://forums.asp.net/thread/3272738.aspx</link><pubDate>Fri, 03 Jul 2009 05:39:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272738</guid><dc:creator>demoninside9</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272738.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=3272738</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am having a datatable, where I am inserting a record.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; just let me know that when I use &lt;b&gt;parameter&lt;/b&gt; in my insert or update query, so it is &lt;b&gt;necessary,&amp;nbsp; &lt;/b&gt;that i have to mention &lt;b&gt;SqlDbType&lt;/b&gt; as exact i have set in the column of that field in my Db table.&lt;/p&gt;&lt;p&gt;means&lt;/p&gt;&lt;p&gt;if I am adding a parameter like&lt;/p&gt;&lt;p&gt;&lt;b&gt;param = com.Parameters.Add(&amp;quot;@NewsSectiont&amp;quot;, SqlDbType.NVarChar, 250);&lt;/b&gt;&lt;/p&gt;&lt;p&gt;so it&amp;#39;s mean should I set &lt;b&gt;exact&lt;/b&gt; same (&lt;b&gt;NVarChar, 250&lt;/b&gt;) type in DB table for column &amp;quot;&lt;b&gt;NewsSectiont&amp;quot;.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;just let me know.&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Thank you all&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>