Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Friday, March 16, 2012

"Tree View" with a SQL Server Database

We need to present hierarchical data on a web page, the same way the
tree view shows files in Windows Explorer. Here's the catch: that
tree view needs to be bound to a SQL Server database. How can this be
done?Simplist is an adjacency list. Store the parent ID along with each record,
also store the "full path" in a text string, such as 0001/0004/0007/0002
(the second node of the seventh node of the 4th node of the 1st node of the
tree). I use a function to generate a number for the string (below)
because each "path node" has to be the same length in order to perform a
correct "select" of the tree order. You also need a "sibling number" if you
want to order your nodes in an arbitrary way.

ALTER FUNCTION dbo.func_Get_Padded_Number8
(
@.number INTEGER
)
RETURNS VARCHAR(8)
AS
BEGIN
DECLARE @.Value VARCHAR(8)
DECLARE @.Length INTEGER

/*
Convert the number and get its string length
*/

SET @.Value = CONVERT ( VARCHAR ( 8 ), @.number )
SET @.Length = LEN ( @.Value )

/*
If the length is less than 8, pad it
*/
IF LEN ( @.Value ) < 8
BEGIN
SET @.Value = REPLACE ( SPACE ( 8 - @.Length ), ' ', '0' ) + @.Value
END

RETURN @.Value
END

Adding a new node is simple given the parent, you just find the highest
sibling number of the parent and increment it then insert a node, building
the path string by taking the parent and adding "/00n" (where n is the
sibling number). Listing all of the nodes in the tree structure can be done
easily like this:

SELECT dbo.Adjacency.ID, (a unique ID)
dbo.Adjacency.ID_Parent, (the unique ID of the parent of
this node)
dbo.Adjacency.ID_Index, (the sibling number of this child)
LEN(dbo.Adjacency.Path) / 9 AS Depth, (the depth of the
node, useful for building your tree structure afterwards)
FROM dbo.Adjacency
ORDER BY dbo.Adjacency.Path

Hope this helps some.

<imani_technology_spam@.yahoo.com> wrote in message
news:8be6e8.0312030710.3b40bc89@.posting.google.com ...
> We need to present hierarchical data on a web page, the same way the
> tree view shows files in Windows Explorer. Here's the catch: that
> tree view needs to be bound to a SQL Server database. How can this be
> done?|||This helps a lot. Thanks. I wonder if there is a practical graphical
solution in addition to the text-based solution?

"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in message news:<bqn6dt$o7l$1$830fa7b3@.news.demon.co.uk>...
> Simplist is an adjacency list. Store the parent ID along with each record,
> also store the "full path" in a text string, such as 0001/0004/0007/0002
> (the second node of the seventh node of the 4th node of the 1st node of the
> tree). I use a function to generate a number for the string (below)
> because each "path node" has to be the same length in order to perform a
> correct "select" of the tree order. You also need a "sibling number" if you
> want to order your nodes in an arbitrary way.
> ALTER FUNCTION dbo.func_Get_Padded_Number8
> (
> @.number INTEGER
> )
> RETURNS VARCHAR(8)
> AS
> BEGIN
> DECLARE @.Value VARCHAR(8)
> DECLARE @.Length INTEGER
> /*
> Convert the number and get its string length
> */
> SET @.Value = CONVERT ( VARCHAR ( 8 ), @.number )
> SET @.Length = LEN ( @.Value )
> /*
> If the length is less than 8, pad it
> */
> IF LEN ( @.Value ) < 8
> BEGIN
> SET @.Value = REPLACE ( SPACE ( 8 - @.Length ), ' ', '0' ) + @.Value
> END
> RETURN @.Value
> END
> Adding a new node is simple given the parent, you just find the highest
> sibling number of the parent and increment it then insert a node, building
> the path string by taking the parent and adding "/00n" (where n is the
> sibling number). Listing all of the nodes in the tree structure can be done
> easily like this:
> SELECT dbo.Adjacency.ID, (a unique ID)
> dbo.Adjacency.ID_Parent, (the unique ID of the parent of
> this node)
> dbo.Adjacency.ID_Index, (the sibling number of this child)
> LEN(dbo.Adjacency.Path) / 9 AS Depth, (the depth of the
> node, useful for building your tree structure afterwards)
> FROM dbo.Adjacency
> ORDER BY dbo.Adjacency.Path
> Hope this helps some.
> <imani_technology_spam@.yahoo.com> wrote in message
> news:8be6e8.0312030710.3b40bc89@.posting.google.com ...
> > We need to present hierarchical data on a web page, the same way the
> > tree view shows files in Windows Explorer. Here's the catch: that
> > tree view needs to be bound to a SQL Server database. How can this be
> > done?|||Hi

I posted this a short time ago!
http://tinyurl.com/xw5s

John

