TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marvin Retro
NA
7
525
Check if Date Already Existed
Oct 10 2017 1:15 PM
I have my code here i wish check if the reservation date is already not available
BTW I have a button so after clicking it one time " It said Available " but after clicking it again it will not show anything
can someone please help me or correct what if what is wrong with my code
ty for those who are willing help :)
DataSet myDataSet = new DataSet();
try
{
connection.Open();
string strAccessSelect = "select count(*) from Borrow where DUEDATE = '" + due3.Text + "' AND BOOK_NUMBER = '" + bno.Text + "'";
OleDbCommand myAccessCommand = new OleDbCommand(strAccessSelect, connection);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myAccessCommand);
connection.Open();
myDataAdapter.Fill(myDataSet, "Borrow");
}
catch (Exception ex)
{
Console.WriteLine("Error: Failed to retrieve the required data from the DataBase.\n{0}", ex.Message);
return;
}
finally
{
connection.Close();
}
DataTable dt = myDataSet.Tables[0];
if (dt != null)
{
if (int.Parse(dt.Rows[0][5].ToString()) > 0)
{
MessageBox.Show(" Not Available");
}
else
{
MessageBox.Show(" Available");
}
}
Reply
Answers (
1
)
pass column value from a datagridview to checkedlistbox
Windows CE Mobile Device Project