I had a table jobmaster table with a field shipment date(date/time type in shorttime format) and in a windows form I want to call all data from the table where
shipment date = value
from a data picker.
I tried a lot with it.
(in access database )
shipmentdate =Date/Time; format=Short Date
in c# coding
<pre>class jobcodedatabean{
dateTime shipmentdate;
}
///////////////////////////
datetime picker
dtpshipmentdate;
format=short;
assigning
jobcodedatabean.shipmentdate=dtpshipmentdate.value;
insert into jobmastertable (shipment date)values('"jobcodedatabean.shipmentdate"')
Now in my function i want to select all data from table
i used
DateTime time = dtpfromDate.Value;
String query = "Select jobcode,companyName,vehicleno,shipmentdate,totalamount,advance,drivername,fromPlace,destination from jobmastertable where (shipmentdate=" + @shipmentdate + ")";
OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
dAdapter.SelectCommand.Parameters.AddWithValue("@shipmentdate", time);
DataSet ds = new DataSet();
dAdapter.Fill(ds, "tbljobmastertable");
tblpaymentview.DataSource = ds.Tables["tblpaymentview"].DefaultView;
Help me. This returns nothing .