Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 388
  • Last Modified:

MS VS-2005 Connection String

I have MS SQL-2005 and MS VS-2005 with SP1, I am using following connection string on starting of page.

Connection String:
-------------------------
Dim cnString As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=DLI_DB;Persist Security Info=True;User ID=sa; password: applmgr")
 
Error:
-------
System.ArgumentException was unhandled by user code
Message="Format of the initialization string does not conform to specification starting at index 87."
Source="System.Data"


Please help where I am doing mistake?
0
Mehram
Asked:
Mehram
  • 2
1 Solution
 
jpaulinoCommented:
Try to change to this

Dim cnString As New SqlConnection("Data Source=.\SQLEXPRESS;Initial Catalog=DLI_DB;Persist Security Info=True;User ID=sa; Password=applmgr")
0
 
Praveen KumarArchitectCommented:
you can check here all types of connection strings, which sutable for u.
http://www.connectionstrings.com/?carrier=sqlserver2005
0
 
MehramAuthor Commented:
jpaulino, no progress
0
 
jpaulinoCommented:
Normally its an attach database and the connectionstring should be like this

Dim cnString As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename='|DataDirectory|\DLI_DB.MDF';Integrated Security=True;User Instance=True;User ID=sa; Password=applmgr")

The best way to check it is to use any wizard (like datagridview, combobox, etc) and after your select the database and test it you can see the connection string. That will work for shure.

jpaulino
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now