I waited for 10 minutes and nothing
using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class StoredProcedures
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void getSalesOrdersHeaders()
{
// Put your code here
SqlPipe sp = SqlContext.Pipe;
using (SqlConnection conn = new SqlConnection(@."Data Source=ESTACION15\SQL2005; User Id=pruebas; Password=pruebas;database=AdventureWorks;"))
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
cmd.CommandText = "select * from sales.SalesOrderHeader";
SqlDataReader rdr = cmd.ExecuteReader();
sp.Send(rdr);
}
}
};
I tried to run it from visual studio .net and I get A TimeOut errorError 1 Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Pubs|||
How did you run it from Visual Studio?
From server explorer, test scripts or database project script
Thanks,
-Vineet.
SqlConnection conn = new SqlConnection("context connection = true");
will get a reference to the existing one.
more info @. http://codebetter.com/blogs/sahil.malik/archive/2005/07/26/129824.aspx
No comments:
Post a Comment