hii,,i am using asp.net 2005 and sql server 2005.i hav a insert page thr which i can insert details to a table in the database,,thrs a column called sme_id in the table.....what i want is when a user inserts the sme_id from the webpage,it should check from the table whether tht id exists or not just to avoid duplicate of sme_id,,,,,the code given below is working fine,,i am using sqldatasource for the insert query.....
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:sme_trackerConnectionString %>"
InsertCommand="INSERT INTO SME_Master(SME_Id, FirstName, LastName, Type_of_SME, Agency_id, Agency_Name, Email, Address, Phone, Mobile, Fax, TimeZone_Id, Experience, City, State, Status, Level_Of_Exam, Other_Comments, Certificate, Expertise)
VALUES (@SME_Id, @FirstName, @LastName, @Type_of_SME, @Agency_id, @Agency_Name, @Email, @Address, @Phone, @Mobile, @Fax, @TimeZone_Id, @Experience, @City, @State, @Status, @Level_Of_Exam, @Other_Comments, @Certificate, @Expertise)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [SME_Master]">
hope u understand what i want,,,,reply as soon as possible,,thnks in advance