473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Q: using DSN

Hello,
I have the following lines to read connection string from web.config;

string cStr = ConfigurationSe ttings.AppSetti ngs["connectionStri ng"];
SqlConnection sqlConn = new SqlConnection(c Str);
this.sqlConnect ion1.Connection String = cStr;

How can replace this with a DSN (ODBC connection) I defined in my current
machine?
Thanks,

Nov 19 '05
13 3588
re:
once I create DSN how do I use it in the code?
I don't think you can use it, Jim.

There's no way for the DSN or FILEDSN parameters to be inserted
into a SQLConnection or a SQLCommand object, at least as far as I know.

That is why when you asked earlier :Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?
I replied : "No, it won't."

And, in the other thread you started on the same subject, I said :
Other than a DSN is not an property of SqlConnection,
and therefore you cannot use DSN with a SqlConnection
I just don't think that it can be done.
If you learn a way to do that, please post it and I will change my opinion.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:EB******** *************** ***********@mic rosoft.com... Hi Juan,
Thanks for the reply. Ok. I understand it might be little bit slow through
DSN, once I create DSN how do I use it in the code? Is there any way I can
create SQLCommand through DSN.
Thanks,

"Juan T. Llibre" wrote:
re:
>Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?


No, it won't. See my earlier reply.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:28******** *************** ***********@mic rosoft.com...
> Hi Venkat_KL,
> Thank you very much for all this great help. Since I am using
> "this.sqlConnec tion1.Connectio nString" in many places such as "SqlCommand
> sqlCmd = new SqlCommand(sqlS tr, connStr);" When I read my DSN from web.config
> with the example you gave, how should I use it instead of
> "this.sqlConnec tion1.Connectio nString" in my code? Will this "SqlCommand
> sqlCmd = new SqlCommand(sqlS tr, myDSN);" work? I am new in asp.net and do not
> know all these details.
> Thanks,
>
>
>
>
> "Venkat_KL" wrote:
>
>> Hi Dear JIM.H,
>>
>> This is the sample where you give all your connection string values inside
>> the asp.net file (ie. for example: in code behind)
>>
>> But in your case You have to give
>>
>> either
>>
>> "DSN=mySystemDS N;" & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> or
>>
>> "FILEDSN=c:\som epath\mydb.dsn; " & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> in you web.config in <appSettings> </appSettings> section like below
>>
>> <configuratio n>
>> <appSettings>
>> <add key="pubsDSN" value="DSN=mySy stemDSN;Uid=myU sername;Pwd=myP assword"
>> />
>> </appSettings>
>> </configuration>
>>
>> OR
>>
>> <configuratio n>
>> <appSettings>
>> <add key="pubsFileDS N"
>> value="FILEDSN= c:\somepath\myd b.dsn;Uid=myUse rname;Pwd=myPas sword"/>
>> </appSettings>
>> </configuration>
>>
>> and
>>
>> in your code behind to access the web.config file DSN/FileDSN
>>
>> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsDSN")
>> or
>> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsFileDS N")
>>
>>
>> ODBC DSN
>> =======
>> Using an ODBC DSN (Data Source Name) is a two step process.
>>
>> 1) You must first create the DSN via the "ODBC Data Source Administrator"
>> program found in your computer's Control Panel (or Administrative Tools menu
>> in Windows 2000). Make sure to create a SYSTEM DSN (not a USER DSN) when
>> using ASP(I think same thing holds good for ASP.NET).
>>
>> 2) Then use the following connection string - with your own DSN
>> name of course.
>>
>> DSN
>> ====
>> oConn.Open "DSN=mySystemDS N;" & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> File DSN
>> ======
>> oConn.Open "FILEDSN=c:\som epath\mydb.dsn; " & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> Note:
>> ====
>> The problem with DSN is that Users can (and will) modify or delete them by
>> mistake, then your program won't work so well. So it's better to use a
>> DSN-Less or OLE DB Provider connection string - with a Trusted Connection if
>> possible!
>>
>>
>>
>> About ODBC data sources
>> =============== =
>> http://msdn.microsoft.com/library/de...ataSources.asp
>>
>>
>> Login System (ASP.NET)
>> =============== =
>> http://www.codeproject.com/Purgatory/Login_System.asp
>>
>> For Anything & Everything, Please Let Me Know
>>
>> Bye
>> Venkat_KL


