Pages

Men

rh

4/13/2013

How do I call a stored procedure from my application using ADO.Net?

SQLConnection Con = new SQLConnection("");
Con.Open();
SQLCommand Cmd =  new SQLCommand();

Cmd.CommandType = CommanType.StoredProcedure();
Cmd.Connection = Con;
Cmd.CommandText = "SP_GetAllData";
SQLDataAdapter da = new SQLDataAdapter(Cmd,Con); 
Dataset ds = new Dataset(); 
da.fill(ds);
 

No comments :

Post a Comment