Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a VFP stored proc from C#...help!!!
Message
From
19/09/2003 00:44:41
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00830554
Message ID:
00830562
Views:
17
I have found that when calling SQL 2000 sprocs that I need to tell the command object that it is calling a sproc. Maybe this is true with the OledbCommand object as well. Where I use Sql you should use the OleDB versions of the same objects instead.
C#
private void MyFunction()
{
SqlConnection conn = new SqlConnection("my_conn_string);
SqlCommand comm = new SqlCommand("my_sproc_name", conn as SqlConnection);
comm.CommandType = CommandType.StoredProcedure;
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
while( dr.Read() )
{
extract data here with your code
}
comm.Dispose();
conn.Dispose();
}
Terry Rooks
Software Systems Architect
Microsoft Certified Solution Developer.Net

If at first you don't succeed, then skydiving definitely isn't for you.
Previous
Reply
Map
View

Click here to load this message in the networking platform