首页 新闻 会员 周边 捐助

连接数据库,,,,急急急、、、、、

0
悬赏园豆:140 [已关闭问题] 关闭于 2011-07-26 10:29

  string searchText = this.TextBox3.Text;
            StringBuilder sb = new StringBuilder();
            sb.Append("select * from UpLoad where Resourse_Title like '%");
            sb.Append(searchText);
            sb.Append("%'or Resourse_JianJie like '%");
            sb.Append(searchText);
            sb.Append("%'");


            OleDbConnection conn = new OleDbConnection();
            conn.ConnectionString = "Provider = sqloledb;Database=CHANGSHA-DB5D6B;Initial Catalog=User_Iformations;Integrated Security=True";
            conn.Open();
            DataSet ds = new DataSet();
            OleDbDataAdapter ada = new OleDbDataAdapter(sb.ToString(), conn);
            ada.Fill(ds);
            this.Repeater1.DataSource = ds;
            this.Repeater1.DataBind();
            conn.Close();

//怎么样把下面的连接语句改成SQL的,,,,,很急,求告诉解决

次时代的主页 次时代 | 初学一级 | 园豆:5
提问于:2011-07-26 10:03
< >
分享
所有回答(1)
0

string strsql=string.Format ("select * from UpLoad where Resourse_Title like '%{0}%' or  Resourse_JianJie  like '%{1}%'",searchText,searchText);

xuebingz | 园豆:143 (初学一级) | 2011-07-26 10:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册