0

Apparently no one connects visual web dev express to databases because I can't find anything helpful on google.

  1. Do I need to connect a datasource to my project, for the login control/etc to work? If not, how else?
  2. What (free!) databases can I use as a data source in visual web dev express?
  3. How do I connect them?

My question is a little short but I have to go, thanks in advance.

2 Answers 2

1

The answer is here Using the Web.Config to set up my SQL database connection string?

Thats all you need!

UPDATE

A little example: First add the reference System.Configuration to your project then Imports in your code (using System.Configuration).

DataSet ds = new DataSet(); //Create a DataSet
string ConnectionString = ConfigurationManager.ConnectionStrings["YourConnectionStringName"].ConnectionString; //ConnectionString from web.config
SqlConnection con = new SqlConnection(); //Create a new SqlConnection
con.ConnectionString = ConectionString; //Connect using your ConnectionString
SqlDataAdapter da = new SqlDataAdapter("Your SQL query goes here", con); //Get Data
da.Fill(ds); //Fill a DataSet (in this case)
con.Close(); //Close connection
Sign up to request clarification or add additional context in comments.

1 Comment

Ok, I have a connection string, but what do I do with it? I've added it under web.config <configuration><connectionStrings>, but how do I tell VWD to use and connect to it?
1
  1. Yes, the built in Membership features of ASP.NET use a database to store their information.

  2. Sticking with Microsoft for the DB?

    SQL Server Express: http://www.microsoft.com/express/Database/

    SQL Server Compact 4.0: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033cfb76-5382-44fb-bc7e-b3c8174832e2

  3. Depends how you perform data access, but you'll start by constructing a connection string.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.