HI

I wrote below coding part,but its generate the exception.Below I mention the code and error
Error
Data type mismatch in criteria expression.

DataSet Serach_sumbitdata=new DataSet();
            OleDbConnection conn7 = this.getconnection();
            conn7.Open();
            string str = "Select * from Customer where SubmitDate between '" + str1 + " 12:00:00 AM'" + " and '" + str2 + " 12:00:00 PM'";
            OleDbCommand command = new OleDbCommand(str, conn7);
            OleDbDataAdapter adapater = new OleDbDataAdapter(command);
            adapater.Fill(Serach_sumbitdata);

Please help me

Thanks
Tank50

Well This error occurs when the server tries to process a page containing an Insert Record or Update Record server behavior, and the server behavior attempts to set the value of a Date/Time column in a Microsoft Access database to an empty string ("").

Hi

Thanks avirag for quick reply.But I didnt get u what u said above

Thanks
Tank50

Dates need to be enclosed with hash (#) symbol. Try:

string str = "Select * from Customer where SubmitDate between #" + str1 + " 12:00:00 AM#" + " and #" + str2 + " 12:00:00 PM#";

Hi

Thanks DdoubleD its works.

Thanks
Tank50

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.