başlık muhtemelen kafa karıştırıcı, ama temelde ben bu çizgisinde bir şey yapmak istiyorum,C# sql sorguları null() else() sonuçlarına göre null?
string sql = "select dataset1 from dbo.ste where project = 'whatever' and date = '11/30/10'";
SqlConnection con = new SqlConnection("Data Source= Watchmen ;Initial Catalog= doeLegalTrending;Integrated Security= SSPI");
con.Open();
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
con.Close();
if(cmd "is not null")
{
//do this string
}
else
{
//do this one
}
besbelli cmd) "boş değil" gerçek değil, ama siz gelin almak düşünüyorum. Eğer var result = cmd.ExecuteScalar();
yapmak ve daha sonra if (result == DBNull.Value)
karşılaştırmak istediğiniz gibi
Neden bir sonuç beklemeden bir seçim yürütmek istiyorsunuz? – flq
Hayır, anlamıyorum. – RPM1984
i mevcut değeri + Bu durumda metin dosyası –