我收到此错误消息
无法打开登录请求的数据库“股票”。登录失败。用户 'user-pc\computer' 登录失败。
我写的代码:
protected void btnSubmit_Click(object sender, EventArgs e)
{
using (SqlConnection con = new SqlConnection("Data Source=user-pc\\SQLEXPRESS;Initial Catalog=stock; Integrated Security=True;User Instance=True"))
{
using(SqlCommand cmd=new SqlCommand("Select username,password from userprofile where username=@username",con))
{
cmd.Parameters.AddWithValue("@username", txtUserName.Text);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
string userid = dt.Rows[0]["username"].ToString();
它显示错误da.fill(dt)