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

U can use "AND" to search two Strings

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.