PTT
Submit
Submit
选择语言
正體中文
简体中文
PTT
C_Sharp
[问题] 取得SQL print字串
楼主:
LeeYK
(一拳打死牛)
2015-04-21 12:35:02
请问各位,我想要在C#里面取得我在SQL print的字串
那我要如何取得呢?
程式码如下
SqlConnection db = new SqlConnection();
db.ConnectionString = "Data Source=LYK\\LYK;Initial Catalog=
选手01;Integrated Security=True";
db.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = db;
cmd.CommandText = "print('Test Word')";
cmd.ExecuteNonQuery();
db.Close();
谢谢大家
作者:
bernachom
(Terry)
2015-04-21 15:51:00
session["txt"] = Command.ExecuteScalar() ?
作者:
ryan10328
(大鸟)
2015-04-21 18:34:00
你的需求是什么,因为其实如果要print,你可以考虑以ado. net执行store procedure 再去接他回传的值,应该可以有同样效果
http://goo.gl/wvkdVE
楼主:
LeeYK
(一拳打死牛)
2015-04-22 09:08:00
我是想说我在SQL里面做交易处理,如果成功的话就会print('SUCCESS'),我想如果用C#来接收结果的话会更方便
作者:
ssccg
(23)
2015-04-22 14:06:00
不要print,用回传值啊...
作者:
O187
(187cm)
2015-04-23 12:30:00
这不就跟我要煮一锅白米饭,但我坚持食材要用肉而不是白米一样吗?
楼主:
LeeYK
(一拳打死牛)
2015-04-23 13:12:00
原来如此..我都忘记回传这玩意儿了
继续阅读
[问题]读取背景图片颜色问题
ljuyentintho
[问题] picturebox图像缩放
dabiddabid
[问题]datatable 万笔资料输出
g66932007
[问题] 关于SQLITE资料合并,商管求救资工达人
tom8891
[问题]用button测试gc
pili100
[问题] c# mediaplayer 拖拉
cheatfinish
[问题] RDLC 清单问题
drizzt123
[问题] 生成PDF指定路径储存
cwoldind
[问题] Transaction用在视窗程式?
LeeYK
[问题] 如何有效率为某个函式库作call log?
deo2000
Links
booklink
Contact Us: admin [ a t ] ucptt.com