I used DataAdapter for use SELECT common to choose rows of Table
OleDbDataAdapter objDataAdapter = new OleDbDataAdapter("SELECT * FROM Table WHERE dayNum = @dayNum", objConnection); //here dayNum must be equal to 10; dayNum = 10
I want assign an integer value to @dayNum
for example
int intDay = 10;
objCommand.Parameters.AddWithValue(intDay.ToString(),"@dayNum");
but it don't work
how can fix this problem?
objCommandand how it is related toobjDataAdapter, looks like you are using command text inDataAdapterinstead of using existing Command Object, also swap parameter name and value in adding parameter.