且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查datagridview中的选定日期存在于数据库中

更新时间:2023-01-27 18:11:19

嗨专业

有很多方法可以做这个任务可能有人告诉你聪明的方式或某些不是那样但是根据我的逻辑,你有这个两个任务......



1.当用户选择第一个表的日期时,你必须在变量(sql查询)中取这个日期。



2.然后在第二个和主要任务中使用sql select with where =''" + your variable +"''conditon query你必须在secound表中读取那天如果得到HasRow = true或datareader dr.read()make true ...那么你必须最后弹出你的massegeDate Not Allowed..



你是否真的想与你分享......你有什么疑问下面的plz评论或者想要从我的结束然后的逻辑......但是第一次尝试从你的结束...



乐于助人
hi professional
there is many way to do this task may some one told you smart way or some one not that way but over all as per my logic for this you have two task...

1. when user select the date of 1st table then you have to take that date in a variable(sql query).

2. and in 2nd and main task then using sql select with where=''"+your variable+"'' conditon query you have to read that day in secound table and if get HasRow= true or datareader dr.read() make true...then you have to finally pop up your massege that "Date Not Allowed"..

Are you getting na that what actually i want to share with you....have any doubt plz comment below or want logic from my end then also...but 1st try from your end...

Happy to help