c# - Checking data in sql while inserting values -


I wanted to know how to view data in the table before inserting it. For example: When I am inserting, I have to see that if the eventstart value is the same in the table, then StartDate and the same < If there is an error message, then enter the value (text, EventStart), [eventend], [repeat], [day], [room], [startdate] values, if it is with code> cell Insert

  in (text, EventStart, Event End, Event) , Day, room, start date)  

I just use a query like this having had. If the count is not 0, then at least one duplicate.

  SELECT COUNT (*) events where start = @startdate and cell = @ room and EventStart = @EventStart  

I put it in the context of your project (you believe that you are using SQL Commands etc.), but you did not include any of that code in your question.


If you are asking how to check duplicates at the same time, then you are trying to insert records (and not immediately, in a different query), then I ' I'm not sure I would not be surprised if there was any way, I did not know this.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -