Last post Aug 14, 2017 02:44 AM by JohnsonWelch
Aug 12, 2017 08:39 AM|amir-iftikhar|LINK
protected void showUsers_Click(object sender, EventArgs e)
find = BulletedList1.Items.FindByText("352263").ToString();
idBox.Text = find.ToString();
protected void showName_Click(object sender, EventArgs e)
using (SqlConnection conn = new SqlConnection("Data Source=sinkclient.com;Initial Catalog=MLM_Database;User
using (SqlCommand cmd = new SqlCommand("SELECT cust_Name FROM Customer_Info WHERE cust_ID = '352263'",conn))
using (SqlDataReader Reader = cmd.ExecuteReader())
NameBox.Text = Reader["cust_Name"].ToString();
A BulletedList is DataBound and it shows correct data from same database. While opening connection between SQL Server 2012 and ASP.Net WebForms application on ButtonClick event, this exception occurs: Login Failed for user 'username'. The credentials provided
in the connection string are also correct. Exception occurs at conn.Open();
Aug 13, 2017 12:08 PM|PatriceSc|LINK
So if it works at some other places, you really triple checked which connection string is used at this other place? Avoid to do things multiple time and in particular to define the connection string at multiple places in your app.
For now I suspect maybe using Windows autrhentication on one side and SQL Server authentication here (not enabled by default) here?
If it doesn't help please avoid to truncate error messages. I would expect at least some SQL Server error code being part of the message which might help to better narrow down the exact problem.
Aug 14, 2017 02:44 AM|Cathy Zou|LINK
Hi Amir Iftikhar
Please follow below steps to change your window authentication to mixed authentication.
1. Login your sql server
2. Right click your instance and go to properties.
3. In security, change your server authentication to sql server and Windows Authentication.
If you are not able to login with your SQL Server username after following above steps, it is quite possible your username is incorrect, please check again.
If you still have some problem, please check the following links:
Mar 19, 2018 01:06 PM|JohnsonWelch|LINK
There could be various reasons for getting SQL Server Error 18456 like incorrect password, inaccessible database, orphaned login etc according to its different states. You can check your error logs to know the state of the password error and go through
the following blog to determine the state of error and hence resolve your issue: