标题:亲们,帮个忙啊
取消只看楼主
ttt123456ttt
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2012-11-6
结帖率:50%
已结贴  问题点数:20 回复次数:0 
亲们,帮个忙啊
            SqlConnection conn = new SqlConnection("Data Source=localhost;Initial Catalog=Book1;Integrated Security=true;");
            conn.Open();

            string sql = "select bookTypeID from BookType where bookType="+comboBox1.SelectedItem;//此处有错
            SqlCommand comm1 = new SqlCommand(sql, conn);
            SqlDataReader read1 = comm1.ExecuteReader(CommandBehavior.CloseConnection);
            read1.Read();
            textBox1.Text = read1["bookTypeID"].ToString() ;
          报错,列名找不到

搜索更多相关主题的帖子: sql localhost where 
2012-11-06 19:26



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




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

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