我对此有疑问(不支持关键字:'datasource')。 [英] i have problem about that( Keyword not supported: 'datasource').

查看:236
本文介绍了我对此有疑问(不支持关键字:'datasource')。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

com = new SqlCommand();
           con = new SqlConnection(stcon);//problem here
           com.Connection = con;
           com.CommandText = "insert into client(name)values(@a)";
           com.Parameters.AddWithValue("@",name);
           try
           {
               con.Open();
               int i = com.ExecuteNonQuery();
               if (i>0)
                   con.Close();
           }
           catch(Exception ex)
           {
               throw ex;
           }

推荐答案

如果你把连接字符串放在问题中会很好。但是我愿意打赌,快速浏览一下这个网站会告诉你解决问题所需的一切。



书签: http://www.connectionstrings.com/ [ ^ ]
It would be nice if you would put the connection string in the question. However I''m willing to bet that a quick perusal of this web site will tell you everything you need to solve your problem.

Book mark it: http://www.connectionstrings.com/[^]


这篇关于我对此有疑问(不支持关键字:'datasource')。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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