<?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>SQL Server, SQL Server Express, and SqlDataSource Control</title><link>http://forums.asp.net/54.aspx</link><description>All about SQL Server, SQL Server Express, MSDE, and the SqlDataSource control.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Select in SqlDataSource</title><link>http://forums.asp.net/thread/3281083.aspx</link><pubDate>Wed, 08 Jul 2009 11:54:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3281083</guid><dc:creator>Jian Kang - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3281083.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3281083</wfw:commentRss><description>&lt;p&gt;Hi Frank,&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;FrankEnem:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;
&lt;p&gt;Pls I want to return the individual fields of the table AcctMaster with &amp;nbsp;the &amp;nbsp;SELECT statement.&lt;/p&gt;
&lt;p&gt;How then can I use a parameter to return the value of individuasl colums.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please clarify it or provide more detail? You may refer to the tutorial below:&lt;/p&gt;
&lt;p&gt;Using Parameterized Queries with the SqlDataSource&lt;br /&gt;&lt;a href="http://www.asp.net/learn/data-access/tutorial-48-vb.aspx"&gt;http://www.asp.net/learn/data-access/tutorial-48-vb.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;FrankEnem:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;
&lt;p&gt;OleDbDataReader rdrSql = (OleDbDataReader)SqlDataSource2.Select(DataSourceSelectArguments.Empty); &lt;/p&gt;
&lt;p&gt;When I put down the above code, line one gave me an error message. pls do explain this and how I can use the DataReader&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Please set the SqlDataSource.DataSourceMode property set to “DataReader”, and retrieve the data as follows:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;SqlDataReader dr = (SqlDataReader)SqlDataSource1.Select(DataSourceSelectArguments.Empty);&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;Please refer to the following document for more detail:&lt;/p&gt;
&lt;p&gt;SqlDataSource.Select Method&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.select.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.select.aspx&lt;/a&gt; &lt;/p&gt;</description></item><item><title>Re: Select in SqlDataSource</title><link>http://forums.asp.net/thread/3276728.aspx</link><pubDate>Mon, 06 Jul 2009 12:24:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276728</guid><dc:creator>Mikesdotnetting</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276728.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3276728</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;FrankEnem:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;When I put down the above code, line one gave me an error message.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;What is the error message?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Select in SqlDataSource</title><link>http://forums.asp.net/thread/3276491.aspx</link><pubDate>Mon, 06 Jul 2009 10:02:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3276491</guid><dc:creator>FrankEnem</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3276491.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3276491</wfw:commentRss><description>Hi,

How then can I use a parameter to return the value of individuasl colums.

You mention Dataset and Datareader well and fine, if I use a datareader, how will the code be?

---This is the smaple code for SqlDataSource1
DataView dvSql = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
	foreach (DataRowView drvSql in dvSql)
	{
		Label3.Text = drvSql[&amp;quot;FirstName&amp;quot;].ToString();
	}

	OleDbDataReader rdrSql = 
                   (OleDbDataReader)SqlDataSource2.Select(DataSourceSelectArguments.Empty);
	while (rdrSql.Read())
	{
		Label4.Text = rdrSql[&amp;quot;LastName&amp;quot;].ToString();

	}
	rdrSql.Close();
-------
When I put down the above code, line one gave me an error message. pls do explain this and how I can use the DataReader</description></item><item><title>Re: Select in SqlDataSource</title><link>http://forums.asp.net/thread/3274967.aspx</link><pubDate>Sat, 04 Jul 2009 21:27:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274967</guid><dc:creator>Mikesdotnetting</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274967.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3274967</wfw:commentRss><description>&lt;p&gt;Hmmm.&amp;nbsp; Not quite sure why you have not use a parameter for the AccountID value, but then added a parameter that you have not provided a value for or used in your SQL.&amp;nbsp; Also, I don&amp;#39;t know why you are using a DataTable, when a DataReader will do.&lt;/p&gt;&lt;p&gt;As far as referencing the values using their tablename.fieldname is concerned, that won&amp;#39;t work. Read this: &lt;a href="http://www.mikesdotnetting.com/Article.aspx?ArticleID=45"&gt;http://www.mikesdotnetting.com/Article.aspx?ArticleID=45&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Select in SqlDataSource</title><link>http://forums.asp.net/thread/3274812.aspx</link><pubDate>Sat, 04 Jul 2009 16:23:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274812</guid><dc:creator>FrankEnem</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274812.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=54&amp;PostID=3274812</wfw:commentRss><description>&lt;p&gt;Hi,

I have created a datasource sqldatasource1. I have issued a select statement in a view to updating a record.&lt;/p&gt;&lt;p&gt;--------------------Partial code &lt;/p&gt;&lt;p&gt; SqlDataSource1.SelectCommand = &amp;quot;SELECT * FROM ACCTMASTER WHERE ACCOUNTID =&amp;quot; + Me.AccountID.Text&lt;/p&gt;&lt;p&gt;SqlDataSource1.SelectParameters.Clear()&lt;/p&gt;&lt;p&gt;SqlDataSource1.SelectParameters.Add(&amp;quot;PAYERID&amp;quot;, Me.PayerID.Text)
        &lt;/p&gt;&lt;p&gt;Dim dv As DataView = DirectCast(SqlDataSource1.[Select](DataSourceSelectArguments.Empty), DataView)
        &lt;/p&gt;&lt;p&gt;Dim tab As DataTable = dv.Table

        &lt;/p&gt;&lt;p&gt; (tab.Rows.Count &amp;gt; 0) Then&lt;/p&gt;&lt;p&gt;---- and so on&lt;/p&gt;&lt;p&gt;-------------------end of partial code&lt;/p&gt;&lt;p&gt;Pls I want to return the individual fields of the table AcctMaster with  the  SELECT statement.&lt;/p&gt;&lt;p&gt;for instance, &lt;/p&gt;&lt;p&gt;Dim  V_AccountId as String = AcctMaster.AccountId&lt;/p&gt;&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>