FillSchema works on one machine but not another???

G

Gerry

I develop my ASP.NET application on a Windows XP (SP2) computer with
MSDE (SP3)
My application server is a Windows 2000 Server (SP3) computer with MS
SQL 2000 (SP3)

My code looks like this:

Dim daRoom As New SqlDataAdapter("Room_Select", myConn)
daRoom.SelectCommand.CommandType = CommandType.StoredProcedure
daRoom.SelectCommand.Parameters.Add("@Action", "All")
daRoom.FillSchema(dsReport, SchemaType.Mapped, "Room")
daRoom.Fill(dsReport, "Room")

My stored procedure is setup like this:

ALTER PROCEDURE dbo.Room_Select
@Action nvarchar(20)
AS
SET NOCOUNT ON

if @Action = 'All'
SELECT *
FROM Room
ORDER BY Room

if @Action = 'ChargedRooms'
SELECT *
FROM Room
WHERE ChargeType <> 'None'
ORDER BY Room
-- couple of more if clauses

I use Red Gate Software SQL comparison tools and have verified that the
table structures, stored procedures, permissions, etc., on both
machines are identical.
I have verified using a file comparison tool that all .aspx, .dll, etc.
files on both machines are identical.
The application on both machines runs as the ASPNET user, and it is
configured the same on both machines.

SO:

Why does this application work perfectly on the development machine,
but on the server, I get:

Table doesn't have a primary key.
when I try doing a dsUsage.Tables("Client").Rows.Find(RoomID)??????
 
M

Marina

Does your software check that the primary key of both tables are the same?
Perhaps there is no primary key on the second database?

To verify the problem try:
Run software on machine1, but point to database on machine2
Run software on machine2, but point to database on machine1

If the first example causes the error and the second one does not, the
problem is almost definitely in the database on machine2.
 
G

Gerry

Marina said:
Does your software check that the primary key of both tables are the same?
Perhaps there is no primary key on the second database?

To verify the problem try:
Run software on machine1, but point to database on machine2
Run software on machine2, but point to database on machine1

Marina,

Thank you for the suggestion, but I do not think that it will be
helpful. I am certain that the code and databases are identical - I
literally copy them from one machine to the other. Since I posted, I
have tried this application on a third machine, and it runs just fine
on the third machine. I have also discovered additional abherant
behavior on the server - BUT THE CODE AND THE DATABASES ARE 100%
IDENTICAL!

This makes absolutely no sense what so ever. (In case you cannot tell,
I am extremely frustrated.)
 
G

Gerry

Problem solved.

Short answer - I am a moron.
Slightly longer answer: DB requests work better when one selects the
'datareader' box instead of the 'denydatareader' box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top