Okay I know there are a lot of questions regarding this issue but I can't seem to find a solution there. Plus a lot of them were using Hardcode queries but I am using xsd files to connect to the SQL server 2014. Following is the exception:
And this is my connection string:
Data Source=NLNT832\SQLEXPRESS,2301;Initial Catalog=IPC_DATABASE;Persist Security Info=True;User ID=ipc_sp_user;Password=omr@n123
I checked the table exists, so as the user. I can connect to the database, see the table in the list, run queries from xsd. But whenever I try to run it through C# it throws the above exception.
My C# code is something like this:
using (DSIPCDatabaseTableAdapters.QueriesTableAdapter queries = new DSIPCDatabaseTableAdapters.QueriesTableAdapter()) {
queries.ChangeConnection(DBUtils.GetInstance.GetConnectionString);
try
{
object o = queries.AddUser(textBox1.Text.ToString(), textBox2.Text.ToString(), comboBox1.SelectedValue.ToString());
if (o != null)
showOptionDialog();
else
MessageBox.Show("Insertion Error!");
}
catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
}
Below is the screenshot of the table present in the database and accessible by the username provided.
FYI I urge you to think twice before marking it as a duplicate.