课后第7题:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarDAL
{
public class Car
{
public DataTable chaxun(string chufa, string mubiao)
{
SqlConnection con = new SqlConnection(SqlHelper.str);
string sql = "select checi,chufa,mudi,dattime from Car where chufa like'%" + chufa + "%'and mudi like'%" + mubiao + "%'";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(ds,"info");
return ds.Tables["info"];
}
}
}