c# - The provider could not determine the Object value exception with Access database -


i trying apply query on access database :

oledbconnection acessconn = database.con_accessa_m(acessdbs[i]);  string acessquery = "select ltrim(mid([owner], 1, instr( [owner],'/')-1)) 'lastname',iif( instr( ltrim(mid([owner], instr( [owner], '/')+1)), '/')>0,ltrim(mid(ltrim(mid([owner], instr( [owner], '/')+1)),1,instr( ltrim(mid([owner], instr( [owner], '/')+1)), '/')-1)),ltrim(mid([owner], instr( [owner], '/')+1))) 'firstname',city policies";  datatable policies = new datatable();  acessconn.open(); oledbcommand myaccesscommand = new oledbcommand(acessquery, acessconn); oledbdataadapter mydataadapter = new oledbdataadapter(myaccesscommand); mydataadapter.fill(policies); acessconn.close(); 

the connection working perfect got exception in mydataadapter.fill(policies); :

"the provider not determine object value. example, row created, default object column not available, , consumer had not yet set new object value."

note :the query working on microsoft access.

the connection string is:

string accconnstring = "provider=microsoft.ace.oledb.12.0;data source=" + folderserverpath;`  

where folderserverpath database path on server.

why did error , solution ?

i had problem when converting access sql server using sql server migration assistant access. fix problem opened offending access database. file > "compact & repair". saved , closed access database. re-imported database , worked fine.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -