|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CLR stored procedures in TableAdapter: no fields are populated?While experimenting with CLR stored procedure, I discovered it won't populate the fields in the TableAdapter, like a normal stored procedure. Why is this? GetClientList = normal stored procedure GetClientListTest = CLR stored procedure Both contain the same SQL, "SELECT * FROM Clients" and no parameters were specified. Both run correctly in Management Studio. When I create a new TableAdapter, select "use existing stored procedure" and pick "GetClientList", alle fields are populated in the DataSet (Id, name, etc). However, when I do the same with "GetClientListTest", there are no fields. "Preview data", however, is working correctly. What's causing the difference in behaviour? Steven - - - Without the code for your CLR SP I have no way of knowing what's going on,
but I suggest you read chapter 13 of my new book that steps through the process of creating a CLR SP that returns a rowset. Frankly, there are very few situations where this makes sense as TSQL SPs are more efficient in this respect. -- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Steven Spits" <nospam@company.com> wrote in message news:uP9klUaUHHA.5108@TK2MSFTNGP06.phx.gbl... > Hi, > > While experimenting with CLR stored procedure, I discovered it won't > populate the fields in the TableAdapter, like a normal stored procedure. > Why is this? > > GetClientList = normal stored procedure > GetClientListTest = CLR stored procedure > > Both contain the same SQL, "SELECT * FROM Clients" and no parameters were > specified. Both run correctly in Management Studio. > > When I create a new TableAdapter, select "use existing stored procedure" > and pick "GetClientList", alle fields are populated in the DataSet (Id, > name, etc). However, when I do the same with "GetClientListTest", there > are no fields. "Preview data", however, is working correctly. > > What's causing the difference in behaviour? > > Steven > > - - - > > Hey, Bill, does your new book cover the basics of T-SQL?
Robin S. ------------------------------- Show quote "William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message news:%23nlcu2eUHHA.4188@TK2MSFTNGP06.phx.gbl... > Without the code for your CLR SP I have no way of knowing what's going > on, but I suggest you read chapter 13 of my new book that steps through > the process of creating a CLR SP that returns a rowset. Frankly, there > are very few situations where this makes sense as TSQL SPs are more > efficient in this respect. > > -- > ____________________________________ > William (Bill) Vaughn > Author, Mentor, Consultant > Microsoft MVP > INETA Speaker > www.betav.com/blog/billva > www.betav.com > Please reply only to the newsgroup so that others can benefit. > This posting is provided "AS IS" with no warranties, and confers no > rights. > __________________________________ > Visit www.hitchhikerguides.net to get more information on my latest book: > Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) > and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) > ----------------------------------------------------------------------------------------------------------------------- > > "Steven Spits" <nospam@company.com> wrote in message > news:uP9klUaUHHA.5108@TK2MSFTNGP06.phx.gbl... >> Hi, >> >> While experimenting with CLR stored procedure, I discovered it won't >> populate the fields in the TableAdapter, like a normal stored procedure. >> Why is this? >> >> GetClientList = normal stored procedure >> GetClientListTest = CLR stored procedure >> >> Both contain the same SQL, "SELECT * FROM Clients" and no parameters >> were specified. Both run correctly in Management Studio. >> >> When I create a new TableAdapter, select "use existing stored procedure" >> and pick "GetClientList", alle fields are populated in the DataSet (Id, >> name, etc). However, when I do the same with "GetClientListTest", there >> are no fields. "Preview data", however, is working correctly. >> >> What's causing the difference in behaviour? >> >> Steven >> >> - - - >> >> > > Actually, it does this time (for the first time).
-- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "RobinS" <RobinS@NoSpam.yah.none> wrote in message news:Dr6dnX9PO7wMakjYnZ2dnUVZ_o-knZ2d@comcast.com... > Hey, Bill, does your new book cover the basics of T-SQL? > > Robin S. > ------------------------------- > "William (Bill) Vaughn" <billvaRemoveT***@nwlink.com> wrote in message > news:%23nlcu2eUHHA.4188@TK2MSFTNGP06.phx.gbl... >> Without the code for your CLR SP I have no way of knowing what's going >> on, but I suggest you read chapter 13 of my new book that steps through >> the process of creating a CLR SP that returns a rowset. Frankly, there >> are very few situations where this makes sense as TSQL SPs are more >> efficient in this respect. >> >> -- >> ____________________________________ >> William (Bill) Vaughn >> Author, Mentor, Consultant >> Microsoft MVP >> INETA Speaker >> www.betav.com/blog/billva >> www.betav.com >> Please reply only to the newsgroup so that others can benefit. >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> __________________________________ >> Visit www.hitchhikerguides.net to get more information on my latest book: >> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) >> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) >> ----------------------------------------------------------------------------------------------------------------------- >> >> "Steven Spits" <nospam@company.com> wrote in message >> news:uP9klUaUHHA.5108@TK2MSFTNGP06.phx.gbl... >>> Hi, >>> >>> While experimenting with CLR stored procedure, I discovered it won't >>> populate the fields in the TableAdapter, like a normal stored procedure. >>> Why is this? >>> >>> GetClientList = normal stored procedure >>> GetClientListTest = CLR stored procedure >>> >>> Both contain the same SQL, "SELECT * FROM Clients" and no parameters >>> were specified. Both run correctly in Management Studio. >>> >>> When I create a new TableAdapter, select "use existing stored procedure" >>> and pick "GetClientList", alle fields are populated in the DataSet (Id, >>> name, etc). However, when I do the same with "GetClientListTest", there >>> are no fields. "Preview data", however, is working correctly. >>> >>> What's causing the difference in behaviour? >>> >>> Steven >>> >>> - - - >>> >>> >> >> > > Hi Bill,
> Without the code for your CLR SP I have no way of knowing what's going on, I'm not planning to use a CLR to return a simple rowset, it's only to > but I suggest you read chapter 13 of my new book that steps through the > process of creating a CLR SP that returns a rowset. Frankly, there are > very few situations where this makes sense as TSQL SPs are more efficient > in this respect. simplify the problem I have. Don't understand me wrong. The CLR SP *is* returning the rows I want. It just doesn't populate the fields in my TableAdapter in *design time* like a normal TSQL SP does. Code is something like this : http://www.sqlteam.com/item.asp?ItemID=22074 Steven - - - Ah, I'm not really surprised. Consider that at design time, VS calls a SP
that asks SS to return the schema... I expect it's just not supported for CLR SPs. Did you install VS 2005 SP1? -- Show quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Steven Spits" <some***@company.com> wrote in message news:uMxcqUgUHHA.996@TK2MSFTNGP02.phx.gbl... > Hi Bill, > >> Without the code for your CLR SP I have no way of knowing what's going >> on, but I suggest you read chapter 13 of my new book that steps through >> the process of creating a CLR SP that returns a rowset. Frankly, there >> are very few situations where this makes sense as TSQL SPs are more >> efficient in this respect. > > I'm not planning to use a CLR to return a simple rowset, it's only to > simplify the problem I have. > > Don't understand me wrong. The CLR SP *is* returning the rows I want. It > just doesn't populate the fields in my TableAdapter in *design time* like > a normal TSQL SP does. > > Code is something like this : http://www.sqlteam.com/item.asp?ItemID=22074 > > Steven > > - - - > > |
|||||||||||||||||||||||