Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing a VFP stored proc from C#...help!!!
Message
De
19/09/2003 00:44:41
 
 
À
18/09/2003 23:57:37
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00830554
Message ID:
00830562
Vues:
16
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform