Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 10, 2008 09:59 AM by hlp4al
Member
242 Points
293 Posts
Jun 10, 2008 07:13 AM|LINK
Error ConnectionStrings Asp.Net 1.1 sql configuration
All-Star
154951 Points
19870 Posts
Moderator
MVP
Jun 10, 2008 07:20 AM|LINK
You should avoid using DSNs wherever possible, and use the SqlClient classes instead. In the meantime, the problem is likely with your connection string. You need to show how you are trying to connect.
Jun 10, 2008 08:25 AM|LINK
hi,
i wrote the connection string in web.congig file like this
<
</appSettings>
and i called this in my form like this
strConnection=ConfigurationSettings.AppSettings["ConnectionString"];
Jun 10, 2008 08:49 AM|LINK
You need to add a ProviderName and better to put the connection string in its own node, not in AppSettings:
<connectionStrings> <add name="myConnString" connectionString="Dsn=ram"providerName="System.Data.Odbc" /> </connectionStrings>
Then call it like this:
string strConnection = WebConfigurationManager.ConnectionStrings["myConnString"].ConnectionString;
Jun 10, 2008 09:21 AM|LINK
hi I am using .net 2003 there is no WebConfigurationManager under system.web.configuration
and how can i use the sqlconnections if i use the provider name as "syste.data.odbc"?
371 Points
86 Posts
Jun 10, 2008 09:59 AM|LINK
Hi.. try like below..
<connectionstrings>
<add name="ConnectionString" connectionString="DSN=ram" providerName="System.Data.odbc" />
</connectionstring>
and connection string is
dim myconnection as new odbcconnection
myconnection = New odbcConnection(Configuration.ConfigurationManager.AppSettings("ConnectionString"))
rameshgoudd
Member
242 Points
293 Posts
error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 07:13 AM|LINK
hi,
i am trying to connect sql server 2005 from my asp.net application
i have create DSN for this ..then i am getting the following error
Keyword not supported: 'dsn'. in sql server
please provide me the solution
Error ConnectionStrings Asp.Net 1.1 sql configuration
Articles on Sharepoint
Mikesdotnett...
All-Star
154951 Points
19870 Posts
Moderator
MVP
Re: error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 07:20 AM|LINK
You should avoid using DSNs wherever possible, and use the SqlClient classes instead. In the meantime, the problem is likely with your connection string. You need to show how you are trying to connect.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
rameshgoudd
Member
242 Points
293 Posts
Re: error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 08:25 AM|LINK
hi,
i wrote the connection string in web.congig file like this
<
appSettings> <add key="ConnectionString" value="DSN=ram;"></add></appSettings>
and i called this in my form like this
strConnection=ConfigurationSettings.AppSettings["ConnectionString"];
Articles on Sharepoint
Mikesdotnett...
All-Star
154951 Points
19870 Posts
Moderator
MVP
Re: error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 08:49 AM|LINK
You need to add a ProviderName and better to put the connection string in its own node, not in AppSettings:
<connectionStrings>
<add name="myConnString" connectionString="Dsn=ram"providerName="System.Data.Odbc" />
</connectionStrings>
Then call it like this:
string strConnection = WebConfigurationManager.ConnectionStrings["myConnString"].ConnectionString;
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
rameshgoudd
Member
242 Points
293 Posts
Re: error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 09:21 AM|LINK
hi I am using .net 2003 there is no WebConfigurationManager under system.web.configuration
and how can i use the sqlconnections if i use the provider name as "syste.data.odbc"?
Articles on Sharepoint
hlp4al
Member
371 Points
86 Posts
Re: error: Keyword not supported: 'dsn' in asp.net
Jun 10, 2008 09:59 AM|LINK
Hi.. try like below..
<connectionstrings>
<add name="ConnectionString" connectionString="DSN=ram" providerName="System.Data.odbc" />
</connectionstring>
and connection string is
dim myconnection as new odbcconnection
myconnection = New odbcConnection(Configuration.ConfigurationManager.AppSettings("ConnectionString"))