|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SqlDataSource - strange error (to me at least) ;-)Have been using SqlDataSources for a while now. Reinstalled machine last week, now running Server 2003. Installed both SqlServer 2000 and 2005 with instance-names "sql2000" and "sql2005". Also installed both Visual Studio 2003 and 2005. VS2005 is the Release Candidate, and SQL2005 is the September CTP. During SqlDataSource configuration wizard, i can test connection and all is fine. I can see table names and views in the "query builder" thingie, but once i do the "Test Query" things go bad. I get an "Invalid Object Name" on the table from which the datasource should retrieve its data. I have posted small video of me producing the error. Any input is welcomed. I suspect the side-by-side 2000 and 2005 installation, but it _shouldn't_ be a problem, should it? The video is here: http://www.netkoder.dk/error.wmv Again, thanks for any input. J.Jespersen Denmark Nice work on the video! It presented a lot of information, and was located
on your own server, thus preserving good Netiquette! The "invalid object name" error indicates that the named object (in this case "Contact" was not identifiable. And I noticed a glaring omission in the video. You never looked at the Connection String. A SQL Server Connection String may or may not reference an "InitialCatalog." The InitialCatalog is the database that the connection defines as the default database for queries. In a sense, it is like an "Imports" ("using") directive in your programming code. Having one makes it unnecessary to refer to the database by name, and simply use the names of objects in the database without the full namespace. Your query was: "Select * from [Contacts]" Now, if "dbo.AdventureWorks" was the InitialCatalog, the table should have been found. So, the first thing I would do is check the ConnectionString for the "InitialCatalog" in it. -- Show quoteHide quoteHTH, Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it. "J. Jespersen" <j**@jdj.dk> wrote in message news:ehCIrPczFHA.3660@TK2MSFTNGP15.phx.gbl... > Hi all, > > Have been using SqlDataSources for a while now. Reinstalled machine last > week, now running Server 2003. Installed both SqlServer 2000 and 2005 with > instance-names "sql2000" and "sql2005". Also installed both Visual Studio > 2003 and 2005. VS2005 is the Release Candidate, and SQL2005 is the > September CTP. > > During SqlDataSource configuration wizard, i can test connection and all > is fine. I can see table names and views in the "query builder" thingie, > but once i do the "Test Query" things go bad. I get an "Invalid Object > Name" on the table from which the datasource should retrieve its data. > > I have posted small video of me producing the error. Any input is > welcomed. I suspect the side-by-side 2000 and 2005 installation, but it > _shouldn't_ be a problem, should it? > The video is here: http://www.netkoder.dk/error.wmv > > > Again, thanks for any input. > > J.Jespersen > Denmark > > > Nice work on the video! It presented a lot of information, and was located Thanks. I did cross-post, however, so ease up on the praise ;-)> on your own server, thus preserving good Netiquette! > And I noticed a glaring omission in the video. You never looked at the Having double-checked, I can confirm that the "initial catalog" property of > Connection String. the connectionstring _was_ set to AdventureWorks, thus preserving totalt empusslement. (is that a word?) I've posted the site (as I created it as file-based, not http/ftp) in a .zip file @ http://www.netkoder.dk/test.zip Just in case anyone cares :-) J.Jespersen Show quoteHide quote > A SQL Server Connection String may or may not reference an > "InitialCatalog." The InitialCatalog is the database that the connection > defines as the default database for queries. In a sense, it is like an > "Imports" ("using") directive in your programming code. Having one makes > it unnecessary to refer to the database by name, and simply use the names > of objects in the database without the full namespace. > > Your query was: > > "Select * from [Contacts]" > > Now, if "dbo.AdventureWorks" was the InitialCatalog, the table should have > been found. So, the first thing I would do is check the ConnectionString > for the "InitialCatalog" in it. > > -- > HTH, > > Kevin Spencer > Microsoft MVP > .Net Developer > Ambiguity has a certain quality to it. > > "J. Jespersen" <j**@jdj.dk> wrote in message > news:ehCIrPczFHA.3660@TK2MSFTNGP15.phx.gbl... >> Hi all, >> >> Have been using SqlDataSources for a while now. Reinstalled machine last >> week, now running Server 2003. Installed both SqlServer 2000 and 2005 >> with instance-names "sql2000" and "sql2005". Also installed both Visual >> Studio 2003 and 2005. VS2005 is the Release Candidate, and SQL2005 is the >> September CTP. >> >> During SqlDataSource configuration wizard, i can test connection and all >> is fine. I can see table names and views in the "query builder" thingie, >> but once i do the "Test Query" things go bad. I get an "Invalid Object >> Name" on the table from which the datasource should retrieve its data. >> >> I have posted small video of me producing the error. Any input is >> welcomed. I suspect the side-by-side 2000 and 2005 installation, but it >> _shouldn't_ be a problem, should it? >> The video is here: http://www.netkoder.dk/error.wmv >> >> >> Again, thanks for any input. >> >> J.Jespersen >> Denmark >> >> > > Well, J, I thought I'd point out a good way to make a lot of information
about a problem available without overloading the news server, so, as you corrected the cross-posting issue, you are indeed a praiseworthy fellow! Particularly as you did it again with the link to the Zip file. :) At first blush, everything looked Kosher. Your Connection String: "Data Source=.\SQL2005;Initial Catalog=AdventureWorks;Integrated Security=True" providerName="System.Data.SqlClient" is correct, as far as the InitialCatalog is concerned. It does reference the AdventureWorks InitialCatalog. After looking over the very simple code you generated, I can only guess that the issue may have something to do with permissions. I must confess that I haven't played much with ASP.Net 2.0, so I'm not entirely sure what permissions are being used at what point in the process of creating a GridView in an ASP.Net Page. I would think that setting up the Connection in the Web.Config file was done under your user account, and that setting up the GridView in the Page was done using the user account under which your ASP.Net application is running. You're using a Trusted Connection, so that means that the account is a Windows account, not a SQL Server account (at least with SQL Server 2000 this is the case; I haven't used SQL Server 2005 yet). You might want to check the specific permissions granted to that account in the AdventureWorks database. -- Show quoteHide quoteHTH, Kevin Spencer Microsoft MVP ..Net Developer Ambiguity has a certain quality to it. "J. Jespersen" <j**@jdj.dk> wrote in message news:%23$A8PadzFHA.2212@TK2MSFTNGP15.phx.gbl... > >> Nice work on the video! It presented a lot of information, and was >> located >> on your own server, thus preserving good Netiquette! > > Thanks. I did cross-post, however, so ease up on the praise ;-) > >> And I noticed a glaring omission in the video. You never looked at the >> Connection String. > > Having double-checked, I can confirm that the "initial catalog" property > of the connectionstring _was_ set to AdventureWorks, thus preserving > totalt empusslement. (is that a word?) > I've posted the site (as I created it as file-based, not http/ftp) in a > .zip file @ http://www.netkoder.dk/test.zip > > Just in case anyone cares :-) > > J.Jespersen > > > > > > >> A SQL Server Connection String may or may not reference an >> "InitialCatalog." The InitialCatalog is the database that the connection >> defines as the default database for queries. In a sense, it is like an >> "Imports" ("using") directive in your programming code. Having one makes >> it unnecessary to refer to the database by name, and simply use the names >> of objects in the database without the full namespace. >> >> Your query was: >> >> "Select * from [Contacts]" >> >> Now, if "dbo.AdventureWorks" was the InitialCatalog, the table should >> have been found. So, the first thing I would do is check the >> ConnectionString for the "InitialCatalog" in it. >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> .Net Developer >> Ambiguity has a certain quality to it. >> >> "J. Jespersen" <j**@jdj.dk> wrote in message >> news:ehCIrPczFHA.3660@TK2MSFTNGP15.phx.gbl... >>> Hi all, >>> >>> Have been using SqlDataSources for a while now. Reinstalled machine last >>> week, now running Server 2003. Installed both SqlServer 2000 and 2005 >>> with instance-names "sql2000" and "sql2005". Also installed both Visual >>> Studio 2003 and 2005. VS2005 is the Release Candidate, and SQL2005 is >>> the September CTP. >>> >>> During SqlDataSource configuration wizard, i can test connection and all >>> is fine. I can see table names and views in the "query builder" thingie, >>> but once i do the "Test Query" things go bad. I get an "Invalid Object >>> Name" on the table from which the datasource should retrieve its data. >>> >>> I have posted small video of me producing the error. Any input is >>> welcomed. I suspect the side-by-side 2000 and 2005 installation, but it >>> _shouldn't_ be a problem, should it? >>> The video is here: http://www.netkoder.dk/error.wmv >>> >>> >>> Again, thanks for any input. >>> >>> J.Jespersen >>> Denmark >>> >>> >> >> > >
Other interesting topics
Master Pages, seems like it causes more problems than it fixes?
javascript call ViewState got confused between two user controls in same parent ct XML is there an error here ? NullReferenceException for System.Data.SQLClient getvalue from user control Menues with v1.1? Which account neets permission to read the Registry key. Placeholder and event not fired the first time. |
|||||||||||||||||||||||