Connection String For dotnet framework
Vb.net Connectivity
'VB
Dim connection as DbConnection = new SqlConnection()
connection.ConnectionString = _
"Server=.;Database=pubs;Trusted_Connection=true" connection.Open()
'Do lots of cool work here
connection.Close()
C# Connectivity
//C#
DbConnection connection = new SqlConnection();connection.ConnectionString =
"Server=.;Database=pubs;Trusted_Connection=true"; connection.Open();
//Do lots of cool work here connection.Close();
Creating an instance of the SqlConnection class using the SQL Server .NET provider creates
the DbConnection. The ConnectionString property is initialized to use the local machine (".")
and the database is set to pubs. Lastly, the connection uses a trusted connection for
authentication when connecting to SQL Server.
Dotnet, DotnetCore, Azure, C#,VB.net, Sql Server, WCF, MVC ,Linq, Javascript and Jquery
Subscribe to:
Post Comments (Atom)
Implementing OAuth validation in a Web API
I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...
-
ViewBag, ViewData, TempData and View State in MVC ASP.NET MVC offers us three options ViewData, ViewBag and TempData for passing data from...
-
// Export Datatable to Excel in C# Windows application using System; using System.Data; using System.IO; using System.Windows.Forms; ...
Also Check this link
ReplyDeletehttp://msdn.microsoft.com/en-us/library/aa720188%28VS.71%29.aspx