  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                Code (VB.NET) 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        strSql = "Delete From CheckChem"
        With Comm
            .CommandText = strSql
            .CommandType = CommandType.Text
            .Connection = Conn
            .ExecuteNonQuery()
        End With
        strSql = "Insert Into CheckChem ( IdChem, Chemquantity2 ) SELECT BringChem.BringChemId, " & _
                "Sum(ChemAmountBring) AS SumOfChemAmountBring From BringChem " & _
                "WHERE(((Month([BringChemDate])) = " & ComboBox1.SelectedIndex + 1 & _
                ") And ((Year([BringChemDate])) = " & Year(Now) - 543 & ")) GROUP BY BringChem.BringChemId"
        [color=yellow]'ช่วยแก้ where ให้ทีครับ
        '"WHERE(((Month([BringChemDate])) = " & ComboBox1.SelectedIndex + 1 & _
        '") And ((Year([BringChemDate])) = " & Year(Now) - 543 & ")) GROUP BY BringChem.BringChemId"
        With Comm
            .CommandText = strSql
            .CommandType = CommandType.Text
            .Connection = Conn
            .ExecuteNonQuery()
        End With
        strSql = "Select Chemical.ChemId AS รหัสสารเคมี, Chemical.ChemName AS ชื่อสารเคมี, " & _
                "Chemical.ChemUnit AS หน่วยนับ, Sum(IIf(IsNull([Chemquantity2]),0,[Chemquantity2])) " & _
                "AS จำนวน From Chemical LEFT JOIN CheckChem ON Chemical.ChemId = " & _
                "CheckChem.IdChem Group By Chemical.ChemId, Chemical.ChemName, " & _
                "Chemical.ChemUnit"
        [color=yellow]'ช่วยแก้ sum ให้ทีครับ
        'Sum(IIf(IsNull([Chemquantity2]),0,[Chemquantity2]))
        DA.SelectCommand.CommandText = strSql
        DA.Fill(DS, "SumChemBring")
        DS.Tables("SumChemBring").Clear()
        DA.Fill(DS, "SumChemBring")
        DataGridView1.DataSource = DS.Tables("SumChemBring")
        DataGridView1.ReadOnly = True
    End Sub
 
 
แล้ว error อันนี้มีความหมายว่าอะไรครับ 
 
 
 
 
  Tag : - - - -              
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2010-01-11 20:33:47 | 
                      By :
                          nuinyzaa | 
                      View :
                          1513 | 
                      Reply :
                          2 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |