Posted on: 11/13/2013 2:39:58 AM | Views : 286

Hi All,
I declare a database connection in Web.config as:
<connectionStrings>     <clear/>     <add name="MyConnection" connectionString="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=myDB;Integrated Security=True" providerName="System.Data.SqlClient"/>   </connectionStrings>
in my web form I can create a SqlDataSource as:
<asp:SqlDataSource ID="sds_type" runat="server"             ConnectionString="<%$ ConnectionStrings:MyConnection %>"             SelectCommand="SELECT [course_desc] FROM [courses] ORDER BY [course_desc]"></asp:SqlDataSource>
How can I declare or use this connection from my submit button ?
protected void submitBtn_Click(object sende ...

Go to the complete details ...