Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Cannot connect to db

Reply
Thread Tools

Re: Cannot connect to db

 
 
John Giblin
Guest
Posts: n/a
 
      07-16-2003
I just forgot that in that try. No affect. Still cannot connect. It seems
like a configuration on my mchine since it worked for someone else with the
same code

John
"Jon Yates" <(E-Mail Removed)> wrote in message
news:00b401c34baa$90764760$(E-Mail Removed)...
> Hello mate.
>
> In your connection string you may need to supply the
> Username and Password to the Database. I've pasted in the
> connection sring that I use from within a Windows App to
> connection to a SQLServer 2000 DB.
>
> Hope it helps,
>
> Jon
>
> "Provider=sqloledb;data source=SUNWL19655\NetSDK;initial
> catalog=Portal; user id=sa; password="
>
> >-----Original Message-----
> >I have written both a asp.net and a console program where

> I am trying to
> >connection to a db.
> >
> >When I use the sqlconnection using vs.net 2003. I am able

> to see the table
> >and the test the connection
> >
> >When I run my program I get an error! ARGh!
> >
> >In my console program I get:
> >Error Request for the permission of type
> >System.Data.SqlClient.SqlClientPermission, System.Data,

> Version=1.0.5000.0,
> >Cul
> >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> >
> >In my asp.net i get this:
> >Exception Details: System.UnauthorizedAccessException:

> Access is denied.
> >
> >It fails at the open():
> >Console program
> >
> >string strConnect = "workstation id=NYCNJGIBLIN;packet