<imani_technology_spam@.yahoo.com> wrote in message
news:8be6e8.0312050907.644b5abe@.posting.google.com ...
> This helps a lot. Thanks. I wonder if there is a practical graphical
> solution in addition to the text-based solution?
> "Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:<bqn6dt$o7l$1$830fa7b3@.news.demon.co.uk>...
> > Simplist is an adjacency list. Store the parent ID along with each
record,
> > also store the "full path" in a text string, such as 0001/0004/0007/0002
> > (the second node of the seventh node of the 4th node of the 1st node of
the
> > tree). I use a function to generate a number for the string (below)
> > because each "path node" has to be the same length in order to perform a
> > correct "select" of the tree order. You also need a "sibling number" if
you
> > want to order your nodes in an arbitrary way.
> > ALTER FUNCTION dbo.func_Get_Padded_Number8
> > (
> > @.number INTEGER
> > )
> > RETURNS VARCHAR(8)
> > AS
> > BEGIN
> > DECLARE @.Value VARCHAR(8)
> > DECLARE @.Length INTEGER
> > /*
> > Convert the number and get its string length
> > */
> > SET @.Value = CONVERT ( VARCHAR ( 8 ), @.number )
> > SET @.Length = LEN ( @.Value )
> > /*
> > If the length is less than 8, pad it
> > */
> > IF LEN ( @.Value ) < 8
> > BEGIN
> > SET @.Value = REPLACE ( SPACE ( 8 - @.Length ), ' ', '0' ) +
@.Value
> > END
> > RETURN @.Value
> > END
> > Adding a new node is simple given the parent, you just find the highest
> > sibling number of the parent and increment it then insert a node,
building
> > the path string by taking the parent and adding "/00n" (where n is the
> > sibling number). Listing all of the nodes in the tree structure can be
done
> > easily like this:
> > SELECT dbo.Adjacency.ID, (a unique ID)
> > dbo.Adjacency.ID_Parent, (the unique ID of the parent
of
> > this node)
> > dbo.Adjacency.ID_Index, (the sibling number of this
child)
> > LEN(dbo.Adjacency.Path) / 9 AS Depth, (the depth of
the
> > node, useful for building your tree structure afterwards)
> > FROM dbo.Adjacency
> > ORDER BY dbo.Adjacency.Path
> > Hope this helps some.
> > <imani_technology_spam@.yahoo.com> wrote in message
> > news:8be6e8.0312030710.3b40bc89@.posting.google.com ...
> > > We need to present hierarchical data on a web page, the same way the
> > > tree view shows files in Windows Explorer. Here's the catch: that
> > > tree view needs to be bound to a SQL Server database. How can this be
> > > done?

Sunday, March 11, 2012

"SQL Server does not exist or access denied" error message

Hello!

When I start my .aspx with ASP.NET Web Matrix Server, it work, but when i try to start it with IIS I get error message.

TIA,

Misha

What is your connection string to the database like? Are you using a trusted connection? Is IIS running under a different account than Web Matrix? SQL Server needs to know about which accounts are acceptable.

|||string ConnectionString = "server=SERVER;database=pubs;trusted_connection=true";
SQL is on server PC, Web Matrix on Workstation.

"SQL Server does not exist or access denied" error

I'm trying to create to set up connection between my web application on the server and
the database on another box and getting "SQL Server does not exist or access denied" error.
Both the web server and the database machine are Windows 2003 Server, there's no firewall
enabled, there's mixed authentication enabled on the sql server. The machines are not on the
same domain so I'm using SQL Server authentication from web.config. Here's my connection string:
<add key="ConnectionString" value="Server=sqlboxip;User id=sqlaccountname;Pwd=sqlpass;Initial catalog=dbname">
I've also got <identity impersonate="true"> set in web.config.
Had it the connection working at some stage but then with more tweaking and app reinstall
back square one... Please help!</identity></add>Hi,
Are you able to connect to the SQL Server Database using the same credentials from SQL Server (Enterprise Manager or Query Analyzer?)
Thanks.|||Yes, I can connect to it from my dev box in ASP.NET
|||Did you set the connection string of your connection on that page of the app?

I put this in the page load.
this.cnMainConnection.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionsString"].ToString();

|||Hi,
Ok, can you post the code which you are trying to execute.
Thanks.

"SQL Server does not exist or access denied"

Hi everyone!

I receive error "SQL Server does not exist or access denied" when I try to run a web application from my notebook. (when I'm working at home) The weird thing is that it occurs sporadically. Sometimes the connection works just fine. Other times it fails. When I run the application on my workstation at the office everything works perfectly.

Here's the stack trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Torris.Common.Data.GetDataSet(String ConnectionString, String sql) in c:\_\Manager\common\data.cs:14
Torris.Manager.Sizes.ListSizes() in C:\_\Manager\Sizes.ascx.cs:145
Torris.Manager.Sizes.Page_Load(Object sender, EventArgs e) in C:\_\Manager\Sizes.ascx.cs:77
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +731

-----------------

Of course, I make sure to change the connection strings in both environments.

Anyone have an idea of what I can look at to try to troubleshoot?

Thanks as always!!

Emi ^_^Hi Emi,

This is virtually always an access issue. How are you trying to connect to the db? IOW, what is your connection string? Are you sure your laptop is setup properly?

The other thing that strikes me is connection pooling. Do you do anything with pooling--change defaults, etc.--in the app?

Don|||Hi!

Thanks for responding. Still having the issue - it's so frustrating. I'm storing my connection string in the web.config which is then read and used in my Data.cs (database class)

Here's the connection string. In this case, the database is on the same machine as the web application. (similar to the how the client's production server is setup):


<add key="ConnectionString" value="server=MyComputerName;database=DatabaseName;uid=sa;pwd=NonBlankPassword;" />

An example of the actual data access - nothing complex here.


public static void ExecuteSql(string ConnectionString, string sql)
{
SqlConnection conn = new SqlConnection(ConnectionString);
SqlCommand cmd = new SqlCommand(sql,conn);
conn.Open();
cmd.ExecuteNonQuery();
cmd.Dispose();
conn.Close();
conn.Dispose();
}

Like I mentioned before, all works great on my workstation at the office. This might totally be a hardware - issue. Is there anything wrong with the above code that would cause any pooling problems.

Thanks again!

Emi ^_^|||Hi Emi,

Okay, assuming that your sa password in the actual connection string is right, everything else looks okay.

One thing to check is whether the SS2K server is set up to use SQL Server authentication rather than Windows integrated authentication only. You can do that in Enterprise Manager, right-clicking on the server, and selecting Properties. Under the Security tab make sure that "SQL Server and Windows" is selected.

Sigh. But never mind about that. This doesn't explain the sporadic nature of the error. There is something going on with the connection pool. You're not doing anything with the connection pool in your code, but it has a problem when it goes to the pool for a connection. Hmm. And it's happening deep within the .NET framework.

Have you monitored the pool to make sure that connections are still available? It's a weird error to get for a depleted pool, though.

This will take more research. Anyone else have any ideas?

Don

"sp_cursor" error while printing web report using Reporting Servic

Hi there,
We're using MS SQL 2000 with MS Server 2003. It's a Xeon ( single processor)
based Server with 1GB RAM.
We also use 'Reporting Services' to generate web reports.
The problem is , our application will have problem writing ( ie. INSERT
INTO) to the transaction database if the web reporting is printing data from
the same transaction table.
Following errors were captured in our application.
_sp_cursor:_The_cursor_identifier_value_provided_(xxxxxxx)_is_not_valid
where xxxxxx cpuld be some kind of hex codes , for example 'abcdf08'
,'abcdf03' etc.
Could the MS SQL Server not able to cope during high traffic?
Pls. help.
Thanks.
CD MooHi
This sounds like you may have blocking/deadlocking which rolls back the
reporting services connection. To monitor this check out
http://support.microsoft.com/kb/271509/EN-US/. If you do not need to report
on the currently live data, then you would be better creating a copy
periodically and point the reports to that. If you need more up-to-date data
you may want to check out log shipping. With SQL 2005 you could use database
snapshots for this purpose.
John
"CD Moo" wrote:
> Hi there,
> We're using MS SQL 2000 with MS Server 2003. It's a Xeon ( single processor)
> based Server with 1GB RAM.
> We also use 'Reporting Services' to generate web reports.
> The problem is , our application will have problem writing ( ie. INSERT
> INTO) to the transaction database if the web reporting is printing data from
> the same transaction table.
> Following errors were captured in our application.
> _sp_cursor:_The_cursor_identifier_value_provided_(xxxxxxx)_is_not_valid
> where xxxxxx cpuld be some kind of hex codes , for example 'abcdf08'
> ,'abcdf03' etc.
> Could the MS SQL Server not able to cope during high traffic?
> Pls. help.
> Thanks.
> CD Moo
>|||Hi there,
We're using SQL Server 2000 with the latest service pack.
I have 2 SQL Servers, Server1 & Server2.
I created a table named Trade in Server1.
Created a view named vwTrade in Server2.
At first, I can see the data from vwTrade. Then I deleted the content of
Trade. Uploaded it with a new set of data using DTS from a foxpro database.
but after that, it is can no longer be seen in vwTrade. If I create another
view named vwTrade2 in Server1, it works fine. But when the view is
recreated in Server2, it just give and empty rowset.
Regards,
Jefrey

"sp_cursor" error while printing web report using Reporting Servic

