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 React.js
Showing posts with label Connection String For dotnet framework Vb.net and C# Connectivity. Show all posts
Showing posts with label Connection String For dotnet framework Vb.net and C# Connectivity. Show all posts
Subscribe to:
Posts (Atom)
Find number of letter occurence of all letter in c#
Find number of letter occurence of all letter in c# namespace ConsoleApp1 { internal class Program { static void Main(st...