-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
請幫助我。