将sqlconnection对象转换为字符串类型 [英] convert sqlconnection object to string type

查看:79
本文介绍了将sqlconnection对象转换为字符串类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlConnection constr =新的SqlConnection(@"数据源=.\ SQLEXPRESS;
集成安全性= True; Database = abc);

字符串conn = constr.ToString();

返回conn;


在上面的代码中,我无法将constr转换为字符串类型.

请尽快建议我.

SqlConnection constr= new SqlConnection(@"Data Source=.\SQLEXPRESS;
Integrated Security=True ; Database=abc");

string conn = constr.ToString();

return conn;


In the above code,I am unable to convert constr to string type.

Please suggest me as soon as possible.

推荐答案

谢谢您的发帖!  ;我建议您在一个MS论坛中发布您的问题,

Thank you for your post!  I would suggest posting your question in one of the MS Forum,

Data Developer Center > Data Platform Development Forums > LINQ to SQL


这篇关于将sqlconnection对象转换为字符串类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