Hi there,
We're using MS SQL 2000 with MS Server 2003. It's a Xeon ( single processor)
based Server with 1GB RAM.
We also use 'Reporting Services' to generate web reports.
The problem is , our application will have problem writing ( ie. INSERT
INTO) to the transaction database if the web reporting is printing data from
the same transaction table.
Following errors were captured in our application.
_sp_cursor:_The_cursor_identifier_value_
provided_(xxxxxxx)_is_not_valid
where xxxxxx cpuld be some kind of hex codes , for example 'abcdf08'
,'abcdf03' etc.
Could the MS SQL Server not able to cope during high traffic?
Pls. help.
Thanks.
CD MooHi
This sounds like you may have blocking/deadlocking which rolls back the
reporting services connection. To monitor this check out
http://support.microsoft.com/kb/271509/EN-US/. If you do not need to report
on the currently live data, then you would be better creating a copy
periodically and point the reports to that. If you need more up-to-date data
you may want to check out log shipping. With SQL 2005 you could use database
snapshots for this purpose.
John
"CD Moo" wrote:

> Hi there,
> We're using MS SQL 2000 with MS Server 2003. It's a Xeon ( single processo
r)
> based Server with 1GB RAM.
> We also use 'Reporting Services' to generate web reports.
> The problem is , our application will have problem writing ( ie. INSERT
> INTO) to the transaction database if the web reporting is printing data fr
om
> the same transaction table.
> Following errors were captured in our application.
> _sp_cursor:_The_cursor_identifier_value_
provided_(xxxxxxx)_is_not_valid
> where xxxxxx cpuld be some kind of hex codes , for example 'abcdf08'
> ,'abcdf03' etc.
> Could the MS SQL Server not able to cope during high traffic?
> Pls. help.
> Thanks.
> CD Moo
>

"Server does not exist or access is denied"

Hi,
I am trying to connect a web service to an SQL Server 2000 database. SQL
Server is installed and started and the database appears on the Enterprise
MAnager window but it does not appear in the Server Explorer in VS2003.NET
IDE window.It gives the error "Server does not exist or access is denied".
I have re-installed both SQL server and VS but have not being able to solve
this problem.
Can someone help me out ? A prompt reply will be highly appreciated.
Regards
Kapila
Where is the Server Explorer installed? Is it on a different machine or
different network? Based on the error message, it looks like the Server
Explorer is unable to find your SQL Server on the network. A network issue
is more likey to be the case. Can you ping the SQL Server computer from the
Server Explorer box?
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
SERVER EXPL@.discussions.microsoft.com> wrote in message
news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> Hi,
> I am trying to connect a web service to an SQL Server 2000 database. SQL
> Server is installed and started and the database appears on the Enterprise
> MAnager window but it does not appear in the Server Explorer in VS2003.NET
> IDE window.It gives the error "Server does not exist or access is denied".
> I have re-installed both SQL server and VS but have not being able to
solve
> this problem.
> Can someone help me out ? A prompt reply will be highly appreciated.
> Regards
> Kapila
|||The server explorer is installed on the same system. I am not on a network.
The services are running.
Thanks
Kapila
"Narayana Vyas Kondreddi" wrote:

> Where is the Server Explorer installed? Is it on a different machine or
> different network? Based on the error message, it looks like the Server
> Explorer is unable to find your SQL Server on the network. A network issue
> is more likey to be the case. Can you ping the SQL Server computer from the
> Server Explorer box?
> --
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
> SERVER EXPL@.discussions.microsoft.com> wrote in message
> news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> solve
>
>

"Server does not exist or access is denied"

Hi,
I am trying to connect a web service to an SQL Server 2000 database. SQL
Server is installed and started and the database appears on the Enterprise
MAnager window but it does not appear in the Server Explorer in VS2003.NET
IDE window.It gives the error "Server does not exist or access is denied".
I have re-installed both SQL server and VS but have not being able to solve
this problem.
Can someone help me out ? A prompt reply will be highly appreciated.
Regards
Kapila
Is the SQL Server running?
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
SERVER EXPL@.discussions.microsoft.com> wrote in message
news:61B0D79D-A657-4D25-AC9C-69349C3286B3@.microsoft.com...
> Hi,
> I am trying to connect a web service to an SQL Server 2000 database. SQL
> Server is installed and started and the database appears on the Enterprise
> MAnager window but it does not appear in the Server Explorer in VS2003.NET
> IDE window.It gives the error "Server does not exist or access is denied".
> I have re-installed both SQL server and VS but have not being able to
> solve
> this problem.
> Can someone help me out ? A prompt reply will be highly appreciated.
> Regards
> Kapila
|||Yes, it does. It is shown on the status bar and also in Services. However, it
is not appearing in the computer management console of MS Server 2003.
Best wishes.
Kapila
"Kalen Delaney" wrote:

