Jump to content

C# Veritabanından Tarih Saat Bilgisini Okuma


lamont
 Share

Recommended Posts

Arkadaşlar Tarih Saat Bilgisini SQL Serverden Aaşgıdaki Gibi Okuyamıyorum Bunu Nasıl Okuyabilrim Ve Bir Değişkene Atabilirim ?

 

 DateTime t1;
 
        public DateTime tarihsaat()
        {
            using (SqlCommand trh = new SqlCommand("select Tarih from MasaSiparisleri Tarih where MasaNo=@t and  Durum=1 ", bag.baglan()))
            {
                trh.Connection.Open();
                trh.Parameters.Add("@t", say);
 
                SqlDataReader oku = trh.ExecuteReader();
                while (oku.Read())
                {
 
                    t1= Convert.ToDateTime(oku["Tarih"]);
             
                }
 
               
            }
            return tarihsaat();
        }
        
 
        public void KalanSure()
        {
           
 
        }
Link to comment
Share on other sites

ama stored procedure return sadece integer veri döndürür, select ile alman lazım tarihi.

cmd.ExecuteNonQuery();
if (cmd.Parameters["@t"].Value == DBNull.Value)      
    return (DateTime)cmd.Parameters["@t"].Value;
else
    return DateTime.Now;
Edited by muratboy31
Link to comment
Share on other sites

evet benim dediklerimi zaten biliyormuşsun sen o yüzden sildim. aslında konuyu açanın @muratboy31 olduğunu zannetmiştim ve o yüzden yazmıştım. senin olduğunu bilsem hiç yazmazdım kardeş. biz seninle anlaşamıyoruz.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...