locked
Connection string wizard RRS feed

  • Question

  • User-704778891 posted

     Hi

     

    I need to make some kind of wizard for creating  connection string (not included in any .config file). This connection string would be used with LINQ to SQL.  And my question is what kind of information user shoud input in such case? It should also support  Express edition. Can someone e.g.: paste some examples of connection string for sql and sql express ?

    Sunday, April 12, 2009 8:01 AM

Answers

  • User187056398 posted

    The connection string builder has properties for UserName, Password and every other possible attribute that is used to build a connection string.

    Maybe what you are seeking is here: http://www.connectionstrings.com/access-2007

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 12, 2009 7:54 PM

All replies

  • User187056398 posted

    Here is an Access connection string:

    <add name="NorthWindConStr" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Northwind.mdb;Persist Security Info=True" providerName="System.Data.OleDb"/>

    You should use an OleDbConnectionStringBuilder to create and dissassemble connection strings.

            OleDbConnectionStringBuilder ConnInfo = new OleDbConnectionStringBuilder();
    
            ConnInfo.ConnectionString = ConfigurationManager.ConnectionStrings["NorthWindConStr"].ToString();
    
            foreach (String Key in ConnInfo.Keys)
                Response.Write(String.Format("{0}, {1} <br />", Key, ConnInfo[Key]));
    
    
     
    Sunday, April 12, 2009 9:39 AM
  • User-704778891 posted

    Thanks for your response but I afraid I need to make a bit diffrent thing. User write server name, uer name, password etc. and I need to generate (gather all this info in connection string for System.Data.SqlClient) - it should something similar e.g.: to DotNetNuke (since 5.0.0 version) SQL wizard during instalation. What should such connection string consist of ?

    Sunday, April 12, 2009 3:15 PM
  • User187056398 posted

    The connection string builder has properties for UserName, Password and every other possible attribute that is used to build a connection string.

    Maybe what you are seeking is here: http://www.connectionstrings.com/access-2007

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, April 12, 2009 7:54 PM
  • User-704778891 posted

     More or less but it was helpfull, thanks

    Monday, April 13, 2009 2:12 PM