Home » Visual StudioRSS

connecting to my sql express database from vs express 2010???

i have asked this question before. I have set up databases with dream weaver and mysql, this cant be more difficult?
 

9 Answers Found

 

Answer 1

Data menu -> Add new data source, then go through the dialog steps to identify and connect to your SQL Express database.
 

Answer 2

I'm not sure why I have not got an answer to this question. I have gone back and forth with this question sense June of last year. It cant be that I have not asked the question correctly. Once I asked If I bought a brand new computer, then installed the latest versions of visual studio express and sql server express. How would I connect from vb to sql? that thread got no answer. I asked again in December and got no answer. I have used dream weaver, php, and mysql. and made a functional e-commerce website. I can tell you that I don't like technology making everything stupid with wizards and such. I don't mean to seem like a jerk, but all I want to do is start building my program. That is all! yet here I am still pulling my hair out. I'm 23 years old I'm an L1 master automotive Tech. I rebuild transmissions. I'm not an idiot. and I'm not stupid. I obviously am not getting along with the way microsoft does things. I i'm not good at learning by just being told to click this or enter here. I am a detailed learner. I like to know what, how, and why things work the way they do. I;m not interested in servers though I just want to build an application that runs 90% with the database. I dont know if this explains anything. Or if it will help someone help me? I am more than willing to swap for my automotive advice.
 

Answer 3

Hi Andrew.M,

What is the database you use exactly? MySql or Sql Server?

Open Server Explorer of Visual Studio, you can add the database from there.

To access the database from your application what you need is to know the connection string and use it in your VB.NET code.

Hope this helps. If you have more questions let us know (in detailed please)

 

Answer 4

I have VB express 2010, and sql server management studio(all microsoft free express versions). Its all local. Everyone is talking like its so easy, the wizard wants me to look for a file? I'm used to connecting to the server. I "data sources" witch i believe is the same as "server explorer".
 

Answer 5

I have VB express 2010, and sql server management studio(all microsoft free express versions). Its all local. Everyone is talking like its so easy, the wizard wants me to look for a file? I'm used to connecting to the server. I "data sources" witch i believe is the same as "server explorer".


Hi Andrew.M,

No, everyone is correct it's so easy :-)

As I said Server Explorer of Visual Studio .

Within Visual Studio, go to the toolbar, then choose View --> Server Explorer.

Once you have added a connection in Server Explorer you will be able to use it in any Data Source.

Hope this helps.

 

Answer 6

here is how i got it to work before you posted, I went through the "add data source" selected "database" ex. Then selected my .mdf file. said i did not have permission. so i closed out and ran as admin. then it said no because another program was using the file. so I stopped the sql server through services. then it couldn't connect. so then I started the server and everything is working fine. It did say it had to copy the files or something?
 

Answer 7

It sounds like you selected "Microsoft SQL Server Database File (SqlClient)" as your data source, which probably made a *copy* of your MDF file and put it in your project folder.

If you want to connect to your SQL Express instance, you need to change the data source to "Microsoft SQL Server (SqlClient)".

 

Answer 8

Hello Andrew,

You can try to follow steps mention below to see if they help:

1) Open Server Explorer (View -> Server Explorer)
2) The Server Explorer should show up on the left hand side of the IDE
3) Right click on "Data Connections" and select "Add Connection". Choose 'Microsoft SQL Server (SqlClient)' in the Data source filed in the prompted dialog.
4) Enter the Server Name in the first textbox (do not use the drop down box). MS SQL Server name can be found in the database manager section of the control panel.
5) Specify the log on mode based on your database
7) Select your database from the dropdown list.
8) Click "Ok"
9) Once connected, you should see a new entry in the Data Connections Section .

In addition, you could also post it on Data Platform Development Forum(http://social.msdn.microsoft.com/Forums/en-US/category/dataplatformdev) so you can get better and quicker response as this forum here is for the setup and installation of visual studio.

Thanks.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
 

Answer 9

Hello Edwer Fang!

I have the same problem, but I can try to follow steps you posted. Because there are no "Microsoft SQL Server (SqlClient)" data source on Visual Studio 2010 Express C#, there are only "Microsoft SQL Server Database File (SqlClient)". So I try to find "Microsoft SQL Server (SqlClient)" data source for C# Express 2010. After some days finding, I can't find any document or guide mention the problem.

I wonder that maybe the data source didn't support for visual studio 2010 express 2010 C# or there are some happened wrongs during installing (but Web is stilling)
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter