0

Hello i am making my project i am stuck at searching two strings in database
for example my table [hotel] contains columns

[Date] [Room Size] [Meal] [Car]

i want to search for date + room size too.

my code checks only [Date] but not [Room Size]

and i want that if some one puts "12 Dec" (as search string) and in second textbox "4"
first it checks date and then availability for room size and return the room size value.

hope everyone understand my problem.

string date = textBox1.Text;
            string room = textbox1.text
            loaddata = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=Hotel.mdb");
            data = new OleDbDataAdapter("Select * from [hotel] where (Date='" + PNR + "')", loaddata);

so far my date code works

Edited by shayankhan: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by shayankhan
0

U can use "AND" to search two Strings

Select * from [table] where arg1="val" AND arg2="val2";

0

hirushan ok thanks for your help can i ask 1 more question..
if you dont mind


i want that if date is found in table then it retrieve the column 3 value .
means if date is in column 1 and row 2 .. so that the value of column 3 raw 2 is returned.
or save in any string or int.

Edited by shayankhan: confused question

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.