Hi Guys!

I am using the following Connection Strings for ms sql. I am new in programing so help me.

Eror:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'Administrator'.

Source Error:

Line 27:
Line 28: SqlConnection conn = new SqlConnection(ConnStr);
Line 29: conn.Open();
Line 30:
Line 31: string Query = "insert into CustomerInfo(ReportingPlace, BelongingArea, Name,Address, POBox, City,Country, Phone, Mobile, Email, Website, CustomerType, ReferedBy, Remarks) " +

======================================================================================

<connectionStrings>
    <add name="DaniConnectionString" 
connectionString="Data Source=DANISH-AHMED\Administrator;
Initial Catalog=Dani_Test;
User ID=Administrator;
Password=danish106" providerName="System.Data.SqlClient"/>
</connectionStrings>

try following code for inserting data using asp.net
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
SqlCommand cmd = new SqlCommand(StrSql, conn);
int i = cmd.ExecuteNonQuery();
conn.Close();
return i;

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.