Home All Groups Group Topic Archive Search About

Using Visual Studio & datagrid to select from sql server view

Author
27 Apr 2006 6:36 AM
gfarrell
Hi,

I noticed another post similar to this, however I could not get my
issue solved.

I am using a datagrid, dataset and dataadapter to retrieve data from a
database view. I have done this successfully with tables and also
stored procedures. I could not use the table directly because I got an
error when I tried to create an SQLDataAdapter with visual studio
because the table had more than 100 columns in it. So I thought I would
create a view and use it.

System
1. SQL Server 2000 sp3 on Windows 2003
2. Visual Studio MDE2002 ver 7.0.9466
3. .Net Framework 1.0 ver 1.0.3705

Steps so far.
1.

2. Run in SQL Analyzer: select * from dbo.Web_WorkOrder where wonum =
'525794'

3. Capture using SQL profiler and Run in SQL Analyzer: exec
sp_executesql N'SELECT wonum, status, statusdate, worktype,
description, eqnum, location, faildate, changeby, changedate,
wopriority, ldkey, reportedby, reportdate, actstart, actfinish FROM
Web_WorkOrder WHERE (wonum = @WonumI)', N'@WonumI varchar(10)', @WonumI
= '525794'

Both of these work.

Regards,
Garry

AddThis Social Bookmark Button