lolaley

mail@pastecode.io avatar
unknown
csharp
2 years ago
782 B
3
Indexable
Never
public DateTime DonenVeriGetirTarih()
        {
            DateTime res = new DateTime();

            sqlConnection.Open();

            try
            {
                SqlCommand sqlCommand = new SqlCommand("spDonenVeriGetirTarih", sqlConnection)
                {
                    CommandType = CommandType.StoredProcedure
                };

                SqlDataReader reader = sqlCommand.ExecuteReader();

                while (reader.Read())
                {
                    res = (DateTime) reader["ReadTime"];
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Hata: " + ex.Message);
            }

            sqlConnection.Close();

            return res;
        }