c# textbox值与access中已存在的值比较

来源:百度知道 编辑:UC知道 时间:2024/06/26 04:38:30
if (cn_SoftNameTextBox.Text.Trim() == null || cn_SoftNameTextBox.Text.Trim() == "" && cn_SoftCodeTextBox.Text.Trim() == null || cn_SoftCodeTextBox.Text.Trim() == "")
{
MessageBox.Show("请写软件信息和代码");
//if (cn_SoftCodeTextBox .Text .)
return;
}
else
{
OleDbConnection thisConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Windows.Forms.Application.StartupPath + "/CnEduCode.mdb");//创建连接对象
//myConn.Open();//打开数据库

//OleDbConnection conn = new OleDbConnection(myConn);

//OleDbCommand cmd = new OleDbCommand();

//string softcodestr = cn_SoftCodeTextBox.Text.Trim();

//cmd.CommandText = "select Cn_SoftCode from Cn_SoftWare where C

?判断信息是否已经存在?
那根据当前 TEXTBOX 中的值 去查寻 信息,能查到说明已经有了
查不到说明没有呗
查询表就是返回的表有没有数据行
查询一个字段 就看返回的是不是空