RE: Web.config update to allow remote connection to sql server 200
- From: c676228 <betty@xxxxxxxxxxxxxxxx>
- Date: Fri, 16 Jan 2009 16:10:00 -0800
Hi all,
The line throw an exception is this line:
a.BeginRequest += new System.EventHandler(UrlRewrite_BeginRequest);
In the debugging mode, I can see under the _context-->Trace-->Non-Public
Members
there is a field _requestData has the following value and type"
Value: Cannot fetch the value of field '_requestData' because information
about the containing class is unavailable.
Type: System.Data.DataSet
As it is pointed in the error message, it seems that it cannot fetch some
data.
But the devastating part is I cannot find any database connect string the
program is using.
--
Betty
"c676228" wrote:
Hi all,.
After our administrator made the update based the reference link. I still
have the same problem. I did a bit research and add here to see if you guy
can help me.
I looked at code and it seems hard that to find out what database connection
string the program is using(our vendor's code).
In debugging mode, I found the function call is OpenDbConnection(string
connString), this source of this unction call is in our vendor's component
and I used reflector to see the original source code.
In the following function, it seems that the connString is not defined in
the program directly, at least it is not directly loaded from Web.config, am
I right?
but I cannot find connString directly in locale when I am debugging since it
is the code from our vendor's component. Is there an easy way to find out?
Again the database is located remotely and I am running the program on my
own computer.
Thanks,
Betty
public TConnection OpenDbConnection(string connString)
{
bool flag;
TConnection local = Activator.CreateInstance<TConnection>();
local.ConnectionString = connString;
Exception exception = null;
int num = 0;
do
{
flag = false;
try
{
local.Open();
}
catch (Exception exception2)
{
exception = exception2;
num++;
flag = true;
Thread.Sleep(500);
}
}
/*****************************************************/
I saw there is another overloaded function which is not related to this
error but I just want to make sure if my understanding is correct.
public TConnection OpenDbConnection()
{
string connectionString;
if (ConfigurationManager.AppSettings[this.pConnectionStringKey] != null)
{
connectionString =
ConfigurationManager.AppSettings[this.pConnectionStringKey];
}
else
{
if
(ConfigurationManager.ConnectionStrings[this.pConnectionStringKey].ConnectionString == null)
{
throw new Exception("'DefaultConnectionString' is not defined in
ConnectionStrings or AppSettings. Check web.config");
}
connectionString =
ConfigurationManager.ConnectionStrings[this.pConnectionStringKey].ConnectionString;
}
return this.OpenDbConnection(connectionString);
}
This one seems to use connectionString defined in the Web.config file. So I
need to give all users in the Web.config a remote database connection
capability, right?
--
Betty
""Hongye Sun [MSFT]"" wrote:
Hi Betty,
Thanks for your post.
The issue is basically a SQL Server connection issue. The best place to ask
such question is at newsgroup: microsoft.public.sqlserver.connect
I will give you a quick guidance about this issue and if it does not work,
please continue this issue in the right newsgroup, so that you can get most
help from both community members or Microsoft newsgroup service.
To connect to a SQL Server in a remote machine, you should:
1. Configure SQL Server 2005 to allow remote connections
Please follow the KB "How to configure SQL Server 2005 to allow remote
connections"
http://support.microsoft.com/kb/914277
2. Set connection string in Web.config file
Please follow the content "How To: Connect to SQL Server Using Windows
Authentication in ASP.NET 2.0"
http://msdn.microsoft.com/en-us/library/ms998292.aspx
Hope it helps.
Have a nice day.
Regards,
Hongye Sun (hongyes@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- References:
- Web.config update to allow remote connection to sql server 2005
- From: c676228
- RE: Web.config update to allow remote connection to sql server 2005
- From: "Hongye Sun [MSFT]"
- RE: Web.config update to allow remote connection to sql server 200
- From: c676228
- Web.config update to allow remote connection to sql server 2005
- Prev by Date: RE: Web.config update to allow remote connection to sql server 200
- Next by Date: RE: Web.config update to allow remote connection to sql server 200
- Previous by thread: RE: Web.config update to allow remote connection to sql server 200
- Next by thread: RE: Web.config update to allow remote connection to sql server 200
- Index(es):
Relevant Pages
|