Put it in a proc and run an EXEC query, same way as any other procedure.
Jeff
|||If the SQL function returns a string, why not use SqlCommand.ExecuteScalar method:
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{
conn.Open();
string qstring = "SELECT dbo.fn_test('IORI')";
SqlCommand cmd = new SqlCommand(qstring, conn);
string s=cmd.ExecuteScalar().ToString();
Response.Write("The new string is:" + s);
}
No comments:
Post a Comment