コード例 #1
0
        public List <Mudur> Listele1(string a, string b, string c)
        {
            try
            {
                List <Mudur> Mudurcikti = new List <Mudur>();
                cmd.CommandText = "select* from müdürf('" + a + "','" + b + "','" + c + "')";
                cmd.CommandType = CommandType.Text;
                con.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    Mudur s = new Mudur();

                    s.Tarih     = reader[0].ToString();
                    s.Adisoyadi = reader[1].ToString();
                    s.Girisaati = reader[2].ToString();
                    Mudurcikti.Add(s);
                }

                return(Mudurcikti);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (con != null)
                {
                    con.Close();
                }
            }
        }
コード例 #2
0
 public void Ekle(Mudur p)
 {
     try
     {
         cmd.CommandText = "INSERT INTO Mudur (Tarih,Adisoyadi,Girisaati) VALUES('" + p.Tarih + "','" + p.Adisoyadi + "','" + p.Girisaati + "')";
         cmd.CommandType = CommandType.Text;
         con.Open();
         cmd.ExecuteNonQuery();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
     finally
     {
         if (con != null)
         {
             con.Close();
         }
     }
 }