Nov 19 '05 #11
Hi Juan,

I see your point, I am not just understanding if DSN definition is possible
in APS.Net, where and how I will use it?

Here is a connection string I can use it ASP;
Set objADODBConn = CreateObject("A DODB.Connection ")
strConn="DSN=" & MyODBC & ";UID=" & MyUsername & ";PWD=" & MyPassword & ";"
objADODBConn.Op en(strConn)

I could not believe that Microsoft does not allow this kind of thing in
ASP.Net for SQL connection. DSN is still using native SQL Server driver in
the system.
However thank you very much for your time.
"Juan T. Llibre" wrote:
re:
once I create DSN how do I use it in the code?


I don't think you can use it, Jim.

There's no way for the DSN or FILEDSN parameters to be inserted
into a SQLConnection or a SQLCommand object, at least as far as I know.

That is why when you asked earlier :
Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?


I replied : "No, it won't."

And, in the other thread you started on the same subject, I said :
Other than a DSN is not an property of SqlConnection,
and therefore you cannot use DSN with a SqlConnection


I just don't think that it can be done.
If you learn a way to do that, please post it and I will change my opinion.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:EB******** *************** ***********@mic rosoft.com...
Hi Juan,
Thanks for the reply. Ok. I understand it might be little bit slow through
DSN, once I create DSN how do I use it in the code? Is there any way I can
create SQLCommand through DSN.
Thanks,

"Juan T. Llibre" wrote:
re:
>Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?

No, it won't. See my earlier reply.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:28******** *************** ***********@mic rosoft.com...
> Hi Venkat_KL,
> Thank you very much for all this great help. Since I am using
> "this.sqlConnec tion1.Connectio nString" in many places such as "SqlCommand
> sqlCmd = new SqlCommand(sqlS tr, connStr);" When I read my DSN from web.config
> with the example you gave, how should I use it instead of
> "this.sqlConnec tion1.Connectio nString" in my code? Will this "SqlCommand
> sqlCmd = new SqlCommand(sqlS tr, myDSN);" work? I am new in asp.net and do not
> know all these details.
> Thanks,
>
>
>
>
> "Venkat_KL" wrote:
>
>> Hi Dear JIM.H,
>>
>> This is the sample where you give all your connection string values inside
>> the asp.net file (ie. for example: in code behind)
>>
>> But in your case You have to give
>>
>> either
>>
>> "DSN=mySystemDS N;" & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> or
>>
>> "FILEDSN=c:\som epath\mydb.dsn; " & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> in you web.config in <appSettings> </appSettings> section like below
>>
>> <configuratio n>
>> <appSettings>
>> <add key="pubsDSN" value="DSN=mySy stemDSN;Uid=myU sername;Pwd=myP assword"
>> />
>> </appSettings>
>> </configuration>
>>
>> OR
>>
>> <configuratio n>
>> <appSettings>
>> <add key="pubsFileDS N"
>> value="FILEDSN= c:\somepath\myd b.dsn;Uid=myUse rname;Pwd=myPas sword"/>
>> </appSettings>
>> </configuration>
>>
>> and
>>
>> in your code behind to access the web.config file DSN/FileDSN
>>
>> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsDSN")
>> or
>> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsFileDS N")
>>
>>
>> ODBC DSN
>> =======
>> Using an ODBC DSN (Data Source Name) is a two step process.
>>
>> 1) You must first create the DSN via the "ODBC Data Source Administrator"
>> program found in your computer's Control Panel (or Administrative Tools menu
>> in Windows 2000). Make sure to create a SYSTEM DSN (not a USER DSN) when
>> using ASP(I think same thing holds good for ASP.NET).
>>
>> 2) Then use the following connection string - with your own DSN
>> name of course.
>>
>> DSN
>> ====
>> oConn.Open "DSN=mySystemDS N;" & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> File DSN
>> ======
>> oConn.Open "FILEDSN=c:\som epath\mydb.dsn; " & _
>> "Uid=myUsername ;" & _
>> "Pwd=myPassword "
>>
>> Note:
>> ====
>> The problem with DSN is that Users can (and will) modify or delete them by
>> mistake, then your program won't work so well. So it's better to use a
>> DSN-Less or OLE DB Provider connection string - with a Trusted Connection if
>> possible!
>>
>>
>>
>> About ODBC data sources
>> =============== =
>> http://msdn.microsoft.com/library/de...ataSources.asp
>>
>>
>> Login System (ASP.NET)
>> =============== =
>> http://www.codeproject.com/Purgatory/Login_System.asp
>>
>> For Anything & Everything, Please Let Me Know
>>
>> Bye
>> Venkat_KL


