8
Answers

Compilation Error Not Understood

Photo of Thierry

Thierry

14y
2.7k
1

Hi everyone,
I get the following compiling error:
System.ArgumentException was unhandled
  Message="Format of the initialization string does not conform to specification starting at index 0."

It points at the following line in the code:
System.Data.SqlClient.
SqlConnection sqlConnection1 = new System.Data.SqlClient.SqlConnection("ServiceManagerDBConnectionString");
As you might have already guessed I am trying to open a new connection string for this method which should insert records into a database. 
Q1 - Can anyone explain this compilation error?
Q2 - In the app.config, the name of the connection string is in multiparts seperated by periods. I only typed the last part, which I know is the actual name of the connection string. Was I wrong not to include the other parameters?
<
connectionStrings>
<
add name="CarServiceManager.Properties.Settings.ServiceManagerDBConnectionString"
connectionString="Data Source=|DataDirectory|\database\ServiceManagerDB.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
</
connectionStrings>
I hope my question is not too confusing, as I am new to programming.
I thank you all for your help in advance
 

Answers (8)

2
Photo of Manas Mohapatra
NA 29.3k 3.3m 7y
To resolve your issue:
 
1. Make method as public and static
2. Make sure param name should be same
3. Make sure that you shouldn't have any client side error like variable is undefined etc.. You can see error in console tab by pressing F12 in browser.
4. jQuery library reference should be added properly. 
  1. [System.Web.Services.WebMethod]  
  2. public static string saveTask(string date, string id)  
  3. {  
  4.     return "Hello " + name + Environment.NewLine + "The Current Time is: "  
  5.         + DateTime.Now.ToString();  
  6. }  
 
Accepted
0
Photo of Sbonga Mathobela
NA 68 2.7k 7y
Thanx guys....I found the soultion. I changed in the RouteConfug :settings.AutoRedirectMode = RedirectMode.Off; instead of settings.AutoRedirectMode = RedirectMode.Permanent
0
Photo of Pooja Dixit
NA 29 6 7y
It is May be possible in Server side Error Occured..
that time debugger is not properly working on..