我想在名为R_Kitap_Al
的关系表中插入一个元组。但是我得到了这个错误:
System.Data.SqlClient.SqlException(0x80131904):无效的对象名称' Kitap_Al'。
但我没有Kitap_Al
表。我想这是我原来的名字。因为我得到了这个错误,但我该怎么办呢。
private void button1_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(@"Data Source=HP\SQLEXPRESS;Initial Catalog=Kütüphane;Integrated Security=True");
conn.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO R_Kitap_Al (SSN, Book_No, BaslamaTarihi, BitisTarihi) VALUES (@SSN, @Book_No, @BaslamaTarihi, @BitisTarihi)", conn);
DateTime dt = new DateTime();
cmd.Parameters.AddWithValue("@SSN", sSNTextBox.Text);
cmd.Parameters.AddWithValue("@Book_No", book_NoTextBox.Text);
//cmd.Parameters.AddWithValue("@BookName",bookNameTextBox.Text);
cmd.Parameters.AddWithValue("@BaslamaTarihi", baslamaTarihiDateTimePicker.Value);
dt = Convert.ToDateTime(baslamaTarihiDateTimePicker.Value);
dt = dt.AddDays(0);
bitisTarihiDateTimePicker.Value = dt.AddDays(15);
cmd.Parameters.AddWithValue("@BitisTarihi", bitisTarihiDateTimePicker.Value);
cmd.ExecuteNonQuery();
this.Hide();
R_Kitap_Al kit = new R_Kitap_Al();
kit.ShowDialog();
this.Close();
}
答案 0 :(得分:1)
表R_Kitap_Al
是否有与之关联的触发器。触发器是否有误并访问Kittap_AI
?