Stored procedures

G

Guest

Hi, I've seen that stored procedures are not supported by SQL Server CE
But what about calling a stored procedure from a remote standard SQL SERVER

I've try this

SqlConnection PubsConn = new SqlConnection
("Data Source=server;integrated " +
"Security=sspi;initial catalog=pubs;")
SqlCommand testCMD = new SqlCommand
("TestProcedure", PubsConn)

testCMD.CommandType = CommandType.StoredProcedure


but it doesnt work
 
H

HomeAutomation Freak

Hi, I've seen that stored procedures are not supported by SQL Server CE.
But what about calling a stored procedure from a remote standard SQL SERVER ?

I've try this :

SqlConnection PubsConn = new SqlConnection
("Data Source=server;integrated " +
"Security=sspi;initial catalog=pubs;");
SqlCommand testCMD = new SqlCommand
("TestProcedure", PubsConn);

testCMD.CommandType = CommandType.StoredProcedure;
"

but it doesnt work

I also tried, and tried, and finally came up with this (bit of lame)
solution:

SQLmcd = new system.data.sqlclient.sqlcommand("Exec
SP_StoredProcNameHere param1here, param2here etc ...",SQLConn)


best regards,
Kris
 
G

Guest

Well in fact my problem was I just didnt write the "using System.Data;" line to use the CommandType enumeration
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top