
Usually we are inserting record one by one in SQL server database using Asp.Net web application form. Some time we attempt to insert a record what is already exist in sql server database wrongly. In this circumstance the application display a run time error. User can not understand this error and its not user friendly error.
To avoid this we can set a message as warning while we try to insert duplicate record whether its primary key or not. In this tutorial you can learn how to check record exists before performing insert operation in Asp.Net c# with sql server step by step. If the record exist in SQL Database you can see a message that "Student ID Already Exist. See bellow". Then user can easily understand that what record he want to insert, It's available in his database. and he can check the record in the existing list available in below GridView.
This is very easy to check whether record exist or not in string variable and nvarchar(100) datatype, but it is not so easy to check records exist or not in datatype int. Because in int datatype can not pass null value. So we need to convert string so that it pass null value easily.
Complete CRUD Operation in Asp.Net C# With SQL Server Step By Step
https://youtu.be/I5cWkoMeQIY
CRUD in C# With SQL Using Linq | Insert Delete Update Search in SQL in C# Linq to SQL Class
https://youtu.be/zrzjuXV2qP0
Complete CRUD in C# With SQL using ConnectionString
https://youtu.be/4bQfxbSj4tg
------
This channel covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.
https://www.youtube.com/c/ProgrammingGeek/playlists
Visit my page in Facebook
https://www.facebook.com/programminggeek7
------
#IfRecordExistBeforeInsertOperationInAspNetSQL #DuplicateRecordInsert #CheckRecordExistSQL
programminggeek,how to check if record exists before insert in asp.net c#,check studentid exist in c#,check record exist in asp.net c#, asp.net c# check record available in database,insert record after check,check duplicate,duplicate value,prevent insert of duplicated records sql,learn c#,check record exists in sql server,check record exist before update
0 Comments