<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Using the ASP.NET GridView control to query a SQL Server database with ADO.NET</title>
	<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/</link>
	<description>Quality ASP.NET/C#/SQL Server tutorials, examples, videos and advice</description>
	<pubDate>Thu, 09 Feb 2012 17:43:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: ted</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-219</link>
		<dc:creator>ted</dc:creator>
		<pubDate>Sat, 21 Nov 2009 16:49:16 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-219</guid>
		<description>Kerry, 
Getting SQL Server to integrate with ASP.NET is not always easy.  There are many database configuration options that can cause the error you are seeing.  I recommend that you configure your SQL Server using the instructions that I have in the following article first and see if that fixes your error:
http://www.csharpuniversity.com/2008/12/15/how-to-configure-sql-server-2008-express-for-aspnet-and-adonet/

Watch the example videos closely because you have to make sure you follow each step.</description>
		<content:encoded><![CDATA[<p>Kerry,<br />
Getting SQL Server to integrate with ASP.NET is not always easy.  There are many database configuration options that can cause the error you are seeing.  I recommend that you configure your SQL Server using the instructions that I have in the following article first and see if that fixes your error:<br />
<a href="http://www.csharpuniversity.com/2008/12/15/how-to-configure-sql-server-2008-express-for-aspnet-and-adonet/" rel="nofollow">http://www.csharpuniversity.com/2008/12/15/how-to-configure-sql-server-2008-express-for-aspnet-and-adonet/</a></p>
<p>Watch the example videos closely because you have to make sure you follow each step.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-218</link>
		<dc:creator>Kerry</dc:creator>
		<pubDate>Sat, 21 Nov 2009 16:25:28 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-218</guid>
		<description>I have created the table customers and have been banging my head against the wall for 2 days now. When I debug GridView_SQLServer.aspx.cs I continue to get the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Can you help me out?</description>
		<content:encoded><![CDATA[<p>I have created the table customers and have been banging my head against the wall for 2 days now. When I debug GridView_SQLServer.aspx.cs I continue to get the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)</p>
<p>Can you help me out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elena</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-217</link>
		<dc:creator>Elena</dc:creator>
		<pubDate>Fri, 20 Nov 2009 16:53:44 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-217</guid>
		<description>Thank you.
It is a very good tutorial.
Your tutorial helped me to start coding in ASP.net, not only using existing controls.
Elena</description>
		<content:encoded><![CDATA[<p>Thank you.<br />
It is a very good tutorial.<br />
Your tutorial helped me to start coding in ASP.net, not only using existing controls.<br />
Elena</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ted</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-182</link>
		<dc:creator>ted</dc:creator>
		<pubDate>Thu, 03 Sep 2009 14:48:19 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-182</guid>
		<description>Hi Kaka,
If you want to store the CustomerID as an nvarchar you don't need to convert it.  Just use the sCustomerId (string) variable instead of the customerid (int) variable.  

Also, if you are storing numeric data in your database table, you should use a numeric database type like "int" instead of a text string type like nvarchar.
Using the numeric type takes less space and is more efficient overall.</description>
		<content:encoded><![CDATA[<p>Hi Kaka,<br />
If you want to store the CustomerID as an nvarchar you don&#8217;t need to convert it.  Just use the sCustomerId (string) variable instead of the customerid (int) variable.  </p>
<p>Also, if you are storing numeric data in your database table, you should use a numeric database type like &#8220;int&#8221; instead of a text string type like nvarchar.<br />
Using the numeric type takes less space and is more efficient overall.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaka</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-181</link>
		<dc:creator>Kaka</dc:creator>
		<pubDate>Wed, 02 Sep 2009 17:55:02 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-181</guid>
		<description>string sCustomerId = Request.QueryString["customerid"];  
int customerid = int.Parse(sCustomerId); 
if database column CustomerID i use type nvarchar. How do I? I don`t know convert into type nvarchar. Can you help me? Thank!!!</description>
		<content:encoded><![CDATA[<p>string sCustomerId = Request.QueryString[&#8221;customerid&#8221;];<br />
int customerid = int.Parse(sCustomerId);<br />
if database column CustomerID i use type nvarchar. How do I? I don`t know convert into type nvarchar. Can you help me? Thank!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imran</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-118</link>
		<dc:creator>imran</dc:creator>
		<pubDate>Tue, 26 May 2009 12:11:42 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-118</guid>
		<description>Error	1	'ASP.details_aspx' does not contain a definition for 'GridView1_SelectedIndexChanged' and no extension method 'GridView1_SelectedIndexChanged' accepting a first argument of type 'ASP.details_aspx' could be found (are you missing a using directive or an assembly reference?)	E:\aspnet87\gridviewshpping\details.aspx	1	1	E:\aspnet87\gridviewshpping\</description>
		<content:encoded><![CDATA[<p>Error	1	&#8216;ASP.details_aspx&#8217; does not contain a definition for &#8216;GridView1_SelectedIndexChanged&#8217; and no extension method &#8216;GridView1_SelectedIndexChanged&#8217; accepting a first argument of type &#8216;ASP.details_aspx&#8217; could be found (are you missing a using directive or an assembly reference?)	E:\aspnet87\gridviewshpping\details.aspx	1	1	E:\aspnet87\gridviewshpping\</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Griffith</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-81</link>
		<dc:creator>Lee Griffith</dc:creator>
		<pubDate>Mon, 04 May 2009 00:55:57 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-81</guid>
		<description>It worked. Thank you.
I rebuilt the database after setting up the database per your suggestion. Thanks much.</description>
		<content:encoded><![CDATA[<p>It worked. Thank you.<br />
I rebuilt the database after setting up the database per your suggestion. Thanks much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ted</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-79</link>
		<dc:creator>ted</dc:creator>
		<pubDate>Wed, 29 Apr 2009 05:18:02 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-79</guid>
		<description>Please see the following video how to get to the Login properties window for the "sa" 
account.  Then change the password to Password1234*
Also make sure the account is enabled.  That is in the video too.
http://www.csharpuniversity.com/videos/configure_sql_server_enable_sa.html

You can also test to make sure that you have the right password by trying to logon to the 
SQL Server Management Studio using the sa account username and password.  That is a good 
test.</description>
		<content:encoded><![CDATA[<p>Please see the following video how to get to the Login properties window for the &#8220;sa&#8221;<br />
account.  Then change the password to Password1234*<br />
Also make sure the account is enabled.  That is in the video too.<br />
<a href="http://www.csharpuniversity.com/videos/configure_sql_server_enable_sa.html" rel="nofollow">http://www.csharpuniversity.com/videos/configure_sql_server_enable_sa.html</a></p>
<p>You can also test to make sure that you have the right password by trying to logon to the<br />
SQL Server Management Studio using the sa account username and password.  That is a good<br />
test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Griffith</title>
		<link>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-78</link>
		<dc:creator>Lee Griffith</dc:creator>
		<pubDate>Wed, 29 Apr 2009 01:10:20 +0000</pubDate>
		<guid>http://www.csharpuniversity.com/2008/12/27/using-the-aspnet-gridview-control-to-query-a-sql-server-database/#comment-78</guid>
		<description>I am having a lot of trouble displaying the data. I have the following:
using (SqlConnection dbconn = new SqlConnection("Server=localhost;Database=csharpuniversity;User ID=sa;Password=Password1234*;Trusted_Connection=False;"))
        {
            //Here I run an SQL query statement against the database object
            //that I instantiated in the using statement above.
            dbadapter = new SqlDataAdapter("select * from Customer", dbconn);

When I click the Show Customers button I get an error:
login failed for user 'sa'</description>
		<content:encoded><![CDATA[<p>I am having a lot of trouble displaying the data. I have the following:<br />
using (SqlConnection dbconn = new SqlConnection(&#8221;Server=localhost;Database=csharpuniversity;User ID=sa;Password=Password1234*;Trusted_Connection=False;&#8221;))<br />
        {<br />
            //Here I run an SQL query statement against the database object<br />
            //that I instantiated in the using statement above.<br />
            dbadapter = new SqlDataAdapter(&#8221;select * from Customer&#8221;, dbconn);</p>
<p>When I click the Show Customers button I get an error:<br />
login failed for user &#8217;sa&#8217;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

