G
Guest
Hi I have a simple stored procedure shown below and am trying to use it in a
..net window application to fill a dataset. IT works out of query analyzer,
returns data from an excel file. Anyhow in the windows form the designer can
not generate the schema so I can not configure a data adapter. I could use
the Execute Nonquery but I need to return data so not quite sure if that
would be correct.
ALTER PROCEDURE emp_excel$inputfile (@name varchar(100),@sheet varchar(20)) as
DECLARE @cmd varchar(1000)
set @cmd='SELECT * FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel
8.0;Database='
set @cmd= @cmd + @name + ''',''select * from [' + @sheet + '$]'')'
--print @cmd
EXEC (@cmd)
Any ideas?
thanks.
..net window application to fill a dataset. IT works out of query analyzer,
returns data from an excel file. Anyhow in the windows form the designer can
not generate the schema so I can not configure a data adapter. I could use
the Execute Nonquery but I need to return data so not quite sure if that
would be correct.
ALTER PROCEDURE emp_excel$inputfile (@name varchar(100),@sheet varchar(20)) as
DECLARE @cmd varchar(1000)
set @cmd='SELECT * FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel
8.0;Database='
set @cmd= @cmd + @name + ''',''select * from [' + @sheet + '$]'')'
--print @cmd
EXEC (@cmd)
Any ideas?
thanks.