> size=4096;user
> >id=jgiblin;data source=ewr1gpdsq" +
> >
> >"l;persist security info=False"; }
> >
> >SqlConnection conn = new SqlConnection(strConnect);
> >
> >SqlCommand cmd = new SqlCommand("Select * from

> Content_Master", conn);
> >
> >// cmd.Connection = new SqlConnection(strConnect);
> >
> >// cmd.CommandText = "Content_Master_Update";
> >
> >cmd.CommandType = CommandType.Text;
> >
> >test = "Step 2";
> >
> >test = "Step 3";
> >
> >conn.Open();
> >
> >
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
 
dj Bass
Guest
Posts: n/a
 
      07-16-2003
if it's taken from another machine, then the things you need to check out
are the domains for the database boxes you're trying to access... does the
network machine exist with the same mappings as on the original PC? if it's
a different database instance, then you should probably start the connection
from scratch again.

i still say try the design view, you see more happening there in front of
you without worry about strings of info...

Dan.

"John Giblin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I just forgot that in that try. No affect. Still cannot connect. It

seems
> like a configuration on my mchine since it worked for someone else with

the
> same code
>
> John
> "Jon Yates" <(E-Mail Removed)> wrote in message
> news:00b401c34baa$90764760$(E-Mail Removed)...
> > Hello mate.
> >
> > In your connection string you may need to supply the
> > Username and Password to the Database. I've pasted in the
> > connection sring that I use from within a Windows App to
> > connection to a SQLServer 2000 DB.
> >
> > Hope it helps,
> >
> > Jon
> >
> > "Provider=sqloledb;data source=SUNWL19655\NetSDK;initial
> > catalog=Portal; user id=sa; password="
> >
> > >-----Original Message-----
> > >I have written both a asp.net and a console program where

> > I am trying to
> > >connection to a db.
> > >
> > >When I use the sqlconnection using vs.net 2003. I am able

> > to see the table
> > >and the test the connection
> > >
> > >When I run my program I get an error! ARGh!
> > >
> > >In my console program I get:
> > >Error Request for the permission of type
> > >System.Data.SqlClient.SqlClientPermission, System.Data,

> > Version=1.0.5000.0,
> > >Cul
> > >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> > >
> > >In my asp.net i get this:
> > >Exception Details: System.UnauthorizedAccessException:

> > Access is denied.
> > >
> > >It fails at the open():
> > >Console program
> > >
> > >string strConnect = "workstation id=NYCNJGIBLIN;packet

> > size=4096;user
> > >id=jgiblin;data source=ewr1gpdsq" +
> > >
> > >"l;persist security info=False"; }
> > >
> > >SqlConnection conn = new SqlConnection(strConnect);
> > >
> > >SqlCommand cmd = new SqlCommand("Select * from

> > Content_Master", conn);
> > >
> > >// cmd.Connection = new SqlConnection(strConnect);
> > >
> > >// cmd.CommandText = "Content_Master_Update";
> > >
> > >cmd.CommandType = CommandType.Text;
> > >
> > >test = "Step 2";
> > >
> > >test = "Step 3";
> > >
> > >conn.Open();
> > >
> > >
> > >
> > >
> > >.
> > >

>
>



 
Reply With Quote
 
 
 
 
John Giblin
Guest
Posts: n/a
 
      07-16-2003
Like I said. I used the VS.net to create the connection string and I was
able to view the databases. I also used the test connection, which worked

What I need to know, is what the differences are between, the vs.net env and
asp. I have intergrated security on that server and in the webinfo file,
impersonate is set to false ( I have played with that either way)

Do I need the latest mdac? and why would the console program not work.

John
"dj Bass" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> if it's taken from another machine, then the things you need to check out
> are the domains for the database boxes you're trying to access... does the
> network machine exist with the same mappings as on the original PC? if

it's
> a different database instance, then you should probably start the

connection
> from scratch again.
>
> i still say try the design view, you see more happening there in front of
> you without worry about strings of info...
>
> Dan.
>
> "John Giblin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I just forgot that in that try. No affect. Still cannot connect. It

> seems
> > like a configuration on my mchine since it worked for someone else with

> the
> > same code
> >
> > John
> > "Jon Yates" <(E-Mail Removed)> wrote in message
> > news:00b401c34baa$90764760$(E-Mail Removed)...
> > > Hello mate.
> > >
> > > In your connection string you may need to supply the
> > > Username and Password to the Database. I've pasted in the
> > > connection sring that I use from within a Windows App to
> > > connection to a SQLServer 2000 DB.
> > >
> > > Hope it helps,
> > >
> > > Jon
> > >
> > > "Provider=sqloledb;data source=SUNWL19655\NetSDK;initial
> > > catalog=Portal; user id=sa; password="
> > >
> > > >-----Original Message-----
> > > >I have written both a asp.net and a console program where
> > > I am trying to
> > > >connection to a db.
> > > >
> > > >When I use the sqlconnection using vs.net 2003. I am able
> > > to see the table
> > > >and the test the connection
> > > >
> > > >When I run my program I get an error! ARGh!
> > > >
> > > >In my console program I get:
> > > >Error Request for the permission of type
> > > >System.Data.SqlClient.SqlClientPermission, System.Data,
> > > Version=1.0.5000.0,
> > > >Cul
> > > >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> > > >
> > > >In my asp.net i get this:
> > > >Exception Details: System.UnauthorizedAccessException:
> > > Access is denied.
> > > >
> > > >It fails at the open():
> > > >Console program
> > > >
> > > >string strConnect = "workstation id=NYCNJGIBLIN;packet
> > > size=4096;user
> > > >id=jgiblin;data source=ewr1gpdsq" +
> > > >
> > > >"l;persist security info=False"; }
> > > >
> > > >SqlConnection conn = new SqlConnection(strConnect);
> > > >
> > > >SqlCommand cmd = new SqlCommand("Select * from
> > > Content_Master", conn);
> > > >
> > > >// cmd.Connection = new SqlConnection(strConnect);
> > > >
> > > >// cmd.CommandText = "Content_Master_Update";
> > > >
> > > >cmd.CommandType = CommandType.Text;
> > > >
> > > >test = "Step 2";
> > > >
> > > >test = "Step 3";
> > > >
> > > >conn.Open();
> > > >
> > > >
> > > >
> > > >
> > > >.
> > > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Can connect to wireless but can not connect to internet Lucy Wireless Networking 2 09-23-2006 11:47 AM
Can connect to wireless but can not connect to internet Lucy Wireless Networking 0 09-22-2006 11:52 AM
Can connect to wireless but can not connect to internet Lucy Wireless Networking 0 09-22-2006 11:03 AM
Could Not Connect To SMTP Host Connection Failed -- Software caused connection abort: connect kishore@novelteam.com Java 3 11-16-2005 03:33 PM
Can't connect to local machine with anything except IE Other browsers can't connect without password Otis Mukinfus ASP .Net 3 07-08-2005 03:54 AM



Advertisments