Nov 19 '05 #12
You are trying to use ADO in ASP.NET.

For a zillion reasons that is not good.

re:
I could not believe that Microsoft does not allow
this kind of thing in ASP.Net for SQL connection.
Believe it.

Why would Microsoft include as an option something
which buries performance for web applications ?

Take a few minutes to see this ADO.NET presentation :
http://www.microsoft.com/seminar/sha...7/manifest.xml

Also, read the links on this page :
http://msdn.microsoft.com/library/de...withadonet.asp

Don't beat your head against the wall by trying to use ADO in ASP.NET.
You're only going to hurt yourself.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:AE******** *************** ***********@mic rosoft.com... Hi Juan,

I see your point, I am not just understanding if DSN definition is possible
in APS.Net, where and how I will use it?

Here is a connection string I can use it ASP;
Set objADODBConn = CreateObject("A DODB.Connection ")
strConn="DSN=" & MyODBC & ";UID=" & MyUsername & ";PWD=" & MyPassword & ";"
objADODBConn.Op en(strConn)

I could not believe that Microsoft does not allow this kind of thing in
ASP.Net for SQL connection. DSN is still using native SQL Server driver in
the system.
However thank you very much for your time.
"Juan T. Llibre" wrote:
re:
> once I create DSN how do I use it in the code?


I don't think you can use it, Jim.

There's no way for the DSN or FILEDSN parameters to be inserted
into a SQLConnection or a SQLCommand object, at least as far as I know.

That is why when you asked earlier :
>Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?


I replied : "No, it won't."

And, in the other thread you started on the same subject, I said :
>Other than a DSN is not an property of SqlConnection,
>and therefore you cannot use DSN with a SqlConnection


