sql server - SQL Statement not retrieving any results -
i seem have hit hole in road code (again) doesn't seem working: sort-of follow previous question regarding sql inner joining. (you can view here how can retrieve data sql statement based on 2 table's criteria)
so trying retrieve data (name(s) of drivers) based on criteria after executing sql statement seems no results.
here sql statement:
sqlcommand test = new sqlcommand( "select[dp_name] from[driverprofile] dp inner join driverprofilesettings dps on dps.dps_dp_fk = dp.dp_pk dps.[dps_routeallocation] in ( ' " + "8" + " ' )",con);
in database:
- driverprofile table contains name (dp_name)
- driverprofilesettingscontains routes driver allowed drive in (dps_routeallocation), set values "8" (without quotes) in order test sql statement.
- driverprofilesettings contains primary key (dps_dp_fk) of driverprofile.
note:
- i have tried removing single quotes ( ' ') , on statement still doesn't show results.
- i coding in c# (using visual studio)
any appreciated!
you have spaces around 8. try changing ( '" + "8" + "' )
, or if dps_routeallocation
numeric field, remove single quotes ( " + "8" + " )
Comments
Post a Comment