469,623 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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 11576
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Jon Davis | last post: by
5 posts views Thread by mlg1906 | last post: by
4 posts views Thread by =?Utf-8?B?QmlsbCBNaWxk?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.