am new with c# so plz be patient with me..
i have created a database and i wanna connect my application with it
while am searching i found this code:
using System;
using System.Data.SqlClient;
namespace ConsoleCSharp
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class DataReader_SQL
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
try
{
SqlConnection thisConnection = new SqlConnection("Data Source=,1433;database=Database2;User id=;Password=;");
SqlCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "SELECT CustomerID, CompanyName FROM Customers";
SqlDataReader thisReader = thisCommand.ExecuteReader();
while (thisReader.Read())
{
Console.WriteLine("\t{0}\t{1}", thisReader["CustomerID"], thisReader["CompanyName"]);
}
thisReader.Close();
thisConnection.Close();
}
catch (SqlException e)
{
Console.WriteLine(e.Message);
}
}
}
}
so my question is how can i change the user id and password i have tried to
add the password in the xml configuration file however i still have exception
plz help me out i wanna knew how can i connect my application with the
database using the connection string
thanks alot