I have visual studio 2008 and sql server 2005.Both of the softwares are going to be well installed but there is a problem in database connectivity in between when I am writing a program to access the data through SQL server 2005. THis kind of mentioned error is displaying: there is a problem in login with this user name
Given it is a web application your web.config file should have the db connection string something like: <connectionStrings> <add name="NameOfCS" connectionString="Data Source=LocalHost;Initial Catalog=DBName;Persist Security Info=True;User ID=Username;Password=XXX" providerName="System.Data.SqlClient" /> </connectionStrings> Code (markup): Using CodeBehind you simply use it as: Dim SQL As New SqlCommand SQL.Connection = New SqlConnection(ConfigurationManager.ConnectionStrings("NameOfCS").ConnectionString) Code (markup): Or for a component: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NameOfCS %>" /> Code (markup): If the db is remote, ensure it allows remote connections. If it is local, make sure it has the right ports open or specify the open ports in the connection string