SqlDataAdapter daQuerry;
SqlConnection connQuerry;
FileStream fStream;
byte connType;//0:prolink;1:link2000
int onceReadCount;//一次读取的字节数
public audioQuerClass(string connString,byte conntype,int read_count)
{
this.daQuerry=new SqlDataAdapter();
this.connQuerry = new SqlConnection();
this.connQuerry.ConnectionString = connString;
this.connType = conntype;
this.onceReadCount = read_count;
}
public DataTable audioQuerry(string nameFilter)
{
SqlCommand sqlCommand1 = new SqlCommand();
sqlCommand1.Connection = this.connQuerry;
switch (this.connType)
{
case 0:sqlCommand1.CommandText = "select PKID,FileName,FileLen,FilePath from tMaterial where FileName like '%" + nameFilter + "%'";
break;
case 1: sqlCommand1.CommandText = "select jm_id as PKID,jm_name as FileName ,filelength as FileLen,jm_filename as FilePath from jm where jm_name like '%" + nameFilter + "%'";
break;
default: sqlCommand1.CommandText = "select jm_id as PKID,jm_name as FileName ,filelength as FileLen,jm_filename as FilePath from jm where jm_name like '%" + nameFilter + "%'";
break; }
|