please help me for my SAD. On the dataGridview, there is a time - TopicsExpress



          

please help me for my SAD. On the dataGridview, there is a time that range 7:00AM-8;30AM , i have a code which if i enter the same time range 7:00AM-8;30AM it conflicts and tell the user that there is already schedule time for that particular room. When i add 7:30AM-8:00AM or 8:00AM-9:30AM, it will add to the database. How can i conflict the time range 7:30AM-8:00AM or 8:00AM-9:30AM, to the first time range 7:00AM-8;30AM. THANKS. MY OCCUPIEDTIME ON DATABASE IS TEXT ONLY ------------------------------------------------------------------------------------- con.ConnectionString = Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\personal\Documents\CCSRM.accdb con.Open() Dim dr As OleDb.OleDbDataReader Dim cmd1 As OleDb.OleDbCommand sql = SELECT * FROM Monday WHERE OCCUPIED_TIME = & TextBox1.Text & cmd1 = New OleDb.OleDbCommand(sql, con) dr = cmd1.ExecuteReader() If Not dr.HasRows Then sql = Insert into Monday Values ( & TextBox1.Text & , & TextBox2.Text & , & TextBox3.Text & , & TextBox4.Text & ) cmd1 = New OleDb.OleDbCommand(sql, con) cmd1.ExecuteNonQuery() MsgBox(Room Schedule was Added) Else MsgBox(Time has conflict with another schedule, vbCritical) End If con.Close()
Posted on: Wed, 24 Sep 2014 17:09:04 +0000

Trending Topics



Recently Viewed Topics




© 2015