mellenburg
Programmer
I have the following class in a .aspx.cs file:
public void Page_Load(object sender, EventArgs e)
{
}
Inside this class, I would like to make a connection to a database I created using SQL server managment express edition. I have tried to find an example of connecting to a SQL server DB that works and have not. Can someone tell me the commands necessary to make the DB connection?
In the .aspx file, I created a SQL data source. One of the problems I'm having is I don't know how to determine the connection information, much less the syntax of the statements.
<asp:SqlDataSource
ID="CategoriesSqlDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:BudgetConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:BudgetConnectionString1.ProviderName %>"
SelectCommand="SELECT * FROM Categories ORDER BY SubCategoryID, Category">
</asp:SqlDataSource>
public void Page_Load(object sender, EventArgs e)
{
}
Inside this class, I would like to make a connection to a database I created using SQL server managment express edition. I have tried to find an example of connecting to a SQL server DB that works and have not. Can someone tell me the commands necessary to make the DB connection?
In the .aspx file, I created a SQL data source. One of the problems I'm having is I don't know how to determine the connection information, much less the syntax of the statements.
<asp:SqlDataSource
ID="CategoriesSqlDataSource"
runat="server"
ConnectionString="<%$ ConnectionStrings:BudgetConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:BudgetConnectionString1.ProviderName %>"
SelectCommand="SELECT * FROM Categories ORDER BY SubCategoryID, Category">
</asp:SqlDataSource>