Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2004

Tip: Looking for answers? Try searching our database.

ConnectionString issue with SQL server.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl - 18 Mar 2004 16:31 GMT
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;" /
William Ryan eMVP - 18 Mar 2004 17:18 GMT
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.
> Hi,
>
[quoted text clipped - 4 lines]
>
> 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.
>
[quoted text clipped - 5 lines]
>
> 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;"
/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.