C# DBMLs and SQL Server

Go To StackoverFlow.com

1

My dev machine has SQL Server 2005 on it and that is how I make my DBML file and define the tables in there and then make a WCF Service. When i go to host the WCF service, the server has SQL Server 2000, it finds the connection string fine but not the table im pointing it to. Is there a way to tell through the web.config file which SQL Server i am using at run time?

Thanks

2009-06-16 20:24
by Daniel


0

sure, that's what the connection string is for, are you sure you have the right permissions on the server?

2009-06-16 20:27
by BlackTigerX
yeah the connection string is fine, i can t ell because when i open my DataContext it opens fine, when i go to query the table it cant find i - Daniel 2009-06-16 20:29


0

The name of the server and database should be in the connection string (in the config file); what does it currently look like? And what is the exact error message.

The exact connection string depends on your setup (for example, is the server a "named instance"?).

The other thing I can think of... are the objects in the right schema? i.e. are they "daniel.sometable" on your machine, but "dbo.sometable" on the server? This matters, since the dbml includes the schema. Fortunately, you can edit the dbml (it is just xml) and use "replace all" (i.e. ctrl+h) to fix this...

2009-06-16 20:28
by Marc Gravell
well in mine the table name is dbo.table, in sql server 2000 its table, but the owner is dbo...does that translate to dbo.table - Daniel 2009-06-16 20:34
Well im just catching the exception when i try to go to that table and returning table not found, i cant see the exact messag - Daniel 2009-06-16 20:36
get, that is the same thing... worth try. Are you sure it is looking in the right database? Have you tried a sql trace - Marc Gravell 2009-06-16 20:39
Im not by the remote machine so i cant trace right now, but I will when im able to log in to the remote machin - Daniel 2009-06-16 20:41
Ads