PDA

View Full Version : مشکل در خروجی گرفتن از یکی از جداول بانک



نیما حتمی
یک شنبه 21 فروردین 1390, 12:45 عصر
با سلام

بنده بر حسب نیاز ،نیاز دارم که از جدول موجود در بانکم سه نوع داده بکشم بیرون که ارور زیر رو می ده
68535و اینم کدش:
[
SqlDataAdapter selectfromsetcoding = new SqlDataAdapter("select AccTitle as N1 from AccCoding where acccode < '" + s + "' and AccLevel='کل' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding2 = new SqlDataAdapter("select AccTitle as N2 from AccCoding where acccode < '" + s + "' and AccLevel='معین' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding3 = new SqlDataAdapter("select AccTitle as N3 from AccCoding where acccode = '" + s + "' and AccLevel='تفضیلی' ORDER BY Acccode DESC", connect);
DataTable y = new DataTable();
DataTable y1 = new DataTable();
DataTable y2 = new DataTable();
selectfromsetcoding.Fill(y);
selectfromsetcoding2.Fill(y1);
selectfromsetcoding3.Fill(y2);
if (y.Rows.Count > 0)
{
AllSetting.KolAccount = y.Rows[0]["N1"].ToString();
AllSetting.Save();

}
if (y1.Rows.Count > 0)
{
AllSetting.MoeinAccount = y.Rows[0]["N2"].ToString();
AllSetting.Save();
}
if (y2.Rows.Count > 0)
{
AllSetting.TafziliAccount = y.Rows[0]["N3"].ToString();
AllSetting.Save();
}

ehsanara
یک شنبه 21 فروردین 1390, 13:46 عصر
N2 و N3 رو داری با Y پر میکنی
باید با Y1 یا Y2 باشه

نیما حتمی
یک شنبه 21 فروردین 1390, 13:51 عصر
دوست عزیز کد بالا رو با دقت ببین

نیما حتمی
یک شنبه 21 فروردین 1390, 13:54 عصر
آخ آخ سوتی خودم بود بچه ها حل شد مشکلم ممنونم از همه