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

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -