4
Answers

problem with storeprocedure creation

Prasanth I D

Prasanth I D

16y
3.2k
1

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)