Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - ASP/ASP.NET/Web Services/Other
Forum to discuss building external web applications for SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ASP/ASP.NET/Web Services/Other | New ThreadView:  Search:  
 Author  Thread: Understanding the Connection String
Allen
Posts: 13
 
Understanding the Connection StringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Dec 06 4:08 PM
fiogf49gjkf0d
Here is my connection string that is stored in my web.config file:

add name="SLXOLEDBConnection" connectionString="Provider=SLXOLEDB.1;Data Source=SlxTestSvr; Security Info=True;User ID=admin;Initial Catalog=SalesLogix;Location=127.0.0.1"
providerName="System.Data.OleDb"

Currently, it's not working. However, let me see if I understand it.
Provider must be SLXOLEDB
Data Source is the server in which SLX is running on
User Id is the user account that I want be authenticated as
Initial Catalog is the name of the database that I want to connect to

Am I correct with my understanding of the connection string? Am I missing something? Does anyone have a working OLEDB Connection String that I can copy for VS 2005 or can tell me how to correct my current string?
[Reply][Quote]
Jeff Ballard
Posts: 326
 
Re: Understanding the Connection StringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Dec 06 5:03 PM
fiogf49gjkf0d
Allen,

You should have the connection string in your web.config file connection strings section. Note that the connection string in the example below comes from Ryan's article at http://www.slxdeveloper.com/page.aspx?id=35&articleid=55 The article is recommended reading (as are all of Ryan's articles!) The connection strings section should look something like this:

< connectionStrings >
< add name="SalesLogix" connectionString="Provider=SLXOLEDB.1;Data Source=MYSLXSERVER;Initial Catalog=MYSLXALIAS;User Id=Admin; Password=""; Persist Security Info=True; Extended Properties="Port=1706;Log=On"/>


Note that I have some spaces after and before the "<" and ">" because the forum software doesn't like them - it thinks they're tags.

Jeff
[Reply][Quote]
Allen
Posts: 13
 
Re: Understanding the Connection StringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 10:29 AM
fiogf49gjkf0d
I read the article and followed it. Now my connection string looks like this:

add name="SLXOLEDBConnection" connectionString="Provider=SLXOLEDB.1;Data Source=VMSRV2003-C;Initial Catalog=SALESLOGIX_SERVER;User Id=Admin; Password=; Persist Security Info=True; Extended Properties=Port=1706;Log=On"

However, I still get an error when trying to access the ASPX pages in SLX.

Here's the error:

Server Error in '/SLXSite' Application.
--------------------------------------------------------------------------------

The ConnectionString property has not been initialized.
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.InvalidOperationException: The ConnectionString property has not been initialized.

Source Error:


Line 17: 'myCommand.Connection = myConnection
Line 18: 'open the connection
Line 19: myConnection.Open()
Line 20: 'execute the command
Line 21: Dim rdr As OleDbDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)


Source File: C:\Inetpub\wwwroot\WebSite1\App_Code\Components\AccountProfileDB.vb Line: 19

Stack Trace:


[InvalidOperationException: The ConnectionString property has not been initialized.]
System.Data.OleDb.OleDbConnection.PermissionDemand() +1055967
System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection) +22
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.OleDb.OleDbConnection.Open() +37
AccountProfileDB.GetProfileList() in C:\Inetpub\wwwroot\WebSite1\App_Code\Components\AccountProfileDB.vb:19
AddAccountProfile.PopulateControls() in C:\Inetpub\wwwroot\WebSite1\AddAccountProfile.aspx.vb:23
AddAccountProfile.Form_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\WebSite1\AddAccountProfile.aspx.vb:15
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

[Reply][Quote]
Duncan Cook
Posts: 164
 
Re: Understanding the Connection StringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 06 2:01 AM
fiogf49gjkf0d
Hi Allen,

Here's the connection string I use, note no extended properties.

< connectionStrings >
< add name="DBConnector" connectionString="Provider=SLXOLEDB.1;Data Source=E1-Webv7;User ID=admin;Initial Catalog=Irwin; Persist Security Info=True; Password=password;"
providerName="System.Data.OleDb" />
< / connectionStrings >

Try this, if this doesn't work the problem may not be the connection string, it may be your script, here a sample for a datareader

Dim dbCon_n As New System.Data.OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings(0).ToString)
Dim oReader_n As System.Data.OleDb.OleDbDataReader
Dim Com_n As New System.Data.OleDb.OleDbCommand(_SQL, dbCon_n)
dbCon_n.Open()
oReader_n = Com_n.ExecuteReader()
oReader_n.Read()

--
Duncan
[Reply][Quote]
Allen
Posts: 13
 
Re: Understanding the Connection StringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 06 10:13 AM
fiogf49gjkf0d
Duncan,

Thanks for the reply, I was able to get my connection string working. It was something in the VB Code.

Corey
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 4:02:27 PM