Sunday, July 12, 2009

Hi, i have a problem with Ms visual studio.net, any body can help?

I'm working with C#.NET, I want to access a database (Ms Access database) but I dont know how to do that? any body can help? plz!!!

Hi, i have a problem with Ms visual studio.net, any body can help?
Go to the Data menu and choose Add New Data Source





Select Database and click Next





Click the New Connection button





Click Change next to the Data Source label





Choose Microsoft Access Database File from the menu





Click OK





Next to the Database file name field, click Browse





Browse to the location of your Access database (remember, this will need to remain consistent for all users of your application; if you are doing a Web site, put the DB in the App_Data folder; if you are doing a standalone program, use a URL that will always be correct, either someplace in the application path or with a \\server\share type URI that will be good for all users)





Provide the authentication information if there is any; if not, blank out the authentication textboxes





Click Test Connection to make sure you can connect





If you connected OK, click the OK button to close the confirmation message box





Click OK to close the DB connection dialog





Click Next





If the database is not in your application path, and you get a confirmation box telling you it wants to move the file, choose OK to move the DB to the path, or cancel to not move it.





Give the connection a meaningful name





Click Next





Choose the tables and views (queries) you want to include in your project's DataSet





Give the DataSet a meaningful name





Click Finish





You now have all the data you selected available to you as an XSD file.





You can also view your DB by clicking on the Server Explorer tab . You can see the Server Explorer tab if it's not visible by choosing it from the View menu
Reply:That's a tough question to answer. I think it's not just a matter of posting a couple of lines of code. I'd suggest going to www.codeproject.com and looking around for sample code.





Good luck!


No comments:

Post a Comment