Click here to Skip to main content
14,866,384 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey Guyzz...I am developing a website.Now i am getting this Error..

CSS
Server Error in '/MyProject' Application.
Format of the initialization string does not conform to specification starting at index 0.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.


Please help me out...This error is making me go mad.....
Posted
Comments
PrashantSonewane 19-Apr-13 1:52am
   
Can you find out what code is causing this error and add that code. It will help us to understand whats going wrong?
apjitin 19-Apr-13 1:59am
   
Here is the rough implementaion of the code...I am using Sqldatasource to retrieve contents from a table and displaying the contenets using a Gridview.I am maintaing a session variable also.

protected void Page_Load(object sender, EventArgs e)
{
string quarter = Session["quar"].ToString();
string projectid = (string)Session["projid"];
string User = (String)Session["username"];
string role = (String)Session["role"];
Session["Portname"] = Portinfo.Getportname();
Session["Portcode"] = Portinfo.Getportcode();
string pc = (string)Session["Portcode"];
userlbl.Text = User;
rolelbl.Text = role;

}

<asp:SqlDataSource ID="capitalrpts" runat="server"
ConnectionString="<%ConnectionStrings:userdatabase %>"
SelectCommand="SELECT Month,Proj_Id FROM MDMonthlyDetails JOIN Portinfo ON Portinfo.Portcode=MDMonthlyDetails.Portcode
WHERE MDMonthlyDetails.Portcode=@pc">
<SelectParameters>
<asp:SessionParameter Name="pc" SessionField="Portcode" />
</SelectParameters>

<asp:GridView ID="GridView1" DataSourceID="capitalrpts" runat="server">
PrashantSonewane 19-Apr-13 2:09am
   
Check your connection string if its correct once.

1 solution

   
Comments
apjitin 19-Apr-13 2:10am
   
Thanks guys for all your responses.I found the silly mistake i was doing...Thanks again... :)
Karthik Harve 19-Apr-13 2:15am
   
welcome .!! but explain the mistake and mark the solution, so that anybody who refer this thread, will come to know the solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900