S
Shane Brodie
I'm developing a project using VB.Net and MSDE as the data source. In one
scenario I need to return a set of data which also requires some static data
to be included with it. I figured a simple way to do this is to generate a
simple stored procedure which uses a temporary table such as follows:
BEGIN
CREATE TABLE #MYTEMP ([ID] [Int], [Name][varchar](50));
INSERT INTO #MYTEMP ([ID], [Name]) VALUES(-1,'*Root Folder*')
INSERT INTO #MYTEMP SELECT * FROM tblFolder
SELECT * FROM #MYTEMP ORDER BY [Name]
END
The stored proc works fine until ...
The output of this particular stored proc is required to populate a
combobox. I figured the easiest way to do this is to simlpy bind the
dataset result of the stored proc to a combobox.
Problem: When you try to create a data adapter and subsequent dataset using
this method, VB.Net pukes, saying that #MYTEMP is invalid. NOT!
Any suggestions to work-around this.
Regards
Shane Brodie
I realize there are probably many better ways to accomplish this,
unfortunately my VB.Net knoweldge is a work in progress ... in this case I
could have accomplished this in VB 6.0 without any hassle at all (but I
wouldn't have bothered with data binding)
scenario I need to return a set of data which also requires some static data
to be included with it. I figured a simple way to do this is to generate a
simple stored procedure which uses a temporary table such as follows:
BEGIN
CREATE TABLE #MYTEMP ([ID] [Int], [Name][varchar](50));
INSERT INTO #MYTEMP ([ID], [Name]) VALUES(-1,'*Root Folder*')
INSERT INTO #MYTEMP SELECT * FROM tblFolder
SELECT * FROM #MYTEMP ORDER BY [Name]
END
The stored proc works fine until ...
The output of this particular stored proc is required to populate a
combobox. I figured the easiest way to do this is to simlpy bind the
dataset result of the stored proc to a combobox.
Problem: When you try to create a data adapter and subsequent dataset using
this method, VB.Net pukes, saying that #MYTEMP is invalid. NOT!
Any suggestions to work-around this.
Regards
Shane Brodie
I realize there are probably many better ways to accomplish this,
unfortunately my VB.Net knoweldge is a work in progress ... in this case I
could have accomplished this in VB 6.0 without any hassle at all (but I
wouldn't have bothered with data binding)