Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2007, 01:51 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Key Work Driver not recognized.

I am trying to setup a connection string to a shared database. I cannot figure out why this connection string is not working so I thought I would seek help here. Here is the .aspx coding:

<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace = "System.Data.SqlClient" %>
<%@ Import Namespace = "System.Data.Odbc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>tester2.aspx</title>
<script runat="server" language="c#">
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("DRIVER={SQL Server}; SERVER=winsql3.abac.com;Database=jgrant_awcconnect ;" +
"UID=xxxx;PWD=xxxx");
SqlCommand comm = new SqlCommand("SELECT txt_username FROM usr_user", conn);
conn.Open();
SqlDataReader reader = comm.ExecuteReader();
employeesLabel.Text = (string)reader["txt_username"];
reader.Close();
conn.Close();
}
</script>
</head>
<body>
<form runat="server">
<asp:Label ID="employeesLabel" runat="server" />
</form>
</body>
</html>

Keyword not supported: 'driver' is the error I get.
I tried using the .udl file and here is what it returned:

[ODBC]
DRIVER=SQL Server
UID=awcconnect
DATABASE=jgrant_awcconnect
WSID=JIGS-PC
APP=Microsoft® Windows® Operating System
SERVER=winsql3.abac.com

Maybe I am using this wrong or maybe its something else I do not know. I would really appreciate any advice you might offer as far as how to resolve this problem. The shared hosting company is Aplus.net if that makes any difference. Thank you in advance.

 
Old May 21st, 2007, 03:34 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try using the connection string below:

"server=winsql3.abac.com;database=jgrant_awcconnec t;uid=xxx;pwd=xxx;Connect Timeout=200"

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
 
Old May 21st, 2007, 11:46 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Now I am getting this error:

Invalid attempt to read when no data is present.

I know there is data in the db and there is no where statement within the query so I dont know whats happening. Without the driver bit in the connection string it passes through the driver error but keeps returning the above error.

Best Regards

Jigs






Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl:key doesnt work cristtiah XSLT 11 May 24th, 2006 09:57 AM
not recognized nachtegaal9999 ASP.NET 1.0 and 1.1 Basics 0 April 25th, 2006 02:04 PM
User Control: Tab key does not work alhad VB.NET 2002/2003 Basics 0 November 3rd, 2005 03:20 AM
Intel537 driver doesnt work on red hat 9... shah560 Linux 0 December 13th, 2004 07:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.