472,779 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 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 11708
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.