locked
Solution for "Format of the initialization string does not conform to specification starting at index 0."? RRS feed

  • Question

  • User-842092983 posted
    not sure from when, I started get error: Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0. I am using Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42 and sql 2005 beta, the connectionstring in web.config like this: <add name="dbbase" connectionString="server=myserver\sqlexpress;user ID=sa;password=xxxx;database=mydb" /> It happens on string connString = ConfigurationSettings.ConnectionStrings["dbbase"].ToString(); SqlConnection conn = new SqlConnection(connString); -- this line It seems a few people had this problem, but I could not find an answer. On microsoft site, there is a fix for asp.net 1.1 and it says this happens when there is ' or " in connection string, but both not in my case. please help/ Thanks!
    Thursday, December 16, 2004 1:28 AM

Answers

All replies

  • User311250756 posted
    Any luck with this?  I've got the same problem.
    Friday, May 27, 2005 11:03 PM
  • User-1564601673 posted

    Anyone find a solution to this?? I have the same problem. I'm fairly sure my connection string in my config file is correct so it has to be a coding error.

    protected void Button1_Click(object sender, EventArgs e)

    {

     

    string sql = DropDownList1.SelectedValue;if (!String.IsNullOrEmpty(sql))

    {

    String EC = "EsteeConnection";

     

    using (SqlConnection Connection = new SqlConnection(EC))

    {

    using (SqlCommand Command = new SqlCommand(sql, Connection))

    {

    Connection.Open();

    SqlDataReader reader = Command.ExecuteReader(CommandBehavior.CloseConnection);

    GridView1.DataSource = reader;

    GridView1.DataBind();

    }

    }

    }

    }

    Anyone see a mistake in this??

    Monday, July 23, 2007 4:24 AM
  • User-1564601673 posted

    Anyone find a solution to this?? I have the same problem. I'm fairly sure my connection string in my config file is correct so it has to be a coding error.

    protected void Button1_Click(object sender, EventArgs e)

    {

     

    string sql = DropDownList1.SelectedValue;if (!String.IsNullOrEmpty(sql))

    {

    String EC = "EsteeConnection";

     

    using (SqlConnection Connection = new SqlConnection(EC))

    {

    using (SqlCommand Command = new SqlCommand(sql, Connection))

    {

    Connection.Open();

    SqlDataReader reader = Command.ExecuteReader(CommandBehavior.CloseConnection);

    GridView1.DataSource = reader;

    GridView1.DataBind();

    }

    }

    }

    }

    Anyone see a mistake in this??

    Monday, July 23, 2007 4:27 AM
  • User-1564601673 posted

    http://www.velocityreviews.com/forums/t87146-simple-dbproblem.html

    i found the solution to my problem here ...  the new connection string had to be called diffeerently.

    Hope this helps other people.

    Monday, July 23, 2007 4:45 AM
  • User-1564601673 posted

    Actually never mind that doesn't seem to be working the way i want .. anybody got any ideas??

    Monday, July 23, 2007 5:26 AM
  • User-814327568 posted

    I would suggest you re-check your connection string. Refer http://www.connectionstrings.com/ 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 3, 2009 11:54 PM
  • User-157743364 posted

    you have to set up the SQL connection settings for this drag and drop SQL data source and set it up as per your knowledge.

    hope that will resolve the error.

    Friday, July 5, 2013 8:51 AM