i have creatng the web base project online quiz system which have Admin, Faculty members, students , Admin have registered the faculty members and student , faculty create the quiz and student take quiz and view result ,
when i have trying to insert faculty data into data base the error occurred
(Invalid object name 'tbl_faculty_). tbl_faculty is the table name in my data base .
What I have tried:
protected void btnInsert_Click(object sender, EventArgs e)
{
using (SqlConnection conn = new SqlConnection(@"Data Source=.;Initial Catalog=file_record;Integrated Security=True"))
{
SqlCommand CmdSql = new SqlCommand("INSERT INTO [tbl_faculty] (fac_name,fac_password,fac_ID,fac_dep) VALUES (@fac_name,@fac_password,@fac_ID,@fac_dep)", conn);
conn.Open();
CmdSql.Parameters.AddWithValue("@fac_name", facname.Text);
CmdSql.Parameters.AddWithValue("@fac_password", Password.Text);
CmdSql.Parameters.AddWithValue("@fac_id", facultyID.Text);
CmdSql.Parameters.AddWithValue("@fac_dep", ddDeptName.SelectedItem.Value);
//CmdSql.Parameters.AddWithValue("@Year", TextBox5.Text);
//CmdSql.Parameters.AddWithValue("@Description", TextBox6.Text);
CmdSql.ExecuteNonQuery();
conn.Close();
}