0

I found this example but am completely new to this and so it is too advanced for me... I understand what's going on in the view, but how and where am I supposed to actually connect to the database, with a username and password and all? What should my connectionString be in Web.config? What is "NorthwindConnectionString"?

Kalina
  • 5,504
  • 16
  • 64
  • 101

2 Answers2

2

The NorthwindConnectionString in the sample you linked to is configured in the Web.config. The following MSDN documentation should help you step through connecting to a SQLDataSource, see

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.connectionstring.aspx

As noted in the above link, the Connection String is added to the <connectionStrings> node of the Web.config. This connection string holds you database credentials.

Example

<connectionStrings>
  <add name="MyNorthwind" connectionString="server=foehammer;database=Northwind;user=north;password=north;" providerName="System.Data.SqlClient" />
</connectionStrings>

Hope this helps.

geoffrey.mcgill
  • 2,375
  • 1
  • 13
  • 21
0

This link actually helped me out a lot. I wasn't trying to connect to an ODBC database, but I didn't know that there was a wizard that would walk me through the steps! It figured everything out for me.

Kalina
  • 5,504
  • 16
  • 64
  • 101