-3
private void Form1_Load(object sender, EventArgs e)
{
SqlConnection baglanti = new SqlConnection();
baglanti.ConnectionString = "Server=DELL\\SQLEXPRESS; Database=Ibrahimoz; Integrated Security=true; ";
SqlCommand komut = new SqlCommand();
komut.CommandText = "select * from User";
komut.Connection = baglanti;
baglanti.Open();
SqlDataReader rdr= komut.ExecuteReader();
while (rdr.Read())
{
string adi = rdr["Name"].ToString();
string familya = rdr["Surname"].ToString();
listbox.Items.Add(string.Format("{0} - {1}" ,adi ,familya));
}
baglanti.Close();
SQL连接和错误:错误:System.Data.SqlClient.SqlException:'无法打开数据库“Ibrahimoz”请求登录。登录失败。用户登录失败
baglan.open(); cannot request database()
System.Data.SqlClient.SqlException: 'Cannot open database "Ibrahimoz" requested by the login. The login failed. Login failed for user
请帮助我。