Ask a Question related to ASP.NET Security, Design and Development.
-
dj Bass #1
Re: Cannot connect to db
The easiest thing to do is to use the design view in VS.net for ASP.net.
Select the Server control panel and drag and drop the connection you want
from there... this will allow you to correctly set up the connection and
view tables etc with in that database before you even compile/run your
program, so that when you do, you know the connection is nothing to worry
about.
I noticed there's no password field in your connection string, does your
connection require one?
good luck.
"John Giblin" <jwgiblin3@hotmail.com> wrote in message
news:eru$Ta6SDHA.1868@TK2MSFTNGP11.phx.gbl...Version=1.0.5000.0,> 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,> 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();
>
>
>
>
dj Bass Guest
-
i want to use connect old again.
i am doing chat application,when network failed it can not connect to FMS2, so i can not chat, but when network have got a gain, why I can not chat?... -
FCS connect
Hi Guys, I have a little issue with my connection. i am running my CCTV through my FlashComm Server and I have to start my broadcast manually.... -
Help Cant Connect?
I just simply want to connect to my webpage. I already have a website but then it asks me my network path? I dont even know what that is...I have... -
How to use “RDS.Connect” to connect to a MS Access database?
The example I am working from uses the following code which does not work: RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial ... -
cannot connect to DB from ASP.Net app
Hi, from a WinForms-app do I connect to a DB using a connectionstring : m_sqlConnection.ConnectionString = " workstation id=\"PC-WIN2000\";... -
dj Bass #2
Re: Cannot connect to db
The easiest thing to do is to use the design view in VS.net for ASP.net.
Select the Server control panel and drag and drop the connection you want
from there... this will allow you to correctly set up the connection and
view tables etc with in that database before you even compile/run your
program, so that when you do, you know the connection is nothing to worry
about.
I noticed there's no password field in your connection string, does your
connection require one?
good luck.
"John Giblin" <jwgiblin3@hotmail.com> wrote in message
news:eru$Ta6SDHA.1868@TK2MSFTNGP11.phx.gbl...Version=1.0.5000.0,> 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,> 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();
>
>
>
>
dj Bass Guest
-
John Giblin #3
Re: Cannot connect to db
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" <Dont@Spamme.com> wrote in message
news:00b401c34baa$90764760$a101280a@phx.gbl...> 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="
>> I am trying to> >-----Original Message-----
> >I have written both a asp.net and a console program where> to see the table> >connection to a db.
> >
> >When I use the sqlconnection using vs.net 2003. I am able> Version=1.0.5000.0,> >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,> Access is denied.> >Cul
> >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> >
> >In my asp.net i get this:
> >Exception Details: System.UnauthorizedAccessException:> size=4096;user> >
> >It fails at the open():
> >Console program
> >
> >string strConnect = "workstation id=NYCNJGIBLIN;packet> Content_Master", conn);> >id=jgiblin;data source=ewr1gpdsq" +
> >
> >"l;persist security info=False"; }
> >
> >SqlConnection conn = new SqlConnection(strConnect);
> >
> >SqlCommand cmd = new SqlCommand("Select * from> >
> >// cmd.Connection = new SqlConnection(strConnect);
> >
> >// cmd.CommandText = "Content_Master_Update";
> >
> >cmd.CommandType = CommandType.Text;
> >
> >test = "Step 2";
> >
> >test = "Step 3";
> >
> >conn.Open();
> >
> >
> >
> >
> >.
> >
John Giblin Guest
-
John Giblin #4
Re: Cannot connect to db
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" <Dont@Spamme.com> wrote in message
news:00b401c34baa$90764760$a101280a@phx.gbl...> 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="
>> I am trying to> >-----Original Message-----
> >I have written both a asp.net and a console program where> to see the table> >connection to a db.
> >
> >When I use the sqlconnection using vs.net 2003. I am able> Version=1.0.5000.0,> >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,> Access is denied.> >Cul
> >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> >
> >In my asp.net i get this:
> >Exception Details: System.UnauthorizedAccessException:> size=4096;user> >
> >It fails at the open():
> >Console program
> >
> >string strConnect = "workstation id=NYCNJGIBLIN;packet> Content_Master", conn);> >id=jgiblin;data source=ewr1gpdsq" +
> >
> >"l;persist security info=False"; }
> >
> >SqlConnection conn = new SqlConnection(strConnect);
> >
> >SqlCommand cmd = new SqlCommand("Select * from> >
> >// cmd.Connection = new SqlConnection(strConnect);
> >
> >// cmd.CommandText = "Content_Master_Update";
> >
> >cmd.CommandType = CommandType.Text;
> >
> >test = "Step 2";
> >
> >test = "Step 3";
> >
> >conn.Open();
> >
> >
> >
> >
> >.
> >
John Giblin Guest
-
dj Bass #5
Re: Cannot connect to db
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" <jwgiblin3@hotmail.com> wrote in message
news:OVWoYC7SDHA.2248@TK2MSFTNGP11.phx.gbl...seems> I just forgot that in that try. No affect. Still cannot connect. Itthe> like a configuration on my mchine since it worked for someone else with> same code
>
> John
> "Jon Yates" <Dont@Spamme.com> wrote in message
> news:00b401c34baa$90764760$a101280a@phx.gbl...>> > 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="
> >> > I am trying to> > >-----Original Message-----
> > >I have written both a asp.net and a console program where> > to see the table> > >connection to a db.
> > >
> > >When I use the sqlconnection using vs.net 2003. I am able> > Version=1.0.5000.0,> > >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,> > Access is denied.> > >Cul
> > >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> > >
> > >In my asp.net i get this:
> > >Exception Details: System.UnauthorizedAccessException:> > size=4096;user> > >
> > >It fails at the open():
> > >Console program
> > >
> > >string strConnect = "workstation id=NYCNJGIBLIN;packet> > Content_Master", conn);> > >id=jgiblin;data source=ewr1gpdsq" +
> > >
> > >"l;persist security info=False"; }
> > >
> > >SqlConnection conn = new SqlConnection(strConnect);
> > >
> > >SqlCommand cmd = new SqlCommand("Select * from> > >
> > >// cmd.Connection = new SqlConnection(strConnect);
> > >
> > >// cmd.CommandText = "Content_Master_Update";
> > >
> > >cmd.CommandType = CommandType.Text;
> > >
> > >test = "Step 2";
> > >
> > >test = "Step 3";
> > >
> > >conn.Open();
> > >
> > >
> > >
> > >
> > >.
> > >
>
dj Bass Guest
-
dj Bass #6
Re: Cannot connect to db
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" <jwgiblin3@hotmail.com> wrote in message
news:OVWoYC7SDHA.2248@TK2MSFTNGP11.phx.gbl...seems> I just forgot that in that try. No affect. Still cannot connect. Itthe> like a configuration on my mchine since it worked for someone else with> same code
>
> John
> "Jon Yates" <Dont@Spamme.com> wrote in message
> news:00b401c34baa$90764760$a101280a@phx.gbl...>> > 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="
> >> > I am trying to> > >-----Original Message-----
> > >I have written both a asp.net and a console program where> > to see the table> > >connection to a db.
> > >
> > >When I use the sqlconnection using vs.net 2003. I am able> > Version=1.0.5000.0,> > >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,> > Access is denied.> > >Cul
> > >ture=neutral, PublicKeyToken=b77a5c561934e089 failed.
> > >
> > >In my asp.net i get this:
> > >Exception Details: System.UnauthorizedAccessException:> > size=4096;user> > >
> > >It fails at the open():
> > >Console program
> > >
> > >string strConnect = "workstation id=NYCNJGIBLIN;packet> > Content_Master", conn);> > >id=jgiblin;data source=ewr1gpdsq" +
> > >
> > >"l;persist security info=False"; }
> > >
> > >SqlConnection conn = new SqlConnection(strConnect);
> > >
> > >SqlCommand cmd = new SqlCommand("Select * from> > >
> > >// cmd.Connection = new SqlConnection(strConnect);
> > >
> > >// cmd.CommandText = "Content_Master_Update";
> > >
> > >cmd.CommandType = CommandType.Text;
> > >
> > >test = "Step 2";
> > >
> > >test = "Step 3";
> > >
> > >conn.Open();
> > >
> > >
> > >
> > >
> > >.
> > >
>
dj Bass Guest
-
John Giblin #7
Re: Cannot connect to db
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" <spanz_za@hotmail.com> wrote in message
news:uyFKVP7SDHA.3144@tk2msftngp13.phx.gbl...it's> 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? ifconnection> a different database instance, then you should probably start the> 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" <jwgiblin3@hotmail.com> wrote in message
> news:OVWoYC7SDHA.2248@TK2MSFTNGP11.phx.gbl...> seems> > I just forgot that in that try. No affect. Still cannot connect. It> the> > like a configuration on my mchine since it worked for someone else with>> > same code
> >
> > John
> > "Jon Yates" <Dont@Spamme.com> wrote in message
> > news:00b401c34baa$90764760$a101280a@phx.gbl...> >> > > 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();
> > > >
> > > >
> > > >
> > > >
> > > >.
> > > >
> >
>
John Giblin Guest
-
John Giblin #8
Re: Cannot connect to db
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" <spanz_za@hotmail.com> wrote in message
news:uyFKVP7SDHA.3144@tk2msftngp13.phx.gbl...it's> 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? ifconnection> a different database instance, then you should probably start the> 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" <jwgiblin3@hotmail.com> wrote in message
> news:OVWoYC7SDHA.2248@TK2MSFTNGP11.phx.gbl...> seems> > I just forgot that in that try. No affect. Still cannot connect. It> the> > like a configuration on my mchine since it worked for someone else with>> > same code
> >
> > John
> > "Jon Yates" <Dont@Spamme.com> wrote in message
> > news:00b401c34baa$90764760$a101280a@phx.gbl...> >> > > 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();
> > > >
> > > >
> > > >
> > > >
> > > >.
> > > >
> >
>
John Giblin Guest
-
John Giblin #9
Re: Cannot connect to db
Thanks everyone for you help. I figured out the problem.
I just updated the MDAC on the server to the latest.
Thanks Everyone
"John Giblin" <jwgiblin3@hotmail.com> wrote in message
news:eru$Ta6SDHA.1868@TK2MSFTNGP11.phx.gbl...Version=1.0.5000.0,> 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,> 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();
>
>
>
>
John Giblin Guest
-
John Giblin #10
Re: Cannot connect to db
Thanks everyone for you help. I figured out the problem.
I just updated the MDAC on the server to the latest.
Thanks Everyone
"John Giblin" <jwgiblin3@hotmail.com> wrote in message
news:eru$Ta6SDHA.1868@TK2MSFTNGP11.phx.gbl...Version=1.0.5000.0,> 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,> 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();
>
>
>
>
John Giblin Guest



Reply With Quote

