c# database setup
I am trying 开发者_高级运维to get some data stored in a database that i can query at a later date to display a record. I can make the database in visual studio 2010 no problems with all the fields i need. I just can seem to get the program to access it and add any data. I also have searched for help on the internet but they all seem to not work for me they say that the cannot find the database. I currently have no code to show because i am not sure what i should be doing. Any good websites to view could be helpful i cant find any good ones.
thanks in advance
There is a database tool called Server Explorer
that is shipped with visual studio 2010.
To access it navigate to View->Server Explorer
(or Ctrl+W,L
). Then right-click on Data Connections
and select Add Connection
or Create new SQL Database
depending on your needs. Once you have a connection setup you can edit tables, insert data etc from the server explorer. If you for example have a local SQL Server running its just to select your own computer as server name (should appear in the drop down list), use windows authentication as login method and choose a name for your new db.
Side note: the server explorer works for other databases as well but may require that you install additional connectors etc.
Another good tool to manage your SQL databases is the SQL Server Management Studio
. It needs to be installed separately, a guide to do so is available here: Installing SQL Server Management Studio Express 2008. In my opinion this interface gives you better control of your databases, tables, stored procedures etc.
You can find basic information about database access on msdn.
精彩评论