How to run code from sql server in c#
SqlCommand cmd = new SqlCommand("select Developer from Stackoverflow where UserID='786' and Developer='Sufiyan'", con); if (con.State == ConnectionState.Closed) { con.Open(); } SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { string codeSnippet = reader["CodeSnippet"].ToString(); dynamic script = CSScript.LoadCode(@" using System; using System.Windows.Forms; using System.Collections.Generic; using System.Data; using System.Windows.Forms; using System.Data.SqlClient; public class RunFromSqlServer { public void RunCode(string developer){" + codeSnippet + "}"+ "}").CreateObject("*");script.RunCode("Mohammad Sufiyan Shaikh"); } if (con.State == ConnectionState.Open) { con.Close(); }