标题:[求助]C#连接SQL2005问题
取消只看楼主
sun_life
Rank: 1
等 级:新手上路
帖 子:356
专家分:5
注 册:2006-5-29
结帖率:72.73%
 问题点数:0 回复次数:0 
[求助]C#连接SQL2005问题
谁能帮我看看!

SqlConnection conn = new SqlConnection("server=localhost;pwd = sun,user id ='sa',database = test,Integrated Security=SSPI");
                    
                conn.Open();

                SqlCommand cmd = new SqlCommand();

                = "INSERT INTO test(city,tq,wd) VALUES ('qq','" + YQ + "','" + WD + "')";

                cmd.Connection = conn;

                cmd.ExecuteNonQuery();

                MessageBox.Show("数据添加成功!");

                conn.Close();

未命名.JPG (10.89 KB)
搜索更多相关主题的帖子: localhost database server 
2008-09-20 18:36



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-234268-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.159339 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved