/// <summary> /// 计算中奖情况 /// </summary> /// <param name="issueCode"></param> /// <param name="openResult"></param> /// <param name="item"></param> protected override void IssueCalculate(string issueCode, string openResult, BasicModel.LotteryBasic.BetDetail item) { //大小单双1,2,3,4,5 openResult = openResult.Replace(",", ""); if (openResult.Length == 5) { openResult = openResult.Remove(0, 3); } else { openResult = openResult.Remove(0, 1); } var res = openResult.Select(m => Convert.ToInt32(m.ToString())); var temp = item.BetContent.Split(','); var wd = res.First() >= 5 ? Da.ToString() : Xiao.ToString(); var wds = res.First() % 2 == 0 ? Shuang.ToString() : Dan.ToString(); var qd = res.Last() >= 5 ?Da.ToString(): Xiao.ToString(); var qds = res.Last() % 2 == 0 ? Shuang.ToString() : Dan.ToString(); var count = 0; count = temp[0].Split('-').Count(m => "-" + m.ToString() == wd || "-" + m.ToString() == wds) * temp[1].Split('-').Count(m => "-" + m.ToString() == qd || "-" + m.ToString() == qds); if (count > 0) { item.IsMatch = true; var stepAmt = 0m; item.WinMoney = TotalWinMoney(item, GetBaseAmt(item, ref stepAmt), stepAmt, count); } }
private void btnSave_Click(object sender, EventArgs e) { try { MessageBox.Show("Your ID is :" + this.ID); GenerateDoctorID(); this.Sql = "insert into dbo.DoctorInformation (id,name,contact,stime,etime,area,caddress,specialist) values ('" + this.ID + "','" + this.txtName.Text + "','" + this.txtContactNo.Text + "','" + this.dtmStart.Text + "','" + this.dtmEnd.Text + "','" + this.cbboxArea.Text + "','" + this.txtChamberAddress.Text + "','" + this.cbboxSpecilist.Text + "');"; string sql = "insert into dbo.signin (id,name,password,type) values('" + this.ID + "','" + this.txtName.Text + "','" + this.txtPassword.Text + "','doctor');"; this.Ds = Da.ExecuteQuery(this.Sql); this.Ds = Da.ExecuteQuery(sql); FormAppointmentList fal = new FormAppointmentList(); fal.Visible = true; this.Visible = false; } catch (Exception exc) { MessageBox.Show("An error has occored during saving data\n" + exc.Message); } }
public void GetFeedData(string sql) { this.attributeNames = new string[12] { "AD-ID :", "Title : ", "Rent : ", "Location : ", "Block/Road :", "Apartment No : ", "Contact : ", "SquareFeet : ", "Floor : ", "Facilities : ", "Owener ID : ", "Flat available for : " }; this.adsPanel = new List <Panel>(); this.adsAttribute = new List <Label> [12]; for (int i = 0; i < adsAttribute.Length; i++) { this.adsAttribute[i] = new List <Label>(); } try { this.Da = new DataAccess(); this.Ds = Da.ExecuteQuery(sql); for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) { //runtime panel this.adsPicture = new List <PictureBox>(); this.adsPanel.Add(new Panel()); this.adsPanel.ElementAt(i).Size = new Size(930, 600); this.adsPanel.ElementAt(i).BackColor = Color.FromArgb(190, 255, 255, 255); //load Attributes to feed for (int j = 0, k = 0; j < adsAttribute.Length; j++, k += 40) { Console.WriteLine(Ds.Tables[0].Rows[i][j].ToString()); this.adsAttribute[i].Add(new Label()); this.adsAttribute[i].ElementAt(j).Size = new Size(300, 24); this.adsAttribute[i].ElementAt(j).Location = new Point(59, (18 + k)); this.adsAttribute[i].ElementAt(j).BackColor = Color.FromArgb(0, 255, 255, 255); this.adsAttribute[i].ElementAt(j).Font = new Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.adsAttribute[i].ElementAt(j).Text += attributeNames[j] + Ds.Tables[0].Rows[i][j].ToString(); this.adsPanel.ElementAt(i).Controls.Add(adsAttribute[i].ElementAt(j)); } for (int j = 0; j < 4; j++) { this.adsPicture.Add(new PictureBox()); this.adsPicture.ElementAt(j).Size = new Size(200, 200); this.adsPicture.ElementAt(j).SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.adsPicture.ElementAt(j).ImageLocation = Ds.Tables[0].Rows[i][j + 12].ToString(); this.adsPicture.ElementAt(j).Visible = true; this.adsPanel.ElementAt(i).Controls.Add(adsPicture.ElementAt(j)); } this.adsPicture.ElementAt(0).Location = new Point(500, 9); this.adsPicture.ElementAt(1).Location = new Point(720, 9); this.adsPicture.ElementAt(2).Location = new Point(500, 250); this.adsPicture.ElementAt(3).Location = new Point(720, 250); this.flpFeed.Controls.Add(adsPanel.ElementAt(i)); } } catch (Exception e) { Console.WriteLine(e); } }
void PlayAnimation() { Da.SetActive(true); Db.SetActive(true); Dc.SetActive(true); Dd.SetActive(true); De.SetActive(true); Hand.SetActive(true); PlayTime = Time.time; MovieOn = true; }
public static Boolean consultaAlumnos(ref DataTable dataTableAlumnos, ref string msg) { BaseDatos Db = new BaseDatos(); StringBuilder Sql = new StringBuilder(); DataAdapter Da; DataSet Ds = new DataSet(); bool Exito; try { Db.Conectar(true); Sql.AppendLine("SELECT IIDALUMNO, NOMBRE, APPATERNO, APMATERNO, TELEFONOPADRE "); Sql.AppendLine("FROM SistemaMatricula.dbo.Alumno "); Sql.AppendLine("WHERE BHABILITADO = 1 "); Sql.AppendLine("; "); Db.CrearComando(Sql.ToString()); Da = Db.CrearAdapter(); Da.Fill(Ds); dataTableAlumnos = Ds.Tables[0]; Exito = true; msg = "OK"; } catch (Exception Ex) { Exito = false; msg = Ex.ToString(); } return(Exito); }
public override BindingList <Employee> GetAll() { var list = new List <Employee>(); string sql = "SELECT [EmployeeKey],[FirstName],[LastName],[Title],[EmailAddress],[SalesTerritoryKey] FROM [dbo].[DimEmployee]"; DataTable dt = new DataTable(); using (SqlConnection connection = new SqlConnection(Db.ConnectionString)) { Da.SelectCommand = new SqlCommand(sql, connection); Da.Fill(dt); } if (dt.Rows.Count < 1) { return(new BindingList <Employee>(list)); } foreach (var row in dt.AsEnumerable()) { var EmployeeKey = row.Field <int>("EmployeeKey"); var FirstName = row.Field <string>("FirstName"); var LastName = row.Field <string>("LastName"); var Title = row.Field <string>("Title"); var EmailAddress = row.Field <string>("EmailAddress"); var SalesTerritoryKey = row.Field <int>("SalesTerritoryKey"); list.Add(new Employee(EmployeeKey, FirstName, LastName, Title, EmailAddress, SalesTerritoryKey)); } return(new BindingList <Employee>(list)); }
/// <summary> /// 删除款项 /// </summary> /// <param name="userModel"></param> /// <param name="request"></param> /// <param name="msg"></param> /// <returns></returns> public bool DeleteSaleOrderReceive(UserModel userModel, SaleReceive request, out string msg) { var m = Da.Get <SaleReceive>(request.SaleReceiveId); if (m == null) { msg = "订单不存在,操作失败"; return(false); } var order = Da.Get <SaleOrder>(m.SaleOrderId); var b1 = CheckAuthOrder(userModel, order, out msg); if (!b1) { return(false); } if (order.Status == (int)SaleOrderStatusEnum.Draft || order.Status == (int)SaleOrderStatusEnum.ShipedPay) { msg = "删除失败"; return(false); } return(Da.Delete(m)); }
private void MTRBtnLogin_Click(object sender, EventArgs e) { string id = this.MTRTxtId.Text; string password = this.MTRTxtPassword.Text; string sql = "select * from login where userId='" + id + "' and password='******';"; this.Ds = Da.ExecuteQuery(sql); if (this.Ds.Tables[0].Rows.Count > 0) { MessageBox.Show("Login Successful"); UserHomeDashboard UHD = new UserHomeDashboard(id); UHD.Visible = true; this.Visible = false; this.Id = this.MTRTxtId.Text; Thread OutOfMedicineThread = new Thread(this.CheckOutOfMedicineList); OutOfMedicineThread.IsBackground = true; OutOfMedicineThread.Start(); DataSet dsMorning = Da.ExecuteQuery("select * from [HealthyHome].[dbo].[Medicines] where userId='" + id + "' and morningAlarm='Yes' ;"); DataSet dsDay = Da.ExecuteQuery("select * from [HealthyHome].[dbo].[Medicines] where userId='" + id + "' and dayAlarm='Yes' ;"); DataSet dsNight = Da.ExecuteQuery("select * from [HealthyHome].[dbo].[Medicines] where userId='" + id + "' and nightAlarm='Yes' ;"); this.DD = dsDay; this.DM = dsMorning; this.DN = dsNight; Thread alarm = new Thread(startAlarm); alarm.IsBackground = true; this.AlarmThread = alarm; alarm.Start(); } else { MessageBox.Show("Invalid User Id or Password"); } }
/// <summary> /// 计算中奖情况 /// </summary> /// <param name="issueCode"></param> /// <param name="openResult"></param> /// <param name="item"></param> protected override void IssueCalculate(string issueCode, string openResult, BasicModel.LotteryBasic.BetDetail item) { //大小单双6,8,0,1,5 单双单 var res = openResult.Remove(0, 4).Split(',').Select(m => Convert.ToInt32(m)).ToList(); var temp = item.BetContent.Split(','); var bd = res[0] >= 5 ? Da.ToString() : Xiao.ToString(); var bds = res[0] % 2 == 0 ? Shuang.ToString() : Dan.ToString(); var sd = res[1] >= 5 ? Da.ToString() : Xiao.ToString(); var sds = res[1] % 2 == 0 ? Shuang.ToString(): Dan.ToString(); var gd = res[2] >= 5 ? Da.ToString(): Xiao.ToString(); var gds = res[2] % 2 == 0 ? Shuang.ToString() : Dan.ToString(); var count = 0; count = temp[0].Split('-').Count(m => "-" + m.ToString() == bd || "-" + m.ToString() == bds) * temp[1].Split('-').Count(m => "-" + m.ToString() == sd || "-" + m.ToString() == sds) * temp[2].Split('-').Count(m => "-" + m.ToString() == gd || "-" + m.ToString() == gds); if (count > 0) { item.IsMatch = true; var stepAmt = 0m; item.WinMoney = TotalWinMoney(item, GetBaseAmt(item, ref stepAmt), stepAmt, count); } }
public static Boolean consultaPeriodos(ref DataTable dataTableCursos, ref string msg) { BaseDatos Db = new BaseDatos(); StringBuilder Sql = new StringBuilder(); DataAdapter Da; DataSet Ds = new DataSet(); bool Exito; try { Db.Conectar(true); Sql.AppendLine("SELECT IIDPERIODO, NOMBRE, FECHAINICIO, FECHAFIN "); Sql.AppendLine("FROM SistemaMatricula.dbo.Periodo "); Sql.AppendLine("WHERE BHABILITADO = 1 "); Sql.AppendLine("; "); Db.CrearComando(Sql.ToString()); Da = Db.CrearAdapter(); Da.Fill(Ds); dataTableCursos = Ds.Tables[0]; Exito = true; msg = "OK"; } catch (Exception Ex) { Exito = false; msg = Ex.ToString(); } return(Exito); }
/************************************************************************** * * 修改: 函数 返回类型由DataSet该为返回int类型 * 返回值1代表成功 0代表失败 * * **********************************************************************/ /// <summary> /// 运行SQL语句,返回DataSet对象 /// </summary> /// <param name="procName">SQL语句</param> /// <param name="prams">DataSet对象</param> /// <param name="dataReader">表名</param> public int RunProc(string SQL, DataSet Ds, int StartIndex, int PageSize, string tablename) { SqlConnection Conn; Conn = new SqlConnection(ConnStr); Conn.Open(); SqlDataAdapter Da; Da = CreateDa(SQL); try { Da.Fill(Ds, StartIndex, PageSize, tablename); return(1); } catch//(Exception Ex) { // throw else; return(0); } finally { Dispose(Conn); } //return Ds; }
public void PopulateGridView(string sql = "select * from admin") { this.Da = new DataAccess(); this.Ds = Da.ExecuteQuery(sql); this.dgvSystemDataUsersSystemData.AutoGenerateColumns = false; this.dgvSystemDataUsersSystemData.DataSource = Ds.Tables[0]; }
private void RecordsGridView(string sql = @"select records.serial,records.orderid,records.userid ,login.username, records.customername, records.bookid, records.bookname, records.quantity, records.price, records.orderdate from records inner join login on records.userid= login.userId;")//optional value { this.Ds = Da.ExecuteQuery(sql); this.dgvRecords.AutoGenerateColumns = false; this.dgvRecords.DataSource = Ds.Tables[0]; }
public ActionResult DeleteConfirmed(int id) { Da da = db.Das.Find(id); db.Das.Remove(da); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// 获取产品图片 /// </summary> /// <param name="userModel"></param> /// <param name="productId"></param> /// <returns></returns> public virtual List <string> GetProductImageList(UserModel userModel, Guid productId) { var list = Da.GetList <ProductImage>(new { ProductId = productId }); return(list.OrderBy(p => p.Sort).Select(p => p.PathImage).ToList()); }
public User UpdateUserInfo(string id, User u) { string sql = "update [HealthyHome].[dbo].[User] set name='" + u.Name + "',password='******',email='" + u.Email + "',phoneNumber='" + u.PhoneNo + "',gender='" + u.Gender + "',dateOfBirth='" + u.DateOfBirth + "' where id='" + u.Id + "';"; Da.ExecuteUpdateQuery(sql); sql = "update [HealthyHome].[dbo].[Login] set password='******'where userId='" + u.Id + "';"; Da.ExecuteUpdateQuery(sql); return(u); }
public AlarmForm(string id, Thread t, DataSet dm, DataSet dd, DataSet dn) { //MessageBox.Show(" Inside Alarm Class"); this.DD = dd; this.DM = dm; this.DN = dn; InitializeComponent(); this.Da = new DataAccess(); this.Ds = new DataSet(); this.T = t; this.Id = id; while (true) { string sql = "select * from [HealthyHome].[dbo].[Alarm] where userId='" + this.Id + "';"; try { this.Ds = Da.ExecuteQuery(sql); } catch (Exception ex) { MessageBox.Show(ex.Message); } string morning = Ds.Tables[0].Rows[0]["morning"].ToString(); string day = Ds.Tables[0].Rows[0]["day"].ToString(); string night = Ds.Tables[0].Rows[0]["night"].ToString(); //MessageBox.Show("Current time : " + DateTime.Now.ToString("HH:mm:ss") + "\nMorning : " + morning + "\nDay : " + day + "\nNight : " + night); string currenTtiME = DateTime.Now.ToString("HH:mm:ss"); int time = 0; if (currenTtiME.Equals(morning)) { MessageBox.Show(" Alert Morning Medicine Time "); time = 1; //Application.Run(new DemoForm(this.Id,"morningAlarm")); Application.Run(new DemoForm(time, this.Id, this.DM, this.T)); Thread.Sleep(2000); } if (currenTtiME.Equals(day)) { time = 2; MessageBox.Show(" Alert Day Medicine Time "); //Application.Run(new DemoForm( this.Id, "dayAlarm")); Application.Run(new DemoForm(time, this.Id, this.DD, this.T)); Thread.Sleep(2000); } if (currenTtiME.Equals(night)) { time = 3; MessageBox.Show(" Alert Night Medicine Time "); //Application.Run(new DemoForm( this.Id, "nightAlarm")); Application.Run(new DemoForm(time, this.Id, this.DN, this.T)); Thread.Sleep(2000); } } }
public ActionResult Edit([Bind(Include = "MaDa,Da1")] Da da) { if (ModelState.IsValid) { db.Entry(da).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(da)); }
// select sum(price) from records private void Records_Load(object sender, EventArgs e) { this.Sql = "select sum(price) from records"; this.Ds = Da.ExecuteQuery(this.Sql); this.lblAccounts.Text = Ds.Tables[0].Rows[0][0].ToString(); this.Sql = "select sum(quantity) from records"; this.Ds = Da.ExecuteQuery(this.Sql); this.lblSellQuantity.Text = Ds.Tables[0].Rows[0][0].ToString(); }
public string GetID() { this.Sql = "select id from admin order by id desc;"; this.Da = new DataAccess(); this.Ds = Da.ExecuteQuery(Sql); string str = Ds.Tables[0].Rows[0]["id"].ToString(); string [] id = str.Split('-'); return(id[1]); }
private void btnConfirm_Click(object sender, EventArgs e) { try { if (rbtnMale.Checked == true) { this.Gender = "Male"; } else { this.Gender = "Female"; } if (rbtnSignle.Checked == true) { this.MaritialStatus = "Single"; } if (rbtnMarried.Checked == true) { this.MaritialStatus = "Married"; } else { this.MaritialStatus = "Widowed"; } GeneratePatientID(); //MessageBox.Show(this.str[1]); //this.ID = "p101"; string sql = "insert into dbo.signin (id,name,password,type) values('" + this.ID + "','" + this.txtName.Text + "','" + this.textBox1.Text + "','patient');"; this.Sql = "insert into dbo.appointmentlist (id,name,gender,contactno,maritalstatus,date,type,description,time,area,age,appid) values('" + this.ID + "','" + this.txtName.Text + "','" + this.Gender + "','" + this.txtContact.Text + "','" + this.MaritialStatus + "','" + this.dtpDate.Text + "','" + this.cmboxVisitType.Text + "','" + this.ckBox.SelectedItem + "','" + this.dtpTime.Text + "','" + this.cmboxSelectArea.Text + "','" + this.txtAge.Text + "','');"; this.Ds = Da.ExecuteQuery(this.Sql); this.Ds = Da.ExecuteQuery(sql); ; FormDoctorList fdl = new FormDoctorList(); fdl.getId(ID); fdl.Visible = true; this.Visible = false; } catch (Exception exc) { MessageBox.Show("An error has occored during saving data\n" + exc.Message); } }
public ActionResult Create([Bind(Include = "MaDa,Da1")] Da da) { if (ModelState.IsValid) { db.Das.Add(da); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(da)); }
/// <summary> /// 生成Html /// </summary> private void GenerateHtml() { lock (IsRunning) { Action <string> report = Write; //report.Invoke($"[{DateTime.Now:mm:ss}] 准备开始..."); var flag = false; List <GenerateHtml> rows; while ((rows = Da.GetGenerateHtmls()).Count > 0) { if (!flag) { if (File.Exists(Path)) { lock (Path) { File.Delete(Path); } } } var model = Da.GetGenerateHtmlReport(); report.Invoke($"[{DateTime.Now:mm:ss}] 开始进度:{model.Finished}/{model.Total}"); flag = true; var tasks = new List <Task>(); foreach (var row in rows) { var task = Generate(row); tasks.Add(task); } Task.WaitAll(tasks.ToArray()); Da.BulkUpdate(rows, p => new { p.IsSuccess }, p => new { p.GenerateHtmlId }); report.Invoke($"[{DateTime.Now:mm:ss}] 完成进度:{model.Finished}/{model.Total}"); Thread.Sleep(100); } if (!flag) { report.Invoke($"[{DateTime.Now:mm:ss}] 完成"); return; } var m = Da.GetGenerateHtmlReport(); report.Invoke($"[{DateTime.Now:mm:ss}] 成功报告:{m.Success}/{m.Total},失败:{m.Total - m.Success}"); Da.BulkDeleteAll <GenerateHtml>(); } }
public static Boolean consultaPeriodosxNombre(ref string nombrePeriodo, ref DataTable dataTableCursos, ref string msg) { BaseDatos Db = new BaseDatos(); StringBuilder Sql = new StringBuilder(); DataAdapter Da; DataSet Ds = new DataSet(); bool Exito; try { Db.Conectar(true); Sql.AppendLine("SELECT IIDPERIODO, NOMBRE, FECHAINICIO, FECHAFIN "); Sql.AppendLine("FROM SistemaMatricula.dbo.Periodo "); Sql.AppendLine("WHERE BHABILITADO = 1 "); if (!string.IsNullOrEmpty(nombrePeriodo)) { Sql.AppendLine("AND NOMBRE LIKE @Filtro"); } ; Sql.AppendLine("; "); DbParameter[] arrayParms = new DbParameter[1]; arrayParms[0] = (DbParameter)Db.CrearParametro(); arrayParms[0].DbType = DbType.String; arrayParms[0].ParameterName = "@Filtro"; arrayParms[0].Value = '%' + nombrePeriodo.Trim() + '%'; Db.CrearComando(Sql.ToString()); foreach (DbParameter parametro in arrayParms) { Db.AsignarParametro(parametro); } Da = Db.CrearAdapter(); Da.Fill(Ds); dataTableCursos = Ds.Tables[0]; Exito = true; msg = "OK"; } catch (Exception Ex) { Exito = false; msg = Ex.ToString(); } return(Exito); }
public void CreateGenerateHtml() { //生成首页 Da.Add <Guid, GenerateHtml>(new GenerateHtml() { GenerateHtmlId = SeqGuid.NewGuid(), GenerateHtmlUrl = $"{Config.Domain}/Home/Index?ver={DateTime.Now.Ticks}&allow=true", GenerateHtmlPath = $"{AppDomain.CurrentDomain.BaseDirectory}index.html", IsGenerate = false, IsSuccess = false }); Task.Run(() => GenerateHtml()); }
// GET: Admin/Das/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Da da = db.Das.Find(id); if (da == null) { return(HttpNotFound()); } return(View(da)); }
/// <summary> /// 运行SQL语句,返回DataSet对象 /// </summary> /// <param name="procName">SQL语句</param> /// <param name="prams">DataSet对象</param> /// <param name="dataReader">表名</param> public DataSet RunProc(string SQL, DataSet Ds, int StartIndex, int PageSize, string tablename) { SqlDataAdapter Da; Da = GetDataAdapter(SQL); try { Da.Fill(Ds, StartIndex, PageSize, tablename); } catch (Exception ex) { throw ex; } return(Ds); }
/// <summary> /// 获取图片 /// </summary> /// <param name="productId"></param> /// <param name="product"></param> /// <returns></returns> public List <ProductImage> GetProductImages(Guid productId, out Product product) { product = Da.Get <Product>(productId); if (product == null) { return(new List <ProductImage>()); } var list = Da.GetList <ProductImage>(new { product.ProductId, }).OrderBy(p => p.Sort).ToList(); return(list); }
/// <summary> /// 添加款项 /// </summary> /// <param name="userModel"></param> /// <param name="request"></param> /// <param name="msg"></param> /// <returns></returns> public bool AddSaleOrderReceive(UserModel userModel, SaleReceive request, out string msg) { var order = Da.Get <SaleOrder>(request.SaleOrderId); var b1 = CheckAuthOrder(userModel, order, out msg); if (!b1) { return(false); } if (order.Status == (int)SaleOrderStatusEnum.Draft || order.Status == (int)SaleOrderStatusEnum.ShipedPay) { msg = "添加失败"; return(false); } var currency = Da.Get <Currency>(request.CurrencyId); var b2 = CheckAuthCurrency(userModel, currency, out msg); if (!b2) { return(false); } var accout = Da.Get <Account>(request.AccountId); var b3 = CheckAuthAccount(userModel, accout, out msg); if (!b3) { return(false); } var m = new SaleReceive() { SaleReceiveId = SeqGuid.NewGuid(), SaleOrderId = order.SaleOrderId, AccountInfo = $"{accout.AccountBank}[{accout.AccountNumber}]", Amount = request.Amount, CurrencySymbol = currency.CurrencySymbol, CurrencyRate = currency.CurrencyRate, Remark = null, CreateName = userModel.UserNickName, CreateDate = DateTime.Now, }; Da.Add <Guid, SaleReceive>(m); return(true); }
public DataSet loadDatafromTable(String table, String queue) { connectData(); Ds = new DataSet(); if (queue == "") { Da = new SqlDataAdapter("select* from " + table, Cnt); } else { Da = new SqlDataAdapter("select* from " + table + " where " + queue, Cnt); } Da.Fill(Ds); return(Ds); }