0

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>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by crishlay
0

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;

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.