I just don't think that it can be done.
If you learn a way to do that, please post it and I will change my opinion.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:EB******** *************** ***********@mic rosoft.com...
> Hi Juan,
> Thanks for the reply. Ok. I understand it might be little bit slow through
> DSN, once I create DSN how do I use it in the code? Is there any way I can
> create SQLCommand through DSN.
> Thanks,
>
> "Juan T. Llibre" wrote:
>
>> re:
>> >Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?
>>
>> No, it won't. See my earlier reply.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> =============== =============== ========
>> "JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
>> news:28******** *************** ***********@mic rosoft.com...
>> > Hi Venkat_KL,
>> > Thank you very much for all this great help. Since I am using
>> > "this.sqlConnec tion1.Connectio nString" in many places such as "SqlCommand
>> > sqlCmd = new SqlCommand(sqlS tr, connStr);" When I read my DSN from web.config
>> > with the example you gave, how should I use it instead of
>> > "this.sqlConnec tion1.Connectio nString" in my code? Will this "SqlCommand
>> > sqlCmd = new SqlCommand(sqlS tr, myDSN);" work? I am new in asp.net and do not
>> > know all these details.
>> > Thanks,
>> >
>> >
>> >
>> >
>> > "Venkat_KL" wrote:
>> >
>> >> Hi Dear JIM.H,
>> >>
>> >> This is the sample where you give all your connection string values inside
>> >> the asp.net file (ie. for example: in code behind)
>> >>
>> >> But in your case You have to give
>> >>
>> >> either
>> >>
>> >> "DSN=mySystemDS N;" & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> or
>> >>
>> >> "FILEDSN=c:\som epath\mydb.dsn; " & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> in you web.config in <appSettings> </appSettings> section like below
>> >>
>> >> <configuratio n>
>> >> <appSettings>
>> >> <add key="pubsDSN" value="DSN=mySy stemDSN;Uid=myU sername;Pwd=myP assword"
>> >> />
>> >> </appSettings>
>> >> </configuration>
>> >>
>> >> OR
>> >>
>> >> <configuratio n>
>> >> <appSettings>
>> >> <add key="pubsFileDS N"
>> >> value="FILEDSN= c:\somepath\myd b.dsn;Uid=myUse rname;Pwd=myPas sword"/>
>> >> </appSettings>
>> >> </configuration>
>> >>
>> >> and
>> >>
>> >> in your code behind to access the web.config file DSN/FileDSN
>> >>
>> >> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsDSN")
>> >> or
>> >> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsFileDS N")
>> >>
>> >>
>> >> ODBC DSN
>> >> =======
>> >> Using an ODBC DSN (Data Source Name) is a two step process.
>> >>
>> >> 1) You must first create the DSN via the "ODBC Data Source Administrator"
>> >> program found in your computer's Control Panel (or Administrative Tools menu
>> >> in Windows 2000). Make sure to create a SYSTEM DSN (not a USER DSN) when
>> >> using ASP(I think same thing holds good for ASP.NET).
>> >>
>> >> 2) Then use the following connection string - with your own DSN
>> >> name of course.
>> >>
>> >> DSN
>> >> ====
>> >> oConn.Open "DSN=mySystemDS N;" & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> File DSN
>> >> ======
>> >> oConn.Open "FILEDSN=c:\som epath\mydb.dsn; " & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> Note:
>> >> ====
>> >> The problem with DSN is that Users can (and will) modify or delete them by
>> >> mistake, then your program won't work so well. So it's better to use a
>> >> DSN-Less or OLE DB Provider connection string - with a Trusted Connection if
>> >> possible!
>> >>
>> >>
>> >>
>> >> About ODBC data sources
>> >> =============== =
>> >> http://msdn.microsoft.com/library/de...ataSources.asp
>> >>
>> >>
>> >> Login System (ASP.NET)
>> >> =============== =
>> >> http://www.codeproject.com/Purgatory/Login_System.asp
>> >>
>> >> For Anything & Everything, Please Let Me Know
>> >>
>> >> Bye
>> >> Venkat_KL
>>
>>
>>


Nov 19 '05 #13
in Version 1.1 you can use
using System.Data.Odb c;
I'm pretty sure that didn't exist in 1.0,
I don't know if it is still available in 2.0.
However as many have pointed out it is rather ineffcient.
I'm going to assume you probably have a reason that requires a dsn though.
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:OM******** ******@tk2msftn gp13.phx.gbl...
You are trying to use ADO in ASP.NET.

For a zillion reasons that is not good.

re:
I could not believe that Microsoft does not allow
this kind of thing in ASP.Net for SQL connection.


Believe it.

Why would Microsoft include as an option something
which buries performance for web applications ?

Take a few minutes to see this ADO.NET presentation :
http://www.microsoft.com/seminar/sha...7/manifest.xml

Also, read the links on this page :
http://msdn.microsoft.com/library/de...withadonet.asp

Don't beat your head against the wall by trying to use ADO in ASP.NET.
You're only going to hurt yourself.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:AE******** *************** ***********@mic rosoft.com...
Hi Juan,

