problem with storeprocedure creation

Jan 8 2009 7:00 AM

i am working in C#.net (windows application) and sql server 2005.

In my project i have to create multiple storeprocedures. So that i am keeping the query in a single text file.  In between every storeprocedures i put a  'go' statement. But while running, it shows an error...

  here is my code,

SqlCommand sqlEmp = new SqlCommand();

sqlEmp.Connection = CPublic.Comm_con;

sqlEmp.CommandType = CommandType.Text;

string s = "";

using (StreamReader sr = new StreamReader(@"D:\sp.txt"))

{s = sr.ReadToEnd();}

sqlEmp.CommandText = s;

sqlEmp.ExecuteNonQuery();

 

can u help me ?

 

 


Answers (4)