c# - how to assign int value to SELECT database string? -
i used dataadapter use select common choose rows of table
oledbdataadapter objdataadapter = new oledbdataadapter("select * table daynum = @daynum", objconnection); //here daynum must equal 10; daynum = 10
i want assign integer value @daynum
for example
int intday = 10; objcommand.parameters.addwithvalue(intday.tostring(),"@daynum");
but don't work
how can fix problem?
remove .tostring()
. try this:
objcommand.parameters.addwithvalue("@daynum",intday);
Comments
Post a Comment