Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Alright, I am currently writing an application that connects to my local SQL Server 2008 Express instance. I have created a dataset, table adapter, etc., via the Forms Designer. I simply want to know how, if possible, I can keep the application from connecting to the database when the application loads.

What I am trying to achieve is providing a login screen, where I provide my username/password for the SQL Server, and it connects at that point. How would I go about doing this?

I am using Visual Studio 2010 and C#, targeting the .NET Framework 4.0.

If you need more information or clarification feel free to ask. :)
Posted

1 solution

You are in absolute and complete control of the code you write. If you don't want the application to connect onload then don't let it. Don't use the wizard, create the data access manually via code and pass in the connection string info as necessary.
 
Share this answer
 
Comments
Matt U. 12-Dec-10 21:17pm    
Alright, I figured that would be the case. One question though. Will I need to create the other objects (data tables and such) manually as well? Or can I tie them to a custom connection object?

Thank you for the prompt reply.
[no name] 12-Dec-10 21:32pm    
You can reuse it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900