Nithya Reddy

Nithya Reddy

  • NA
  • 2
  • 529

how to write connection string automatically in web.config f

Feb 26 2018 1:26 PM
How to use this form for creating an connection string in the web.config file on the press of "Submit & Continue" button. As I want to develop an application where any user can create a database connection just by entering database type, URL and authentication details. Please help me in all possible ways.
  1. <div class="box box-info box-solid">  
  2.         <div class="box-header with-border">  
  3.             <h3 class="box-title">Add Database to Your Store</h3>  
  4.         </div>  
  5.         <div class="box-body">  
  6.             <label class="text-info text-bold">First Create a Database on Your Server. If You need help in creating database on server then <a href="#" target="_blank">Click Here</a></label><br /><br /><br />  
  7.             <label class="col-sm-3 col-md-3 col-lg-3">Database Type : </label>  
  8.             <div class="col-md-9 col-sm-9 col-lg-9" style="margin-bottom:10px;">  
  9.                 <asp:DropDownList ID="LanguageDropdown" runat="server" CssClass="form-control">  
  10.                     <asp:ListItem>MS SQL Server</asp:ListItem>  
  11.                     <asp:ListItem>MY SQL</asp:ListItem>  
  12.                     <asp:ListItem>Oracle DB</asp:ListItem>  
  13.                 </asp:DropDownList>  
  14.             </div>  
  15.               
  16.             <label class="col-sm-3 col-md-3 col-lg-3">Host : </label>  
  17.             <div class="col-md-9 col-sm-9 col-lg-9" style="margin-bottom:10px;">  
  18.                 <asp:TextBox ID="DatabaseHost" runat="server" CssClass="form-control" placeholder="Write 'localhost' if Database Server & Web Server are same."></asp:TextBox>  
  19.             </div>  
  20.   
  21.             <label class="col-sm-3 col-md-3 col-lg-3">Database Name : </label>  
  22.             <div class="col-md-9 col-sm-9 col-lg-9" style="margin-bottom:10px;">  
  23.                 <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control"></asp:TextBox>  
  24.             </div>  
  25.   
  26.             <label class="col-sm-3 col-md-3 col-lg-3">User Name : </label>  
  27.             <div class="col-md-9 col-sm-9 col-lg-9" style="margin-bottom:10px;">  
  28.                 <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control"></asp:TextBox>  
  29.             </div>  
  30.   
  31.             <label class="col-sm-3 col-md-3 col-lg-3">Password : </label>  
  32.             <div class="col-md-9 col-sm-9 col-lg-9" style="margin-bottom:10px;">  
  33.                 <asp:TextBox ID="TextBox3" runat="server" CssClass="form-control" TextMode="Password"></asp:TextBox>  
  34.             </div>  
  35.         </div>  
  36.         <div class="box-footer">  
  37.             <asp:Button ID="Next" runat="server" Text="Submit & Continue" CssClass="btn btn-success pull-right" OnClick="Next_Click"  />  
  38.         </div>  
  39.     </div>  
 

Answers (3)