当前位置:编程学习 > C#/ASP.NET >>

vc++ .net datagridview不显示数据库数据

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
 String^ selectSql =L"SELECT * FROM Customers WHERE";
 if(this->textBox1->Text ==String::Empty) selectSql +=L"1>0";
 else selectSql +=L"CustomID LIKE '" + this->textBox1->Text +L"'";
 selectSql +=L" AND ";
 if(this->textBox2->Text ==String::Empty) selectSql +=L"1>0";
 else selectSql +=L"CompanyName LIKE '" + this->textBox2->Text +L"'";
 this->dataSet1->Clear();
 this->sqlSelectCommand1->CommandText=selectSql;
 this->sqlDataAdapter1->Fill(this->dataSet1);

 }

sqldataadpter可以预览
datagridview只显示标题栏?
--------------------编程问答--------------------
补充:.NET技术 ,  VC.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,