> Is the SQL Server running?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
> SERVER EXPL@.discussions.microsoft.com> wrote in message
> news:61B0D79D-A657-4D25-AC9C-69349C3286B3@.microsoft.com...
>
>
|||It is possible for the SQL Enterprise or iSQL applications to see and work
with SQL server instances while other non-SQL tools such as VS.Net may not
see your SQL servers at all. (based on your problem description)
1. Check to see how the SQL Security is configured on the server. The best
practice is to configure it with Windows Integrated.
2. I always configure SQL Server with Mixed modes (W and Sql). Reason: My
developer PC may not always log on to the Windows Server/Domain where my SQL
Instance is hosted. If such condition exists, then SQL Authentication mode
kicks in to allow me to log on to it.
3. Another suggestion is that if your server is not in the DNS system, then
it is safe to put it in your Windows/HOSTS file. This way everybody
(applications) on your PC can see it.
John Webb

"Server does not exist or access is denied"

Hi,
I am trying to connect a web service to an SQL Server 2000 database. SQL
Server is installed and started and the database appears on the Enterprise
MAnager window but it does not appear in the Server Explorer in VS2003.NET
IDE window.It gives the error "Server does not exist or access is denied".
I have re-installed both SQL server and VS but have not being able to solve
this problem.
Can someone help me out ? A prompt reply will be highly appreciated.
Regards
KapilaIs the SQL Server running?
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
SERVER EXPL@.discussions.microsoft.com> wrote in message
news:61B0D79D-A657-4D25-AC9C-69349C3286B3@.microsoft.com...
> Hi,
> I am trying to connect a web service to an SQL Server 2000 database. SQL
> Server is installed and started and the database appears on the Enterprise
> MAnager window but it does not appear in the Server Explorer in VS2003.NET
> IDE window.It gives the error "Server does not exist or access is denied".
> I have re-installed both SQL server and VS but have not being able to
> solve
> this problem.
> Can someone help me out ? A prompt reply will be highly appreciated.
> Regards
> Kapila|||Yes, it does. It is shown on the status bar and also in Services. However, i
t
is not appearing in the computer management console of MS Server 2003.
Best wishes.
Kapila
"Kalen Delaney" wrote:

> Is the SQL Server running?
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
> SERVER EXPL@.discussions.microsoft.com> wrote in message
> news:61B0D79D-A657-4D25-AC9C-69349C3286B3@.microsoft.com...
>
>|||It is possible for the SQL Enterprise or iSQL applications to see and work
with SQL server instances while other non-SQL tools such as VS.Net may not
see your SQL servers at all. (based on your problem description)
1. Check to see how the SQL Security is configured on the server. The best
practice is to configure it with Windows Integrated.
2. I always configure SQL Server with Mixed modes (W and Sql). Reason: My
developer PC may not always log on to the Windows Server/Domain where my SQL
Instance is hosted. If such condition exists, then SQL Authentication mode
kicks in to allow me to log on to it.
3. Another suggestion is that if your server is not in the DNS system, then
it is safe to put it in your Windows/HOSTS file. This way everybody
(applications) on your PC can see it.
John Webb

"Server does not exist or access is denied"

Hi,
I am trying to connect a web service to an SQL Server 2000 database. SQL
Server is installed and started and the database appears on the Enterprise
MAnager window but it does not appear in the Server Explorer in VS2003.NET
IDE window.It gives the error "Server does not exist or access is denied".
I have re-installed both SQL server and VS but have not being able to solve
this problem.
Can someone help me out ? A prompt reply will be highly appreciated.
Regards
KapilaWhere is the Server Explorer installed? Is it on a different machine or
different network? Based on the error message, it looks like the Server
Explorer is unable to find your SQL Server on the network. A network issue
is more likey to be the case. Can you ping the SQL Server computer from the
Server Explorer box?
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
SERVER EXPL@.discussions.microsoft.com> wrote in message
news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> Hi,
> I am trying to connect a web service to an SQL Server 2000 database. SQL
> Server is installed and started and the database appears on the Enterprise
> MAnager window but it does not appear in the Server Explorer in VS2003.NET
> IDE window.It gives the error "Server does not exist or access is denied".
> I have re-installed both SQL server and VS but have not being able to
solve
> this problem.
> Can someone help me out ? A prompt reply will be highly appreciated.
> Regards
> Kapila|||The server explorer is installed on the same system. I am not on a network.
The services are running.
Thanks
Kapila
"Narayana Vyas Kondreddi" wrote:

> Where is the Server Explorer installed? Is it on a different machine or
> different network? Based on the error message, it looks like the Server
> Explorer is unable to find your SQL Server on the network. A network issue
> is more likey to be the case. Can you ping the SQL Server computer from th
e
> Server Explorer box?
> --
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
> SERVER EXPL@.discussions.microsoft.com> wrote in message
> news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> solve
>
>

"Server does not exist or access is denied"

