I have set up a database (QCDB) in my SQLEXPRESS instance. I have added a user (QCast) with serveradmin, sysadmin, and public server roles enabled at the server level. The user has db_owner role at the db level. But when connecting to the db with the below command in VS
string strConn = "Data Source=STA15-DT-ADM\\SQLEXPRESS;AttachDbFilename=C\\Program Files\\Microsoft SQL Server\\MSSQL14.SQLEXPRESS\\MSSQL\\DATA\\QCDB.mdf;User Id=QCast;Password=QC@st;Connect Timeout=30";
SqlConnection con = new SqlConnection(strConn);
string dbget = "SELECT WOnum WOstatus FROM WOdetail";
SqlCommand cmd = new SqlCommand(dbget, con);
con.Open();
SqlDataAdapter ad = new SqlDataAdapter(cmd);
DataTable dt = new DataTable("Results");
ad.Fill(dt);
WOgrid.ItemsSource = dt.DefaultView;
cmd.Dispose();
con.Close();...