This is the Common Problem we are facing in Server DB Connection in Asp.net.If you are using windows authentication to connect to the Server DB, you need to set “Trusted_Connection=True;” if you're using SQL Server authentication, you would like to declare User “Id=myUsername; Password=myPassword;”
Code Snippet In Web.Config:
Windows authentication
<add name="windowsConnection" connectionString="Server=localhost; Database=databasename; Trusted_Connection=True;" />
SQL server authentication
<add name="Sqlserverconnection" connectionstring="server=localhost; Database=databasename;uid=db; password=123 "/>
Do you know:-
- How to Retrieve data using dataset in c#
- How can I prevent the browser back button After Logout
- Calendar Control in c# Windows Application
- Timer tick event in c# windows application
- How to delete record in c# using the connected approach
- [Connect] to Database c# Through Code
- The Command Class | C# | TrickCode
- C# DataReader ADO.NET |Trickcode
- What is disconnected data access?
- how to Adding Parameters to Commands
- SQL Basics?
- What is Database Preparations?
- SQL vs NoSQL or MySQL vs MongoDB
- What is data provider in C#?
- What is connection string C#?
- [SQL] SELECT Statement | Example
- how to get return value from stored procedure in sql server
- how to prevent sql injection attacks
- What is Database? What is SQL?
- C#.Net How To: Send email in asp.net using c#
If you like the tutorial, then please share this tutorial with your friends on social media.
Post A Comment:
0 comments: