Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is SQL authentification?

Status
Not open for further replies.

lehuong

Programmer
Sep 2, 2003
98
US
Hi all,
What is SQL authentification? and how to set it up on the web.config in order to user it?
Thanks a lot
lehuong
 
Someone can correct me here if I am wrong but SQL Authentication is when you use a SQL login name and password as opposed to a Windows login name and password to access a SQL Server.

To set it up in web.config - you could just add a connection string as a key in the <appSettings> section in your web.config and return this from your code e.g.

<add key="ConnectionString" value="data source=YOURSERVER;initial catalog=YourDatabase;user id=sa;password=password;" />

You can then access this key in code as follows:

Code:
string connStr = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]

Hope this helps!

Craftor
:cool:
 
Thanks,
I think you are right. but how about the authentification mode? Is it a mode = "Forms" Or "Windows"?

<authentication mode="Forms" >
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>

Thanks
lehuong
 
Aah what you're looking that is your application's authentication. That has nothing to do with SQL authentication, unfortunately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top