well im login in sql server through window authentication then wat code i should write in C# to write my connection string


urgenttttttttttt

Recommended Answers

All 3 Replies

string constr = string.Format( "Data Source={0};Initial Catalog={1};Integrated Security=SSPI", YourServerName,YourDatabaseName);

add this code in module :

Imports System.Data
Imports System.Data.SqlClient

Module Connection
    Public conn As New SqlConnection("Server = YourNameServer;" & "initial Catalog = YourDatabaseName;" & " Trusted_Connection=yes")
End Module
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.