Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procudures to populate a DataSet
Message
 
To
05/11/2003 15:18:45
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00846755
Message ID:
00846932
Views:
21
This message has been marked as a message which has helped to the initial question of the thread.
Hi Sergio,

VFP can not return a DataSet. No other program recognizes VFP's cursor. You can't even return XML because it is COM based. It can only be used to return single values. Two alternatives you have are:

1. Don't use a stored procedure but instead directly access data by using the select statement with the OLEDB provider.

2. Create a VFP COM object that returns XML that can be turned into a .NET DataSet.

>Hello,
>
>I have an asp.net web form that uses ole db to retrieve data from a foxpro database ( vfp 7.0). The webform works great and below is some code from a function that return a DataSet.
>
>// Creates connection and command string
>String strConn, strCmd;
>strConn = @"provider=VFPOLEDB.1 ;data source='C:\fnhodatatest\vips.DBC';password='';user id=''";
>// Get the Producer code that was store on the Page_load event.
>String strCurrentSession = Session["ProducerCode"].ToString();
>strCmd = "SELECT controlnum,Ins1ln,Ins1fn,pxd FROM policy Where status=0 and ctrl3=1 and agent= '"+strCurrentSession + "'";
>OleDbDataAdapter VFP7DataAdapter = new OleDbDataAdapter(strCmd,strConn);
>DataSet VFP7DataSet = new DataSet();
>VFP7DataAdapter.Fill(VFP7DataSet,"MyList");
>return VFP7DataSet;
>
>
>Here is my Stored procedure:
>
>
>FUNCTION PT_GetQuote(tcControlNum)
>	SELECT controlnum,pn,ins1fn,ins1ln FROM policy p WHERE p.controlnum==tcControlNum
>ENDFUN
>
>
>
>I have the following question :
>
>Can I use Stored procedures to fill a DataSet?
>
>Thanks
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform