Possible Duplicate:
Stored procedure return into DataSet in C# .Net
How can I call a stored procedure from my project using C#? I need to get the output of that stored procedure into a data table but I'm getting an error.
Code:
private string connectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;Integrated Security=SSPI;Initial Catalog=blablalbla;";
private DataTable dtProductPrijsActueel = new DataTable();
public DataTable productPrijsActueel()
{
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
SqlCommand comm = conn.CreateCommand();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "procSelectPrijsActueel";
dtProductPrijsActueel.Load(comm.ExecuteReader());
conn.Close();
conn.Dispose();
return dtProductPrijsActueel;
}
Error:
ERROR : KEYWORD NOT SUPPORTED : 'PROVIDER'