Visual Web Developer 2005 problem

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2007
Posts: 15
Reputation: yagapapa is an unknown quantity at this point 
Solved Threads: 0
yagapapa yagapapa is offline Offline
Newbie Poster

Visual Web Developer 2005 problem

 
0
  #1
Sep 23rd, 2007
Hi all

Ive been working on a VW2005 project and constantly been getting the following error message... Ive been debugging the program for quite some time now and still cant figure out where the problem lies...

  1. Format of the initialization string does not conform to specification starting at index 0.
  2.  
  3. 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.
  4.  
  5. Exception Details: System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
  6.  
  7. Source Error:
  8.  
  9. An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  10. Stack Trace:
  11.  
  12. [ArgumentException: Format of the initialization string does not conform to specification starting at index 0.]
  13. System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +1284
  14. System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +115
  15. System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +99
  16. System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +52
  17. System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +25
  18. System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +141
  19. System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +38
  20. System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
  21. System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +128
  22. System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +13
  23. System.Web.UI.WebControls.DataBoundControl.PerformSelect() +140
  24. System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
  25. System.Web.UI.WebControls.GridView.DataBind() +5
  26. System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +61
  27. System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +67
  28. System.Web.UI.Control.EnsureChildControls() +97
  29. System.Web.UI.Control.PreRenderRecursiveInternal() +50
  30. System.Web.UI.Control.PreRenderRecursiveInternal() +171
  31. System.Web.UI.Control.PreRenderRecursiveInternal() +171
  32. System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5729

Any help with thatv??
Last edited by yagapapa; Sep 23rd, 2007 at 8:32 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Visual Web Developer 2005 problem

 
0
  #2
Sep 23rd, 2007
It looks like your connection string is the issue

It should look like
  1. Data Source=SERVERNAME;Initial Catalog=DATABASENAME;UID=USERNAME;PWD=PASSWORD
If this is not the issue could you then post the ConnectionString and the SQL Statment
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 15
Reputation: yagapapa is an unknown quantity at this point 
Solved Threads: 0
yagapapa yagapapa is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #3
Sep 23rd, 2007
This is my connection string from my web.config file...

Um...Im not sure where the problem could be lying because this connection was generated by the system...I didnt do any tweaking myself...

  1. connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Ratios.mdf;Integrated Security=True;User Instance=True"

You will notice that my database name is Ratios...
Last edited by yagapapa; Sep 23rd, 2007 at 2:59 pm.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 7
Reputation: bharatsaboo is an unknown quantity at this point 
Solved Threads: 0
bharatsaboo bharatsaboo is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #4
Sep 23rd, 2007
the connection string that you have sent is just attaching the database file to the server and is not trying to open the database.

change the connection string to the following :
Data Source=SERVERNAME;Initial Catalog=DATABASENAME;UID=USERNAME;PWD=PASSWORD

The above will only work if you are trying to connect to the database.

Bharat


Originally Posted by yagapapa View Post
This is my connection string from my web.config file...

Um...Im not sure where the problem could be lying because this connection was generated by the system...I didnt do any tweaking myself...

  1. connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Ratios.mdf;Integrated Security=True;User Instance=True"

You will notice that my database name is Ratios...
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Visual Web Developer 2005 problem

 
0
  #5
Sep 23rd, 2007
This would make your ConnectionString
  1. connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Ratios;Integrated Security=True;User Instance=True"
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 15
Reputation: yagapapa is an unknown quantity at this point 
Solved Threads: 0
yagapapa yagapapa is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #6
Sep 23rd, 2007
I still get the same error even after changing the connection string...
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 7
Reputation: bharatsaboo is an unknown quantity at this point 
Solved Threads: 0
bharatsaboo bharatsaboo is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #7
Sep 24th, 2007
Try the following

strConnect = "Driver={SQL Server};Server=<server address>;Database=<database>;UID=;PWD="

OR

connectionString="Data Source=DSN Name;Initial Catalog=Ratios;Integrated Security=True;User Instance=True"

Originally Posted by yagapapa View Post
I still get the same error even after changing the connection string...
Last edited by bharatsaboo; Sep 24th, 2007 at 3:53 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 15
Reputation: yagapapa is an unknown quantity at this point 
Solved Threads: 0
yagapapa yagapapa is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #8
Sep 24th, 2007
Originally Posted by bharatsaboo View Post
Try the following

strConnect = "Driver={SQL Server};Server=<server address>;Database=<database>;UID=;PWD="

OR

connectionString="Data Source=DSN Name;Initial Catalog=Ratios;Integrated Security=True;User Instance=True"
I tried the latter code, i still get the same error, I didnt try the former cos im not sure about the "SQL Server" and the "server address" or do i just copy and paste it exactly like that ??
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 15
Reputation: yagapapa is an unknown quantity at this point 
Solved Threads: 0
yagapapa yagapapa is offline Offline
Newbie Poster

Re: Visual Web Developer 2005 problem

 
0
  #9
Sep 24th, 2007
Originally Posted by bharatsaboo View Post
Try the following

strConnect = "Driver={SQL Server};Server=<server address>;Database=<database>;UID=;PWD="

OR

connectionString="Data Source=DSN Name;Initial Catalog=Ratios;Integrated Security=True;User Instance=True"
I tried the latter code and i still get the same error, I didnt try the former cos im not sure about the "SQL Server" and the "server address" or do i just copy and paste it exactly like that ??
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Visual Web Developer 2005 problem

 
0
  #10
Sep 24th, 2007
OK Try This.

Place a Label on your page called lblError

then add the word "Try" at the top of the Sub/Function that Errors

and add
Catch ex as Exception
lblerror.text = ex.message
End Try

to the end of the Sub/Function

and post back the message it produces

Example
http://www.taylorsnet.co.uk/SourceCo...spx?SourceID=6

This should give a better Error Massage
Last edited by ptaylor965; Sep 24th, 2007 at 2:43 pm.
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC