473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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();

try
{
// 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
myConnection.Open();

// 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
myReader.Close();
}
finally
{
// close the database connection
myConnection.Close();
}
}
</script>

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


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...

Thanks,
Harsh
(I wont give up)
Jul 9 '07 #1
0 2208

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

Similar topics

11
by: MLH | last post by:
If this is what MySQL is set to... SELECT DISTINCTROW qryVehiclesNowners5.SerialNum, qryVehiclesNowners5.VDescr, qryVehiclesNowners5.Owner, qryVehiclesNowners5.VehicleJobID ,...
7
by: Willem van Rumpt | last post by:
Hi all, coming from an unmanaged programming background, I took my time to sort out the IDisposable and finalizer patterns. Just when I thought I had it all conceptually neatly arranged, the...
8
by: Dot net work | last post by:
I need VB.NET's "shadows" functionality inside a C# project. I tried the "new" keyword, but it didn't seem to work, because my particular function does in fact differ in signature to the function...
2
by: vvenk | last post by:
Hello: I am trying to acccess an Gracle 10g database from within an ASP.NET application running on a Windows 2003 server. I have tried both the following connections strings: ...
4
by: Ben R. | last post by:
I'm curious about the differeng behavior of the "new" keyword when dealing with value versus object types. If I'm correct, when I do: dim x as integer There's no need for "new" to be called...
3
by: filip.norrgard | last post by:
Hi All! I've been developing an ASP.Net 2.0 web application using the Visual Studio 2005 tools. Currently datagrids on a page are filled with data from a dataset (a .xsd file in the "project")...
7
by: BillCo | last post by:
I need to Connect to an online mySQL database from Access using JET ODBC with no saved DSN. Anyone out there who as made this work and can give example of how it's done? I've seen lots of posts...
0
by: Harshpandya | last post by:
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'. MY PAGE Data Reader <%@ Page Language="C#"...
0
matthardwick
by: matthardwick | last post by:
Hi everyone, I am trying to connect access to mySQL with a DSN file, but every time I go to create one, I get an error - if I create it manually I get an error when I try to connect, something...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.