473,403 Members | 2,222 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,403 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 11747
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.