
Hello, my problem is about how to make and execute a stored procedure, but from out c# .net '05 code. (so to do it automatically when my program starts Het volgende heb ik al: Code: [CODE]public static void Create_spOmzetArtikels(Boolean clrEnabled) { if (clrEnabled) { if (!SqlContext.IsAvailable) ClrEnabled(); } //if (SqlContext.IsAvailable) //{ //using (SqlConnection conn = _SQLConnection) using (SqlConnection conn = new SqlConnection("context connection=true")) { SqlCommand InsertCurrencyCommand = new SqlCommand(); SqlParameter currencyCodeParam = new SqlParameter("@CurrencyCode", SqlDbType.NVarChar); SqlParameter nameParam = new SqlParameter("@Name", SqlDbType.NVarChar); InsertCurrencyCommand.CommandText = "INSERT Sales.Currency (CurrencyCode, Name, ModifiedDate)" + " VALUES(@CurrencyCode, @Name)"; InsertCurrencyCommand.Connection = conn; conn.Open(); //InsertCurrencyCommand.ExecuteNonQuery(); SqlContext.Pipe.ExecuteAndSend(InsertCurrencyCommand); conn.Close(); } //} //else // MessageBox.Show("The SqlContext can't be accessed!!"); }[/CODE] and then will this be operated (it's standing default off in SQL Server): Code: [CODE]private static void ClrEnabled() { //Enable CLR on SQL-Server! SqlConnection conn = _SQLConnection; try { conn.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } try { SqlCommand command = new SqlCommand( "EXEC sp_configure 'clr enabled', 1;
No recent activity.
Articles, blogs, videos and forum posts show up here.
No expertise to show yet.
This is worked out from what a member publishes.
