ConnectionString issue with SQL server.

G

Guest

Hi

Using 2 servers, CBCDOMAIN Win2003 server, and BAANSRV1 Win2000 server

- user are authenticate trough CBCDOMAIN
- SQL server is running on BAANSRV1 database baandb (Windows and SQL authentication

My trouble is, It seam I can not figure out how to have the right syntax using the connectionString to connect to baandb using SQL userID and password trough code using VS.2003 and C# and on a PC/user from CBCDOMAIN

The error return is always SYSTEM ERROR nothing else !

What I try and is working is I use a form and then SERVER explorer (Drag and drop) to create the sqlconnection using the same user id and password, and then the sqldataadapter and run the form, data is display without any issue

When I try by code using the app.config and provide it at runtime to the sqlconnection object, it never work, even if I copy the connectionstring code generated by VS when dragging it to the form.

Any one has an idea on why this append... I really need to have this connection generated by hand instead of VS

Thanks in advance

Carl
---------------------------------------------------------------------------------------------------
Code

SqlConnection GenericConnection = new System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings[ConfigConnectionKey])
GenericConnection.Open()

ConfigConnectionKey

<!-- Generated by VS.2003 --><add key="VS2003" value="workstation id=CBDEV1;packet size=4096;user id=baan;data source=BAANSRV01;persist security info=True;initial catalog=baandb;password=baan;" /><!-- Standard Security A--><add key="BaanSTDA" value="workstation id=CBDEV1;packet size=4096;user id=baan;data source=BAANSRV01;persist security info=True;initial catalog=baandb;Password=baan" /><!-- Standard Security B--><add key="BaanSTDB" value="Server=BAANSRV01;Database=baandb;User ID=baan;Password=baan;Trusted_Connection=False;" /><!-- Normal operation on CBCDOMAIN workin good--><add key="CBCTEST" value="workstation id=CBDEV1;packet size=4096;Trusted_Connection=Yes;data source=CBC;persist security info=False;initial catalog=TimeEntryLog;Integrated Security=SSPI;" />
 
W

William Ryan eMVP

Carl:

Why not erase the existing string and just replace it with a good connection
string? jsut delete it all and hard code in the value.
Carl said:
Hi,

Using 2 servers, CBCDOMAIN Win2003 server, and BAANSRV1 Win2000 server.

- user are authenticate trough CBCDOMAIN.
- SQL server is running on BAANSRV1 database baandb (Windows and SQL authentication)

My trouble is, It seam I can not figure out how to have the right syntax
using the connectionString to connect to baandb using SQL userID and
password trough code using VS.2003 and C# and on a PC/user from CBCDOMAIN .
The error return is always SYSTEM ERROR nothing else !.

What I try and is working is I use a form and then SERVER explorer (Drag
and drop) to create the sqlconnection using the same user id and password,
and then the sqldataadapter and run the form, data is display without any
issue.
When I try by code using the app.config and provide it at runtime to the
sqlconnection object, it never work, even if I copy the connectionstring
code generated by VS when dragging it to the form.
Any one has an idea on why this append... I really need to have this
connection generated by hand instead of VS.
Thanks in advance.

Carl,
-------------------------------------------------------------------------- --------------------------
Code :

SqlConnection GenericConnection = new System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings[Config
ConnectionKey]);
GenericConnection.Open();

ConfigConnectionKey :

<!-- Generated by VS.2003 --><add key="VS2003" value="workstation
id=CBDEV1;packet size=4096;user id=baan;data source=BAANSRV01;persist
security info=True;initial catalog=baandb;password=baan;" /><!-- Standard
Security A--><add key="BaanSTDA" value="workstation id=CBDEV1;packet
size=4096;user id=baan;data source=BAANSRV01;persist security
info=True;initial catalog=baandb;Password=baan" /><!-- Standard Security
B--><add key="BaanSTDB" value="Server=BAANSRV01;Database=baandb;User
ID=baan;Password=baan;Trusted_Connection=False;" /><!-- Normal operation on
CBCDOMAIN workin good--><add key="CBCTEST" value="workstation
id=CBDEV1;packet size=4096;Trusted_Connection=Yes;data source=CBC;persist
security info=False;initial catalog=TimeEntryLog;Integrated Security=SSPI;"
/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top