473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Server Error in '/dataBasee' Application. Format of the initialization string does no

i have got an error


Server Error in '/dataBasee' 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.

Source Error:


Line 43: _Conn = new Connection();
Line 44: string a = Convert .ToString (_Conn.GetCon());
Line 45: _con.ConnectionString = a;
Line 46: _cmd =new SqlCommand ("insert into employee(Name,Address) values('"+this ._empName+"','"+this ._empAddr +"')",_con );
Line 47: _con .Open();


Source File: c:\Users\vishal\Documents\Visual Studio 2008\WebSites\dataBasee\App_Code\employee.cs Line: 45

Stack Trace:


[ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
System.Data.Common.DbConnectionOptions.GetKeyValue Pair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +4867618
System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +129
System.Data.Common.DbConnectionOptions..ctor(Strin g connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(St ring connectionString) +55
System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String value) +62
System.Data.SqlClient.SqlConnection.set_Connection String(String value) +4
employee.AddEmp() in c:\Users\vishal\Documents\Visual Studio 2008\WebSites\dataBasee\App_Code\employee.cs:45
_Default.btnInsert_Click(Object sender, EventArgs e) in c:\Users\vishal\Documents\Visual Studio 2008\WebSites\dataBasee\Login.aspx.cs:23
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565






plzzz help me......
Oct 16 '16 #1
1 2273
Oralloy
988 Expert 512MB
So what I'm reading is that you don't have a database correctly configured.

If you don't have a connection, asking an empty Connection object for its connection string is kind of silly.

Or, perhaps you've got a variable name mismatch between _Conn and _con?

You could use an ODBC connect string in your code, like
Expand|Select|Wrap|Line Numbers
  1. String a = "Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;
  2. Pwd=myPassword;"
Ref: Microsoft SQL Server ODBC Driver connection strings

Good Luck!
Oralloy
Oct 16 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Uday Deo | last post by:
Hi everyone, I have a .NET app invoking from the ASP page. It has to load bunch of data during first visit. The app works fine on the Staging and Prod server. This is the first time the company...
6
by: Javier Cortés Cortés | last post by:
i am getting this error when i am trying to access any file(with the ext. aspx) from my remote server. the error is : Server Error in '/' Application....
2
by: Regus | last post by:
When I publish my website on my host, i got this error. My web.config file does have the customError-tag on "remoteOnly", but still i get this error. Any idea what the problem is ? Server...
0
by: Gaurav | last post by:
Hi, I have a connection string "Data Source=db1.mynet;DATABASE=test;User ID=testuser;Password=test;" , when i use the connection string to get a dataset of all the tables of a database it...
4
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the...
1
by: openleren | last post by:
Hi all, with a little help from my friends, I am trying to construct a connectionstring from a relative path in web.config. It contains <add key="conAccess" value="microsoft.jet.oledb.4.0;data...
0
by: andy | last post by:
Hi all, Any help much appreciated - Andy I am trying to connect to a SQL Server DB using c#, ADO.Net mySqlConnection = new...
1
by: kristian | last post by:
I'm using the following entry in my web.config: web.config <customErrors mode="On" defaultRedirect="~/CMS/Default.aspx"> <error statusCode="404" redirect="~/CMS/Default.aspx"/> </customErrors> ...
5
by: meskeleton | last post by:
Hello everyone... I am a newbie to .NET and the having some problem with the site i created and uploaded . On accessing the home page i get the error-'Server Error in / application.' 'An error has...
2
by: gm000 | last post by:
hi below is my code its working fine in my local system.but its give this error on webhost please solve this error my code is------------------------------------------------ Protected Sub...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.