473,387 Members | 1,388 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,387 software developers and data experts.

sql connection string in web.config trouble

Please, anyone who has experience setting up a sql connection string in the
web.config file, can you decipher this error.:

Keyword not supported: 'datasource'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported:
'datasource'.

Source Error:
Line 44: Dim connstrng As String
Line 45: connstrng =
ConfigurationSettings.AppSettings("MediaConnstring ")
Line 46: Dim cnMedia As New SqlConnection(connstrng)
Line 47: Dim dsMedia As DataSet
Line 48: Dim daMedia As New SqlDataAdapter("select * from
media_all", cnMedia)
Source File: c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb Line: 46

Stack Trace:
[ArgumentException: Keyword not supported: 'datasource'.]
System.Data.Common.DBConnectionString.ParseInterna l(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
+13
System.Data.SqlClient.SqlConnectionString.ParseStr ing(String
connectionString) +96
System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158
MediaApp.MediaGrid2.DisplayData() in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:46
MediaApp.MediaGrid2.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
Jul 21 '05 #1
3 11746
What is the connection string you're trying to retrieve from the config?
First guess: try adding a space... 'data source'
"syhart" <sy****@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Please, anyone who has experience setting up a sql connection string in
the
web.config file, can you decipher this error.:

Keyword not supported: 'datasource'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported:
'datasource'.

Source Error:
Line 44: Dim connstrng As String
Line 45: connstrng =
ConfigurationSettings.AppSettings("MediaConnstring ")
Line 46: Dim cnMedia As New SqlConnection(connstrng)
Line 47: Dim dsMedia As DataSet
Line 48: Dim daMedia As New SqlDataAdapter("select * from
media_all", cnMedia)
Source File: c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb Line: 46

Stack Trace:
[ArgumentException: Keyword not supported: 'datasource'.]
System.Data.Common.DBConnectionString.ParseInterna l(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
+13
System.Data.SqlClient.SqlConnectionString.ParseStr ing(String
connectionString) +96
System.Data.SqlClient.SqlConnection.set_Connection String(String value)
+11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158
MediaApp.MediaGrid2.DisplayData() in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:46
MediaApp.MediaGrid2.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET
Version:1.1.4322.2032

Jul 21 '05 #2
Hi,
The following is a sample Connection string.
Have a look at it and do ncecessary changes to your string.
"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
Hope it works.
Happy Coding

"John Spiegel" wrote:
What is the connection string you're trying to retrieve from the config?
First guess: try adding a space... 'data source'
"syhart" <sy****@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Please, anyone who has experience setting up a sql connection string in
the
web.config file, can you decipher this error.:

Keyword not supported: 'datasource'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported:
'datasource'.

Source Error:
Line 44: Dim connstrng As String
Line 45: connstrng =
ConfigurationSettings.AppSettings("MediaConnstring ")
Line 46: Dim cnMedia As New SqlConnection(connstrng)
Line 47: Dim dsMedia As DataSet
Line 48: Dim daMedia As New SqlDataAdapter("select * from
media_all", cnMedia)
Source File: c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb Line: 46

Stack Trace:
[ArgumentException: Keyword not supported: 'datasource'.]
System.Data.Common.DBConnectionString.ParseInterna l(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
+13
System.Data.SqlClient.SqlConnectionString.ParseStr ing(String
connectionString) +96
System.Data.SqlClient.SqlConnection.set_Connection String(String value)
+11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158
MediaApp.MediaGrid2.DisplayData() in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:46
MediaApp.MediaGrid2.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET
Version:1.1.4322.2032


Jul 21 '05 #3
Thanks. After closer examination the string was formatted incorrectly. You
have to be careful to write the connection string exactly as it should appear.
"syhart" wrote:
Please, anyone who has experience setting up a sql connection string in the
web.config file, can you decipher this error.:

Keyword not supported: 'datasource'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported:
'datasource'.

Source Error:
Line 44: Dim connstrng As String
Line 45: connstrng =
ConfigurationSettings.AppSettings("MediaConnstring ")
Line 46: Dim cnMedia As New SqlConnection(connstrng)
Line 47: Dim dsMedia As DataSet
Line 48: Dim daMedia As New SqlDataAdapter("select * from
media_all", cnMedia)
Source File: c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb Line: 46

Stack Trace:
[ArgumentException: Keyword not supported: 'datasource'.]
System.Data.Common.DBConnectionString.ParseInterna l(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1133
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString)
+13
System.Data.SqlClient.SqlConnectionString.ParseStr ing(String
connectionString) +96
System.Data.SqlClient.SqlConnection.set_Connection String(String value) +11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +158
MediaApp.MediaGrid2.DisplayData() in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:46
MediaApp.MediaGrid2.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\MediaApp\MediaGrid2.aspx.vb:36
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and...
19
by: Jaime Stuardo | last post by:
Hi all.. I have created a business logic component that is used from my ASP.NET webform. It works, but connection string to the database is hard coded, as in this method : public DataSet...
3
by: syhart | last post by:
Please, anyone who has experience setting up a sql connection string in the web.config file, can you decipher this error.: Keyword not supported: 'datasource'. Description: An unhandled...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
5
by: mlg1906 | last post by:
I'm developing an intranet site in ASP.NET 2.0 but I can't seem to connect to the DB from within my code. I've created a .vb class that houses a private Connection() that other functions within the...
2
by: RyoSaeba | last post by:
Hello, I have a problem with the session state set to Sql Server (AspNet 1.1, Windows Server 2003 on an Application Center cluster, Sql Server 2000 on another server). Sometimes, when many user...
2
by: Thorsten Dittmar | last post by:
Hi, I don't get it. I'm using a typed dataset with table adapters and all that stuff. I have the database server running locally on my development system. Now: when creating a tableadapter...
4
by: =?Utf-8?B?QmlsbCBNaWxk?= | last post by:
Feel free to let me know if there is a better place to post this question I'm a website developer trying to write a Windows Service, and I think I'm running into trouble due to the paradigm...
2
by: Johnson | last post by:
I'm trying to fix a "sub optimal" situation with respect to connection string management. Your thoughtful responses will be appreciated. I just started with a new client who has a bunch of legacy...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.