database - How to connect MS ACCESS DB with my asp.net website -


i trying connect ms access db asp.net website. when run code(on localhost only) not show error or exception wait server response. following code :

 string connection = "provider =microsoft.ace.oledb.12.0; datasource=i:/adittya/test.accdb"; string query = "select * test"; oledbconnection con = new oledbconnection(connection); oledbcommand cmd = new oledbcommand(); cmd.commandtext = query; cmd.commandtype = commandtype.text; oledbdatareader dr = cmd.executereader(); datatable dt = new datatable(); dt.load(dr); testgrid.datasource = dt; testgrid.databind(); 

one more thing db in pen-drive location static.

do have problem code or cannot connect db present in pen-drive.

try data source as

datasource=i:\\adittya\\test.accdb 

Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -