Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: Err... Form Design / Layout? Pin
Nagy Vilmos14-May-09 1:21
professionalNagy Vilmos14-May-09 1:21 
GeneralRe: Err... Form Design / Layout? Pin
Baeltazor14-May-09 1:25
Baeltazor14-May-09 1:25 
AnswerRe: Err... Form Design / Layout? Pin
Henry Minute14-May-09 2:17
Henry Minute14-May-09 2:17 
QuestionBug with between sql command Pin
yueru14-May-09 0:02
yueru14-May-09 0:02 
AnswerRe: Bug with between sql command Pin
Rob Philpott14-May-09 0:10
Rob Philpott14-May-09 0:10 
GeneralRe: Bug with between sql command Pin
yueru14-May-09 3:25
yueru14-May-09 3:25 
GeneralRe: Bug with between sql command Pin
PIEBALDconsult14-May-09 3:51
mvePIEBALDconsult14-May-09 3:51 
GeneralRe: Bug with between sql command Pin
yueru14-May-09 5:04
yueru14-May-09 5:04 
Actully I've get the code but it 's too longgg
private void button4_Click(object sender, EventArgs e)
      {



          sql_con = new SQLiteConnection("Data Source= " + info + ".db;Version=3;New=False;Compress=True;");
          sql_con.Open();
          sql_cmd = sql_con.CreateCommand();
          if ((radioButton1.Checked == true))
          {
              if (textBox10.Text != "")
              {
                  if (textBox7.Text != "")
                  {
                      string CommandText = "select * from  par where  Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' and Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'and Duration >= " + textBox10.Text + " ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
                  else
                  {
                      string CommandText = "select * from  par where Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'and Duration >= " + textBox10.Text + " ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
              }
              else
              {
                  if (textBox7.Text != "")
                  {
                      string CommandText = "select * from  par where  Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' and Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%' ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
                  else
                  {
                      string CommandText = "select * from  par where  Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%' ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }

              }
          }
          else if ((radioButton2.Checked == true))
          {
              if (textBox10.Text != "")
              {
                  if (textBox7.Text != "")
                  {
                      string CommandText = "select * from  par where  Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' and Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'and Duration <= " + textBox10.Text + " ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
                  else
                  {
                      string CommandText = "select * from  par where Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'and Duration <= " + textBox10.Text + " ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
              }
              else
              {
                  if (textBox7.Text != "")
                  {
                      string CommandText = "select * from  par where  Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' and Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%' ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
                  else
                  {
                      string CommandText = "select * from  par where  Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%' ;";
                      DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                      DS.Reset();
                      DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                      DT = DS.Tables[0];
                      dataGridView1.DataSource = DT;
                      int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                      textBox12.Text = rowCount.ToString();
                      sql_con.Close();
                      MessageBox.Show("OK");
                  }
              }
          }
          else
          {
              if (textBox7.Text != "")
              {
                  string CommandText = "select * from  par where  Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'   and Time between '" + textBox7.Text + "%' and '" + textBox13.Text + "%' ;";
                  DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                  DS.Reset();
                  DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                  DT = DS.Tables[0];
                  dataGridView1.DataSource = DT;
                  int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                  textBox12.Text = rowCount.ToString();
                  sql_con.Close();
                  MessageBox.Show("OK");
              }
              else
              {
                  string CommandText = "select * from  par where  Date like '" + textBox6.Text + "%'  and Linein like'" + textBox8.Text + "%' and Lineout like '" + textBox9.Text + "%'  ;";
                  DB = new SQLiteDataAdapter(CommandText, sql_con);//นำข้อมูลออกมา
                  DS.Reset();
                  DB.Fill(DS);//นาม ข้อมูลปายส่ายนาย ดาต้าเซด
                  DT = DS.Tables[0];
                  dataGridView1.DataSource = DT;
                  int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count;
                  textBox12.Text = rowCount.ToString();
                  sql_con.Close();
                  MessageBox.Show("OK");
              }

          }
      }

QuestionConvert .Ps to .pdf Pin
Member 339495914-May-09 0:01
Member 339495914-May-09 0:01 
QuestionFile.Move throws exception Pin
Casper Hansen13-May-09 23:42
Casper Hansen13-May-09 23:42 
AnswerRe: File.Move throws exception Pin
Simon P Stevens14-May-09 0:27
Simon P Stevens14-May-09 0:27 
GeneralRe: File.Move throws exception Pin
Casper Hansen14-May-09 0:50
Casper Hansen14-May-09 0:50 
GeneralRe: File.Move throws exception Pin
Simon P Stevens14-May-09 1:00
Simon P Stevens14-May-09 1:00 
Questionhow to monitor user idle time from inside a application Pin
indradeep das13-May-09 23:38
indradeep das13-May-09 23:38 
AnswerRe: how to monitor user idle time from inside a application Pin
DaveyM6914-May-09 2:50
professionalDaveyM6914-May-09 2:50 
AnswerRe: how to monitor user idle time from inside a application Pin
PIEBALDconsult14-May-09 4:01
mvePIEBALDconsult14-May-09 4:01 
Questionwhat is the size of reference variable Pin
Mogaambo13-May-09 23:14
Mogaambo13-May-09 23:14 
JokeRe: what is the size of reference variable Pin
Mycroft Holmes13-May-09 23:16
professionalMycroft Holmes13-May-09 23:16 
GeneralRe: what is the size of reference variable Pin
Mogaambo13-May-09 23:29
Mogaambo13-May-09 23:29 
GeneralRe: what is the size of reference variable Pin
Pete O'Hanlon14-May-09 2:17
mvePete O'Hanlon14-May-09 2:17 
AnswerRe: what is the size of reference variable Pin
Rob Philpott14-May-09 0:19
Rob Philpott14-May-09 0:19 
GeneralRe: what is the size of reference variable Pin
Luc Pattyn14-May-09 0:42
sitebuilderLuc Pattyn14-May-09 0:42 
GeneralRe: what is the size of reference variable Pin
Rob Philpott14-May-09 0:44
Rob Philpott14-May-09 0:44 
GeneralRe: what is the size of reference variable Pin
Rob Philpott14-May-09 0:49
Rob Philpott14-May-09 0:49 
GeneralRe: what is the size of reference variable Pin
Luc Pattyn14-May-09 1:55
sitebuilderLuc Pattyn14-May-09 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.