AdventureWorks DB - SQL Datasource Control and seeing the 'schema'

I'm trying to load the 'contacts' table from SQL2005 AdventureWorks database with a SQL Datasource control and when i try to use the "Configure Data Source" wizard i select the table and i get the following error:

 "Invalid object name: 'Contact'."

I think i know the reason for the error but i don't know how to fix it.  What i think is happening is SQL 2005 makes use of 'schemas' to organize tables (similar to namespaces) so the object 'Contact' is actually 'Person.Contact'.  However the "Configure Data Source" wizard does not seem to display schema names so in the wizard it appears as 'Contact'. 

 
2 questions:  How can i configure the wizard to view schemas and make it work?  Also how would i reference this programmatically in an sql query?
 

0
jayman911
4/14/2008 9:11:25 PM
asp.net.visual-studio-2008 3408 articles. 0 followers. Follow

2 Replies
446 Views

Similar Articles

[PageSpeed] 15

 Ok i've figured out when using custom schemas on a table (like AdventureWorks does) in SQL you just need to prepend the schema to the table name.

for example change this:

 SELECT * FROM Contact

 to this

SELECT * FROM Person.Contact

 

Simple enough however what about when using the "Configure Data Source" control tool wizard?  It doesn't have any options to select a schema nor does it even display the schema.  I've managed to get around the issue by modifying the script that the wizard generates but surely there must be a better way....

Anyone?

 

JAson 

 

 

0
jayman911
4/15/2008 2:07:17 PM

I got the same issue while trying to connect AdventureWorks database. And I post this only because one thing is comming to mind:

 There's communication between SQL Server and Visual Studio development teams, isn't there? .... I don't guess so :(

0
fepecas
4/4/2009 11:26:57 PM
Reply:

Similar Artilces:

I don't see the 'ATLAS' tab in Visual Studio's ToolBox............
I've seen many video tutorials on ATLAS, I've seen a tab 'ATLAS' in the tolbox, that is not in my toolbox. How can I get it???????? Freelance Web Developer & HTML IntegratorASP.NET(1.1/2.0) == PHP Hi,1) right click on the Toolbox --> Add tab (give it the name "ATLAS")2) right click inside the new tab --> Choose Items --> Select the Microsoft.Web.Atlas.dll assembly  Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action Friend I dont find " Microsoft.Web.Atlas.dll assembly " in the dialogue box..Do i have to install somet...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Can't delete projects from Visual Studio .Net IDE 'Start Page'
Please ignore this post. Since posting it I found the solution but I'm not able to delete this post. nikita ...

replication between one 'up' db and one 'down' db
Hi, All: We have primary db and secondary db (both of them are running ASE 11.9.2), and they are residing on two different servers. A replications server is set up from primary to secondary db(which is set up as warm standby). Is it possible to keep the replication going while the secondary db is set as 'unavailable (or down)' so that no user would be able to access the secondary db? The DBAs tried to set the secondary db as 'dbo only', but it's still available to the users (just no accces). If the SQL interface file on client machine has multiple query lines ...

Visual Studio randomly changing codebehind subtypes from 'ASPXCodebehind' to 'Code'
I've got a weird issue going on in my .vbproj files.  Every couple of days, I go to check in to Source Control, and all of the project files in my solution are listed as having changed.  When I diff them to see what has changed, I see that the 'subtype' element for all of my codebehind files has been changed from ASPXCodebehind to Code.  If I allow it to go into source control, then several days later the same thing will happen, but Visual Studio will have changed all of them back to ASPXCodebehind.  It's a real nuisance! Does anyone have any idea what is causing ...

'Generate local resource' menu item in Visual Studio and 'provider model'
Hi,         "suppose some one is using his own custom resource provider for storing language specfic text in a database server instead of resource files. If he clicks on Tools->'Generate Local Resource' menu item then will language specific text be pushed in resource files or Sql Server ?" According to my R&D 'resource provider model' does not provide any interface which can implemented to push data in a sql server instead of resource file when ever we click on 'Generate Local Resource' menu item in Tools ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

Could not find control '' in ControlParameter ''
Hello All I have a repeater with controls, some draw from different SqlDatasources. Everything loads up properly, I click my update button and then I get the error: "Could not find control 'txtProjectName' in ControlParameter 'projectName'" The Control txtProjectName is in the repeater <itemTemplate> <asp:TextBox ID="txtProjectName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "projectName") %>' /> My Datasource that I want to update looks like this:  <asp:SqlDataSource ID="dsEditProject" runat="server" ConnectionString="<%$ ConnectionString...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

Need desperate help with installing Microsoft Visual C++ 2008 Express ''ENU has encountered''
Im gonna cut right to the chase i want to install Microsoft Visual C++ 2008 Express Edition but every time i try to install it i get a message saying:  ''Microsoft Visual C++ 2008 express Edition - ENU has encountered a problem during setup. Setup did not complete correctly.''   Then i get another message saying what it did not manage to install Setup could not install the following component:Microsoft .NET Framework 3.5   Ive done some ''research'' around the internet and it seems this problem occurs a bit. I have to admit im kinda noob...

'Error Creating Control' ... 'true' could not be set on property 'ShowRadioButtons'
I have created a custom control which inherits from a compositeControl. Its all works well in the browser but when I show it in the design mode I geta gray box with the following message Error Creating Control - GroupPicker1'true' could not be set on property 'ShowRadioButtons'. The Property is a fairly standard get and set Public Property ShowRadioButtons() As Boolean            Get                Return rowRadioButtons.Visible  &nbs...

The SELECT permission was denied on the object '', database '', schema 'dbo'.
 hay there...i'm developing a website using visual studio 2005, when i run it from VS it works fine and it can access the DB.but when i make an alias and run it directly from localhost ..i keep getting this message when i try to fill a DATASET ..Line 198: cmd.CommandText = "Select Line From Buses";Line 199: da.SelectCommand = cmd; Line 200: da.Fill(ds);can anyone help me ?thanx GLORY~Please mark as answer if this helps u~ Hi, we need to check the connection information, how are you connecting. Its obvious that different information/user is...

'...could not be set on property' error for custom databound control in Visual Studio designer
 Hi,I've developed a custom databound control following the tutorial provided by Microsoft here: http://msdn.microsoft.com/en-us/library/ms366540.aspxAlthough the control works correctly, in visual studio designer, I get a 'true' cannot be set on property 'RenderAsHyperlinks'. ANy help much appreciated. I've seen other people having the same problem, but no concrete answers!I've included the code below.Thanks,Wayneusing System;using System.Collections.Generic;using System.Text;using System.Web.UI.WebControls;using System.Collections;using System.Web.UI;using ...

Web resources about - AdventureWorks DB - SQL Datasource Control and seeing the 'schema' - asp.net.visual-studio-2008

Resources last updated: 12/15/2015 6:45:27 PM