Hi,
I am trying to connect a web service to an SQL Server 2000 database. SQL
Server is installed and started and the database appears on the Enterprise
MAnager window but it does not appear in the Server Explorer in VS2003.NET
IDE window.It gives the error "Server does not exist or access is denied".
I have re-installed both SQL server and VS but have not being able to solve
this problem.
Can someone help me out ? A prompt reply will be highly appreciated.
Regards
KapilaWhere is the Server Explorer installed? Is it on a different machine or
different network? Based on the error message, it looks like the Server
Explorer is unable to find your SQL Server on the network. A network issue
is more likey to be the case. Can you ping the SQL Server computer from the
Server Explorer box?
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
SERVER EXPL@.discussions.microsoft.com> wrote in message
news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> Hi,
> I am trying to connect a web service to an SQL Server 2000 database. SQL
> Server is installed and started and the database appears on the Enterprise
> MAnager window but it does not appear in the Server Explorer in VS2003.NET
> IDE window.It gives the error "Server does not exist or access is denied".
> I have re-installed both SQL server and VS but have not being able to
solve
> this problem.
> Can someone help me out ? A prompt reply will be highly appreciated.
> Regards
> Kapila|||The server explorer is installed on the same system. I am not on a network.
The services are running.
Thanks
Kapila
"Narayana Vyas Kondreddi" wrote:
> Where is the Server Explorer installed? Is it on a different machine or
> different network? Based on the error message, it looks like the Server
> Explorer is unable to find your SQL Server on the network. A network issue
> is more likey to be the case. Can you ping the SQL Server computer from the
> Server Explorer box?
> --
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "CAN'T SEE THE SERVER FROM VS SERVER EXPL" <CAN'T SEE THE SERVER FROM VS
> SERVER EXPL@.discussions.microsoft.com> wrote in message
> news:B122F925-40E5-4CFA-AA57-279E47242E4F@.microsoft.com...
> > Hi,
> >
> > I am trying to connect a web service to an SQL Server 2000 database. SQL
> > Server is installed and started and the database appears on the Enterprise
> > MAnager window but it does not appear in the Server Explorer in VS2003.NET
> > IDE window.It gives the error "Server does not exist or access is denied".
> >
> > I have re-installed both SQL server and VS but have not being able to
> solve
> > this problem.
> >
> > Can someone help me out ? A prompt reply will be highly appreciated.
> >
> > Regards
> >
> > Kapila
>
>

Thursday, March 8, 2012

"query contained only ignored words "?

When I try to search a word by an ASP web page, it returns error '80040e14
, The query contained only ignored words'. I know the question maybe asked
for many many times and I do search the Internet but cannot find the answer
right for me.
I use Windows 2003 SP1 and SQL server 2000, all are Chinese Simplified
Edition. According to some articles, I empty the noise.chs in the C:
\windows\system32 and C:\Program Files\Common Files\System\MSSearch\Data
\Config, then re-index the fulltext. But the error still exists. Pls help
me, thanks.
Hi. I've got the answer. I add a space to the noise.chs instead of clear
all the content. thanks!
mizi <haha@.haha.com> wrote in
news:Xns9725D5AB6E7B0hahahahacom@.207.46.248.16:

> When I try to search a word by an ASP web page, it returns error
> '80040e14 , The query contained only ignored words'. I know the
> question maybe asked for many many times and I do search the Internet
> but cannot find the answer right for me.
> I use Windows 2003 SP1 and SQL server 2000, all are Chinese Simplified
> Edition. According to some articles, I empty the noise.chs in the C:
> \windows\system32 and C:\Program Files\Common
> Files\System\MSSearch\Data \Config, then re-index the fulltext. But
> the error still exists. Pls help me, thanks.
>

Tuesday, March 6, 2012

"Object reference not set to an instance of an object. " and connection string

Hi, I am deploying my web through a web hosting services which provides SQL database support. I got following errors whenever I try to open my webpage,which never happen when I run my web on the local machine.

I have my connection string configured in my web.config as below:

<addname="ArtHouseConnection"connectionString="Server=serveripaddress; Integrated Security=True; Database=arteh3_database;User Id=username;Password=password;"providerName="System.Data.SqlClient"/>

<addname="ASPNETDBConnectionString1"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient"/>

This is the source code where error was generated:

public

staticclass ArtHouseConfiguration

