Hola..
Un Ejemplo
using System;
using System.Data;
using System.Data.SqlClient;
-------------------------------------------------------------------------------------------------------
SqlConnection myconnect = new SqlConnection("StringConexion");
SqlCommand mycommand = new SqlCommand();
mycommand.Connection = myconnect;
SqlParameter Usr_Name = new SqlParameter("@Usr_Name", SqlDbType.NVarChar);
Usr_Name.Value = name;
SqlParameter Usr_Pass = new SqlParameter("@Usr_Pass", SqlDbType.NVarChar);
Usr_Pass.Value = name;
mycommand.CommandType = CommandType.StoredProcedure;
mycommand.CommandText = "MP_AddUser";
mycommand.Parameters.Add(Usr_Name);
mycommand.Parameters.Add(Usr_Pass);
try {
myconnect.Open();
mycommand.ExecuteNonQuery();
}
catch( Exception Ex) {
throw new Exception("Error in call store procedure" + Ex.Message);
}
finally {
myconnect.Close();
}
Aunque te recomiendo que utilices el componente de MS de acceso a datos Microsoft.ApplicationBlocks.Data.dll, solo tienes que colocarlo en la carpeta Bin, y listo ya puedes usarla.
http://www.microsoft.com/spanish/msdn/articulos/archivo/010802/voices/daab-rm.asp
Saludos.
Cristian Pereira