I see your point, I am not just understanding if DSN definition is
possible
in APS.Net, where and how I will use it?

Here is a connection string I can use it ASP;
Set objADODBConn = CreateObject("A DODB.Connection ")
strConn="DSN=" & MyODBC & ";UID=" & MyUsername & ";PWD=" & MyPassword &
";"
objADODBConn.Op en(strConn)

I could not believe that Microsoft does not allow this kind of thing in
ASP.Net for SQL connection. DSN is still using native SQL Server driver
in
the system.
However thank you very much for your time.


"Juan T. Llibre" wrote:
re:
> once I create DSN how do I use it in the code?

I don't think you can use it, Jim.

There's no way for the DSN or FILEDSN parameters to be inserted
into a SQLConnection or a SQLCommand object, at least as far as I know.

That is why when you asked earlier :
>Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?

I replied : "No, it won't."

And, in the other thread you started on the same subject, I said :

>Other than a DSN is not an property of SqlConnection,
>and therefore you cannot use DSN with a SqlConnection

I just don't think that it can be done.
If you learn a way to do that, please post it and I will change my
opinion.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:EB******** *************** ***********@mic rosoft.com...
> Hi Juan,
> Thanks for the reply. Ok. I understand it might be little bit slow
> through
> DSN, once I create DSN how do I use it in the code? Is there any way I
> can
> create SQLCommand through DSN.
> Thanks,
>
> "Juan T. Llibre" wrote:
>
>> re:
>> >Will this "SqlCommand sqlCmd = new SqlCommand(sqlS tr, myDSN);" work?
>>
>> No, it won't. See my earlier reply.
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> ASPNETFAQ.COM : http://www.aspnetfaq.com/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> =============== =============== ========
>> "JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
>> news:28******** *************** ***********@mic rosoft.com...
>> > Hi Venkat_KL,
>> > Thank you very much for all this great help. Since I am using
>> > "this.sqlConnec tion1.Connectio nString" in many places such as
>> > "SqlCommand
>> > sqlCmd = new SqlCommand(sqlS tr, connStr);" When I read my DSN from
>> > web.config
>> > with the example you gave, how should I use it instead of
>> > "this.sqlConnec tion1.Connectio nString" in my code? Will this
>> > "SqlCommand
>> > sqlCmd = new SqlCommand(sqlS tr, myDSN);" work? I am new in asp.net
>> > and do not
>> > know all these details.
>> > Thanks,
>> >
>> >
>> >
>> >
>> > "Venkat_KL" wrote:
>> >
>> >> Hi Dear JIM.H,
>> >>
>> >> This is the sample where you give all your connection string
>> >> values inside
>> >> the asp.net file (ie. for example: in code behind)
>> >>
>> >> But in your case You have to give
>> >>
>> >> either
>> >>
>> >> "DSN=mySystemDS N;" & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> or
>> >>
>> >> "FILEDSN=c:\som epath\mydb.dsn; " & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> in you web.config in <appSettings> </appSettings> section like
>> >> below
>> >>
>> >> <configuratio n>
>> >> <appSettings>
>> >> <add key="pubsDSN"
>> >> value="DSN=mySy stemDSN;Uid=myU sername;Pwd=myP assword"
>> >> />
>> >> </appSettings>
>> >> </configuration>
>> >>
>> >> OR
>> >>
>> >> <configuratio n>
>> >> <appSettings>
>> >> <add key="pubsFileDS N"
>> >> value="FILEDSN= c:\somepath\myd b.dsn;Uid=myUse rname;Pwd=myPas sword"/>
>> >> </appSettings>
>> >> </configuration>
>> >>
>> >> and
>> >>
>> >> in your code behind to access the web.config file DSN/FileDSN
>> >>
>> >> Dim dsn As String = ConfigurationSe ttings.AppSetti ngs("pubsDSN")
>> >> or
>> >> Dim dsn As String =
>> >> ConfigurationSe ttings.AppSetti ngs("pubsFileDS N")
>> >>
>> >>
>> >> ODBC DSN
>> >> =======
>> >> Using an ODBC DSN (Data Source Name) is a two step process.
>> >>
>> >> 1) You must first create the DSN via the "ODBC Data Source
>> >> Administrator"
>> >> program found in your computer's Control Panel (or Administrative
>> >> Tools menu
>> >> in Windows 2000). Make sure to create a SYSTEM DSN (not a USER
>> >> DSN) when
>> >> using ASP(I think same thing holds good for ASP.NET).
>> >>
>> >> 2) Then use the following connection string - with your own DSN
>> >> name of course.
>> >>
>> >> DSN
>> >> ====
>> >> oConn.Open "DSN=mySystemDS N;" & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> File DSN
>> >> ======
>> >> oConn.Open "FILEDSN=c:\som epath\mydb.dsn; " & _
>> >> "Uid=myUsername ;" & _
>> >> "Pwd=myPassword "
>> >>
>> >> Note:
>> >> ====
>> >> The problem with DSN is that Users can (and will) modify or delete
>> >> them by
>> >> mistake, then your program won't work so well. So it's better to
>> >> use a
>> >> DSN-Less or OLE DB Provider connection string - with a Trusted
>> >> Connection if
>> >> possible!
>> >>
>> >>
>> >>
>> >> About ODBC data sources
>> >> =============== =
>> >> http://msdn.microsoft.com/library/de...ataSources.asp
>> >>
>> >>
>> >> Login System (ASP.NET)
>> >> =============== =
>> >> http://www.codeproject.com/Purgatory/Login_System.asp
>> >>
>> >> For Anything & Everything, Please Let Me Know
>> >>
>> >> Bye
>> >> Venkat_KL
>>
>>
>>