{

//cache connection stringprivatereadonlystaticstring dbConnectionString;//cache data provider nameprivatereadonlystaticstring dbProviderName;

privatereadonlystaticstring siteName;

//initialize constructor propertiesstatic ArtHouseConfiguration()

{

dbConnectionString = ConfigurationManager.ConnectionStrings[

"ArtHouseConnection"].ConnectionString;

dbProviderName = ConfigurationManager.ConnectionStrings[

"ArtHouseConnection"].ProviderName;

siteName = ConfigurationManager.AppSettings["SiteName"];

}


and finally this is the error mg I got:

Object reference not set to an instance of an object.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 30: static ArtHouseConfiguration()Line 31: {Line 32: dbConnectionString = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ConnectionString;Line 33: dbProviderName = ConfigurationManager.ConnectionStrings["ArtHouseConnection"].ProviderName;Line 34:


Source File:d:\inetpub\vhosts\artehouse.org\httpdocs\App_Code\ArtHouseConfiguration.cs Line:32

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] ArtHouseConfiguration..cctor() in d:\inetpub\vhosts\artehouse.org\httpdocs\App_Code\ArtHouseConfiguration.cs:32[TypeInitializationException: The type initializer for 'ArtHouseConfiguration' threw an exception.] ArtHouseConfiguration.get_EnableErrorLogEmail() in d:\inetpub\vhosts\artehouse.org\httpdocs\App_Code\ArtHouseConfiguration.cs:74 Utilities.LogError(Exception ex) in d:\inetpub\vhosts\artehouse.org\httpdocs\App_Code\Utilities.cs:100 ASP.global_asax.Application_Error(Object sender, EventArgs e) in d:\inetpub\vhosts\artehouse.org\httpdocs\Global.asax:20 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.HttpApplication.RaiseOnError() +182

Anyone got any ideas? thank you!


Hi genjioo,

This seems to have something to do with the web.config file.

Please check if the connections strings have been put under the configuration\connectionStrings section. Here is a typical sample

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="ConnStr1" connectionString="LocalSqlServer: data source=127.0.0.1;Integrated Security=SSPI;Initial Catalog=aspnetdb"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

If it is not put under this, the ConfigurationManager.ConnectionStrings will not be able to find it.

Sunday, February 19, 2012

"Invalid authorization specification"

Hello,

I have a web application (ISAPI) that accesses a SQL Server 2000 (sp3) database in the same machine as the Web Server (IIS 6). Windows 2003 Standard Edition is the operating System. So, when users access the aplication through the web it runs ok until display the error message "Invalid authorization specification" or, sometimes, another message about failure to inform ODBC DSN, although I dont use ODBC.

When the error occurs, the user press F5 in the browser and the operation goes ok. It's an intermitent and curious error.

Can somebody help me?

Thanks in advance.

Ado.I have no clue

http://www.easysoft.com/products/9999/faq_answer.phtml?ID=123&product=2002

ok, now with the pot shots...

"image/jpeg; charset=utf-8", which is not a valid MIMEType

I am trying to use an image with a "Web" source, the url points to an
aspx page on the same machine as the reporting server, this page
returns a jpeg image (a chart) created by some C# code. On the
"Layout" tab of VS.NET the image is displayed but when I switch to the
"Preview" tab I just get the dreaded Red X.
The following warnings are written to the Output window.
Images with external URL references will not display if the report is
published to a report server without an UnattendedExecutionAccount or
the target image(s) are not enabled for anonymous access.
The value of the MIMEType property for the image ?image1' is
"image/jpeg; charset=utf-8", which is not a valid MIMEType.
I have configured the UnattendedExecuionAccount (rsconfig -e...) and
the page which returns the image allows anonymous access but it
doesn't seem to make any difference. What I don't understand is the
message about the invalid MIMEType, the code which returns the image
sets the ContentType="image/jpeg".
Any help much appreciated.I began to get this error right after I installed "Office 2003 Pro".
Do you use MS Office 2003?
"Mark" wrote:
> I am trying to use an image with a "Web" source, the url points to an
> aspx page on the same machine as the reporting server, this page
> returns a jpeg image (a chart) created by some C# code. On the
> "Layout" tab of VS.NET the image is displayed but when I switch to the
> "Preview" tab I just get the dreaded Red X.
> The following warnings are written to the Output window.
> Images with external URL references will not display if the report is
> published to a report server without an UnattendedExecutionAccount or
> the target image(s) are not enabled for anonymous access.
> The value of the MIMEType property for the image â'image1' is
> "image/jpeg; charset=utf-8", which is not a valid MIMEType.
> I have configured the UnattendedExecuionAccount (rsconfig -e...) and
> the page which returns the image allows anonymous access but it
> doesn't seem to make any difference. What I don't understand is the
> message about the invalid MIMEType, the code which returns the image
> sets the ContentType="image/jpeg".
> Any help much appreciated.
>

Thursday, February 16, 2012

"Failed to generate a user instance of SQL Server" using sql server express and vwde. why?

I've set up a website on another computer using sql server express and visual web developer express, and it works as expected. However halfway through the development i've had to move to another computer. I installed visual web developer express + sql server express, and copied the project files across, but now when I attempt to run it I get the error:

Failed to generate a user instance of SQL Server due to afailure in starting the process for the user instance. The connectionwill be closed.

I've tried reinstalling the software and it doesn't help. Any idea why this is happening, and what I can do to fix it?

thanks

How to fix it is covered in the link below change the configuration. Hope this helps.

http://blog.krisvandermast.com/FailedToGenerateAUserInstanceOfSQLServerDueToAFailureInStartingTheProcessForTheUserInstanceTheConnectionWillBeClosed.aspx

|||

Hi,

I changed the built in account to 'local system' in the SQL server configuration manager, and deleted my SQLEXPRESS folder, then restarted the computer, but the same thing is happening. Is there anything else I need to do to fix this?

thanks for your help

|||

I am sorry you error sent me on the wrong track because moving a database created in one box and moving it to another is not a simple copying files over. That is the reason the solution I gave you did not fix your problem so delete the folder. When you are moving your database to a new computer you need to do it manually through code like the second link below. You need to check your access permissions to the new computer and follow the guide created by Microsoft in the second link if the forum posting in the first link below did not fix your problem. Hope this helps.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=125227&SiteID=1

http://support.microsoft.com/default.aspx?scid=kb;en-us;224071

"Failed to generate a user instance of SQL Server" - Redux

I have SQL Server 2005 SP1 Dev Edition installed on my laptop along with Visual Web Developer 2005. I installed SQL Server Express 2005 SP1. I then created a new web site using the Club Web Site template.

I did the recommended initial build to get the Membership database installed and got an error page (http://localhost:1667/WebSitesVB2/):

SQLExpress database file auto-creation error:
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

There were 4 recomme4ndations from the error page. I have met three of them: (1) the AppDaa folder that was created when I used the Club Web Site template; (2) my machine's ASPNET user set up with full control permissions on the APP Data Folder; (3) SQL Server Express successfully installed on my machine.

The 4th recommendation from the error page is "The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts. ". I have no idea of how to do this or how/where to find the elusive the "readme" file.

I am at a loss as to what to do next. I have spent the day going over forums on this error and none seem to provide consistent or relevant answers.

Try to remove User Instance=true from your connection string, if you don't need to generate a user instance at runtime. For more information about the user instance attribute, you can refer to:

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(VS.80).aspx|||

Changed userinstance = TRUE to userinstance=FALSE. Same result - failure to generate userinstance.

Is it possible that there is some setting in VWD that provides a connection string for the ASPNET db that is to be created? The only connection string in the WebConfig from the original template is the one for the ClubSite DB. There is none for the ASPNET db (because the template does not provide the ASPNET DB.

After 2 tries, I still get this error and when I look at the database explorer, there is only one DB file: Club.MDF.

Anyone else have any answers?

|||

I probably should have included this stack trace:

Stack Trace:

[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +115 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +56 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1084 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +355 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +91 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +115 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122 System.Data.SqlClient.SqlConnection.Open() +229 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +110[HttpException (0x80004005): Unable to connect to SQL Server database.] System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +181 System.Web.Management.SqlServices.SetupApplicationServices(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +167 System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +46 System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) +681



|||Sorry I forgot to mention: there is a connection string named LocalSqlServer, which is used by .NET 2.0 built-in providers (Profile, Membership, RoleManager, etc.). You can override it and try again, for details you can refer to:
Configuring ASP.NET 2.0 Application Services to use SQL Server 2000 or SQL Server 2005

Thursday, February 9, 2012

"Cannot Open Database" problem when copy project to IIS

Hi all.

I use VWD 2005 Express with SQL Server 2005 Express as a database.

I copy my project to IIS and try to run it at the IIS Web Server.

I already amended the connection string at web.config file as below:

<connectionStrings> <add name="GeekSpeakConnectionString" connectionString="Data Source=SEN-M09\SQLEXPRESS;Database=GeekSpeak.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /></connectionStrings>
But, I got this error:

Cannot open database "GeekSpeak.mdf" requested by the login. The login failed.
Login failed for user 'SEN-M09\ASPNET'.

I also has granted to userSEN-M09\ASPNET .Still, I got this error. Why?

I manage to solve this problem after reading the articlehere.

Thanks.

Friday, January 27, 2012

"...remote name could not be resolved" when using custom Web App

Hi all,
I'm getting a headache trying to figure out what is going on here. I've set
up Reporting Services on 1 dev machine and 2 servers and using a Web
Application that I am developing to access Reporting Services to generate a
report for me. Everything works fine on both my development machine and one
of the servers, but the other server keeps on producing this error:
"The underlying connection was closed: The remote name could not be resolved."
As far as I can remember, every instance of RS was installed identically.
Also, I can use the Report Manager from the server and from networked
computers to generate reports with no issues. Its only upon my Web Apps
access to the RS that I get this error. Is this similar to the SSL issues a
lot of people have been discussing? I'm still quite a newbie when it comes to
sql server and iis, so if this has been answered elsewhere already, I'd
appreciate a link :)
AndreAfter a bit of debugging I found that the problem was actually just that a
static web refference to the report server was being used, and that was
pointing at the other server still.
All works fine now.