请解释我为什么使用某些东西 [英] please explain me why we using certain thing

查看:64
本文介绍了请解释我为什么使用某些东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public void InsertUpdateDeleteSQLString(string sqlstring)//here why we use string sqlstring.can please any one can explain me in detail regarding this.

        {

            SqlConnection objsqlconn = new SqlConnection(conn);

            objsqlconn.Open();

            SqlCommand objcmd = new SqlCommand(sqlstring, objsqlconn);

            objcmd.ExecuteNonQuery();

 

        }

 

        public object ExecuteSqlString(string sqlstring)

        {

            SqlConnection objsqlconn = new SqlConnection(conn);

            objsqlconn.Open();

            DataSet ds = new DataSet();

            SqlCommand objcmd = new SqlCommand(sqlstring, objsqlconn);//how this sqlstring works here please explain me .

            SqlDataAdapter objAdp = new SqlDataAdapter(objcmd);

            objAdp.Fill(ds);

            return ds;

        }

推荐答案

查看此链接

http://msdn.microsoft.com/en-us/library/877h0y3a(v = vs.110 ).aspx [ ^ ]

我认为'sqlstring'你提到的是命令文本,请参考下面的链接

http://msdn.microsoft.com/en-us/library/system.data。 sqlclient.sqlcommand.commandtext(v = vs.110).aspx [ ^ ]
check this link
http://msdn.microsoft.com/en-us/library/877h0y3a(v=vs.110).aspx[^]
I think 'sqlstring' u mentioned is the command text refer the link below
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtext(v=vs.110).aspx[^]


这篇MSDN文章应该清楚一切: http://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqlstring%28v=vs.110%29.aspx [ ^ ] 。



如果您不清楚这一点,您可能需要解释一下您的疑虑 - 请参阅我对该问题的评论。



-SA
Everything should be clear from this MSDN article: http://msdn.microsoft.com/en-us/library/system.data.sqltypes.sqlstring%28v=vs.110%29.aspx[^].

If this is not clear to you, you probably need to explain what concerns you — please see my comment to the question.

—SA


这篇关于请解释我为什么使用某些东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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