Hi all, I have this problem whereby I can still insert values which are already in the database.
This are my codes :
protected void btnSubmit_Click(object sender, EventArgs e)
{
string ChapName = ChapterName.Text;
string SubChapName = SubChapterName.Text;
string Sub = "";
SqlConnection conn3 = new SqlConnection(connStr);
SqlCommand cmdID = new SqlCommand("Select t.TutID, t.TutTitle, s.SubTutText,s.SubTutID from [SubTutorial] s , [Tutorial] t where t.TutTitle = '"+ChapName+"' ORDER BY t.TutTitle,s.SubTutText ASC", conn3);
conn3.Open();
SqlDataReader IDReader;
IDReader = cmdID.ExecuteReader();
string tut2 = "";
string sub2 = "";
if (IDReader.Read())
{
tut2 = (IDReader["TutID"].ToString());
sub2 = (IDReader["SubTutID"].ToString());
Session["TutID"] = tut2;
Session["SubTutID"] ...
Go to the complete details ...