25 EKİM 2010, PAZARTESİ
SqlDataReader okunan veri
SQL Server 2008 veritabanı arka ucu olarak çalışıyorum. Üzerinde çalışıyorum asp.net/C#
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
//how do I read strings here????
}
Okuyucu değerler olduğunu biliyorum. SQL komutu tablodan sadece 1 sütunu seçin. Sütun YALNIZCA dizeleri içerir. Bir okuyucu bir dize (satır) okumak istiyorum. Bunu nasıl yapabilirim?
CEVAP
25 EKİM 2010, PAZARTESİ
using(SqlDataReader rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
var myString = rdr.GetString(0); //The 0 stands for "the 0'th column", so the first column of the result.
// Do somthing with this rows string, for example to put them in to a list
listDeclaredElsewhere.Add(myString);
}
}
Bunu Paylaş:
JavaScript yapıştırın olay (Çapraz tar...
Veri listesi dönüştürme bir veri içine...
Nasıl Listesi< ekleyebilir miyim;? S...
Java uygulaması para için kullanılacak...
Nasıl setuptools ile paket veri dahil ...