467,174 Members | 1,294 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,174 developers. It's quick & easy.

ASP AND MYSQL ERROR : "Keyword not supported: 'dsn'."

Hi I am using MYSQL and ASP.Net. to build the Data Reader Page.

when i define my connection Key - it gives me this error.Keyword not supported: 'dsn'.

[HTML]MY PAGE Data Reader[/HTML] [HTML]<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
// create the connection
SqlConnection myConnection = new SqlConnection();

// configure the connection
string strConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
myConnection.ConnectionString= strConnectionString;

// create the command
string strCommandText = "SELECT ManufacturerName, ManufacturerCountry, ManufacturerEmail, ManufacturerWebsite FROM Manufacturer ORDER BY ManufacturerName";
SqlCommand myCommand = new SqlCommand(strCommandText, myConnection);

// open the database connection

// run query
SqlDataReader myReader = myCommand.ExecuteReader();

while (myReader.Read())
// create the manufacturer object
Manufacturer objManufacturer = new Manufacturer();
objManufacturer.Name = Convert.ToString(myReader["ManufacturerName"]);
objManufacturer.Country = Convert.ToString(myReader["ManufacturerCountry"]);
objManufacturer.Email = Convert.ToString(myReader["ManufacturerEmail"]);
objManufacturer.Website = Convert.ToString(myReader["ManufacturerWebsite"]);

// output the manufacturer object details
Label1.Text += objManufacturer.ToString() + "<BR/>";

// close the reader
// close the database connection

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Iterating Through a DataReader</title>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Width="84px" Font-Bold="True" ForeColor="Maroon"></asp:Label></div>

Now in Bolded line 16 above in the code causes the error - so i try to put my original connection String i used to connect to MYSQL

"Dsn=MYSQL ODBC 3.51 Driver;uid=Myuser;pwd=Mypassword";

But it still give the same error that Keyword not supported: 'dsn'.

Please guide me - what to do...

(I wont give up)
Jul 9 '07 #1
  • viewed: 1901

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Willem van Rumpt | last post: by
3 posts views Thread by filip.norrgard@gmail.com | last post: by
reply views Thread by matthardwick | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.