Nov 19 '05 #14

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

Similar topics

5
5719
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ================================================================= Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'. using std::string; ^^^
3
2167
by: Mike L | last post by:
Should the command call "using" be before or after my namespace? **AFTER** namespace DataGridBrowser { using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Collections;
3
2445
by: xzzy | last post by:
I was wondering why we have to have using System.Data using System.Configuration using etc.... why are they not all lumped into one 'using'? In other words, is there a best way to use project classes with 'using' meaning
14
5807
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the SQL DATABASE, probably by the click of a button. Is this possible? & what is the BEST APPROACH for doing this? & also if any links are there do tell those to me too coz I have no idea how to go about doing it.
8
2416
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL into the bin directory but am not able to progress. Can anyone please guide me to an online tutorial on the subject. Thanks,
0
2209
by: Metal2You | last post by:
I'm working on an ASP.NET 2.0 application in Visual Studio 2005 that accesses a Sybase database back end. We're using Sybase SQL Anywhere 9.0.2.3228. I have installed and registered the Sybase .NET 2.0 DataProvider (iAnywhere.Data.AsaClient.dll) into the GAC so it can be used in the ProviderName property of a SQLDataSource and loads properly at run time. The application I'm writing is a bit more complex than the example I'm about to...
10
1975
by: mg | last post by:
I'm migrating from VB6 and have a question about using 'Using' and the best way to use it. Here is a example of a small bit of code: dbConx("open") Using CN Dim CMD As New OleDbCommand(sSQL, CN) Dim DR As OleDbDataReader = CMD.ExecuteReader()
0
2577
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation link (1,2,3 so on). The code can be found in SubscriptionCart.aspx.cs. Default.aspx ------------
3
8304
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0 build with these methods, will appear to encrypt and decrypt, but the resulting decrypted file will be corrupted. I tried encrypting a .bmp file and then decrypting, the resulting decrypted file under .NET 2.0 is garbage, the .NET 1.1 build works...
6
5177
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick application working. However, when attempting to implement the solution, the AJAX calls weren't updating the screen like the examples were and seemed not to fire until after the long running process had completed. I found the only real...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.