PC Review


Reply
Thread Tools Rate Thread

can't connect to my DB...

 
 
gloria
Guest
Posts: n/a
 
      8th Feb 2005
So I created a MS DL that I know works. I can test the connection.
Provider=SQLOLEDB;Password=xxx;Persist Security Info=True;User
ID=xxx;Initial Catalog=olite3i;Data Source=niktraining

However, when I try to use this string in my code, I don't even get the
error in my catch. What am I doing wrong? If I use
SqlClient/SqlConnection, I at least can get the catch to work and the
error: "Keyword not supported: 'provider'." But I know my connect
string works because I can test it.

What am I doing wrong?

Thanks!

--gloria

---------------
using System;
using System.Data;
using System.Data.OleDb;
....
string connStr = "Provider=SQLOLEDB;Password=xxxx;Persist Security
Info=True;User ID=xxx;Initial Catalog=olite3i;Data Source=niktraining";
Console.WriteLine("connStr: " + connStr);

try
{
OleDbConnection cn = new OleDbConnection();
cn.ConnectionString = connStr;
cn.Open();
} catch (Exception ex) {
Console.WriteLine("Attepmet to connect failed.\n" + ex.Message);
}

 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      8th Feb 2005
Hi Gloria,

For SqlClient.SqlConnection, the connection string is like

Password=xxx;Persist Security Info=True;User
ID=xxx;Initial Catalog=olite3i;Data Source=niktraining

No Provider.

HTH,

Elton Wang
(E-Mail Removed)

>-----Original Message-----
>So I created a MS DL that I know works. I can test the

connection.
> Provider=SQLOLEDB;Password=xxx;Persist Security

Info=True;User
>ID=xxx;Initial Catalog=olite3i;Data Source=niktraining
>
>However, when I try to use this string in my code, I

don't even get the
>error in my catch. What am I doing wrong? If I use
>SqlClient/SqlConnection, I at least can get the catch to

work and the
>error: "Keyword not supported: 'provider'." But I know

my connect
>string works because I can test it.
>
>What am I doing wrong?
>
>Thanks!
>
>--gloria
>
>---------------
>using System;
>using System.Data;
>using System.Data.OleDb;
>....
>string connStr = "Provider=SQLOLEDB;Password=xxxx;Persist

Security
>Info=True;User ID=xxx;Initial Catalog=olite3i;Data

Source=niktraining";
>Console.WriteLine("connStr: " + connStr);
>
>try
>{
> OleDbConnection cn = new OleDbConnection();
> cn.ConnectionString = connStr;
> cn.Open();
>} catch (Exception ex) {
> Console.WriteLine("Attepmet to connect failed.\n"

+ ex.Message);
>}
>
>.
>

 
Reply With Quote
 
gloria
Guest
Posts: n/a
 
      16th Feb 2005
Figured out my issue. I was running the app from a networked drive and
didn't have the permissions set up to do this. I copied my info to a
local disk and it worked like a charm. Spent a day and a half trying
to figure out what I was doing wrong. The fun mistakes in learning a
new technology.

Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Media Connect won't start....UPnP doesnt exist, can't connect Xbox =?Utf-8?B?Q2hhcmxlcyBD?= Windows XP Help 0 26th Jan 2006 09:10 PM
This code hangs on connect() if connect hangs. how to make this so that if connect hangs i time out after 10 seconds. perhaps there is someway to do this with ioctlsocket and select? can anyone show how to do this? Daniel Microsoft Windows 2000 Networking 0 15th Feb 2005 01:37 AM
Win2k stand alone: WIreless will only connect AFTER Admin logs in, user can't connect Rudy Microsoft Windows 2000 0 29th Aug 2004 07:02 AM
'Connect to' item disappeared from Start Menu and Internet doesn't connect Thumper Windows XP Networking 0 30th Jan 2004 08:06 PM
Help! Fail to connect a windows XP laptop via a wireless connect to Dlink router! Stan Windows XP Networking 2 30th Nov 2003 05:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 AM.