טיפול ב- ERROE ב- ASPNET

amera

New member
טיפול ב- ERROE ב- ASPNET

יש לי טבלה של תעודות זהות כמפתח ראשי. כאשר אני מוסיף תעודת זהות קיימת אז יש את הבעיה השכיחה. אני יכול לעשות בדיקה לפני ההוספה ואם RS.EOF אזי אני מוסיף. אבל יש ב- ASP NET טיפול ב- ERRORS, משהו עם TRY , CATCH, ..... מה אני בדיוק כותב כך שאם תהיה הוספה לתעודת זהות קיימת, אני אקבל הודעה שהמספר כבר קיים במקום לקבל הודעה גסה כמו:
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.​
 

amera

New member
מערך

איך מגדירים מערך? ניסיתי הבא ולא עבד לי
String[] strArray strArray = split(session("class_id"),",") Dim x As String = strArray[0]​
 
למעלה