shirin_h
یک شنبه 02 دی 1386, 23:36 عصر
سلام :لبخندساده:
کدی که نوشتم وقتی در قسمت if تکست bind شده به combobox با رشته "زبان" مقایسه می شه جواب می ده ولی وقتی با رشته "انفورماتیک" یا "مدیریت" مقایسه می شه اتفاقی نمی افته و چون تمامی راههای ممکن رو امتحان کردم حدس می زنم که اشکال باید از تفاوت font های پایگاه دادم و متن کدی که در vs می نویسم باشه
لطفآ راهنماییم کنین که چه کار باید بکنم.
مرسی
this.comboBox5.DataBindings.Add("Text", this.dviewmanager, "student.گروه_آموزشی");
if (comboBox5.Text == "زبان")
{
comtxtC1 = "select * from english;";
da = newSqlDataAdapter(comtxtC1, conn);
ds = newDataSet();
da.TableMappings.Add("Table", "english");
da.Fill(ds);
conn.Close();
this.textBox15.DataBindings.Clear();
this.textBox19.DataBindings.Clear();
this.dviewmanager = ds.DefaultViewManager;
this.comboBox1.DataSource = this.dviewmanager;
this.comboBox1.ValueMember = "english.نام_دوره";
this.textBox15.DataBindings.Add("Text", this.dviewmanager, "english.کد_دوره");
this.textBox19.DataBindings.Add("Text", this.dviewmanager, "english.گروه_درسی");
}
elseif (comboBox5.Text =="انفورماتیک")
{
comtxtC1 = "select * from anformatic;";
da = newSqlDataAdapter(comtxtC1, conn);
ds = newDataSet();
da.TableMappings.Add("Table", "anformatic");
da.Fill(ds);
conn.Close();
this.textBox15.DataBindings.Clear();
this.textBox19.DataBindings.Clear();
this.dviewmanager = ds.DefaultViewManager;
this.comboBox1.DataSource = this.dviewmanager;
this.comboBox1.ValueMember = "anformatic.نام_دوره";
this.textBox15.DataBindings.Add("Text", this.dviewmanager, "anformatic.کد_دوره");
this.textBox19.DataBindings.Add("Text", this.dviewmanager, "anformatic.گروه_درسی");
}
در ضمن موقع کد نویسی (فقط در قسمت کد ونه در design برنامه) برخی کاراکتر ها مثل چ یا پ یا گ یا ژ بصورت ... می افتند.
چه کار باید بکنم؟:عصبانی++:
کدی که نوشتم وقتی در قسمت if تکست bind شده به combobox با رشته "زبان" مقایسه می شه جواب می ده ولی وقتی با رشته "انفورماتیک" یا "مدیریت" مقایسه می شه اتفاقی نمی افته و چون تمامی راههای ممکن رو امتحان کردم حدس می زنم که اشکال باید از تفاوت font های پایگاه دادم و متن کدی که در vs می نویسم باشه
لطفآ راهنماییم کنین که چه کار باید بکنم.
مرسی
this.comboBox5.DataBindings.Add("Text", this.dviewmanager, "student.گروه_آموزشی");
if (comboBox5.Text == "زبان")
{
comtxtC1 = "select * from english;";
da = newSqlDataAdapter(comtxtC1, conn);
ds = newDataSet();
da.TableMappings.Add("Table", "english");
da.Fill(ds);
conn.Close();
this.textBox15.DataBindings.Clear();
this.textBox19.DataBindings.Clear();
this.dviewmanager = ds.DefaultViewManager;
this.comboBox1.DataSource = this.dviewmanager;
this.comboBox1.ValueMember = "english.نام_دوره";
this.textBox15.DataBindings.Add("Text", this.dviewmanager, "english.کد_دوره");
this.textBox19.DataBindings.Add("Text", this.dviewmanager, "english.گروه_درسی");
}
elseif (comboBox5.Text =="انفورماتیک")
{
comtxtC1 = "select * from anformatic;";
da = newSqlDataAdapter(comtxtC1, conn);
ds = newDataSet();
da.TableMappings.Add("Table", "anformatic");
da.Fill(ds);
conn.Close();
this.textBox15.DataBindings.Clear();
this.textBox19.DataBindings.Clear();
this.dviewmanager = ds.DefaultViewManager;
this.comboBox1.DataSource = this.dviewmanager;
this.comboBox1.ValueMember = "anformatic.نام_دوره";
this.textBox15.DataBindings.Add("Text", this.dviewmanager, "anformatic.کد_دوره");
this.textBox19.DataBindings.Add("Text", this.dviewmanager, "anformatic.گروه_درسی");
}
در ضمن موقع کد نویسی (فقط در قسمت کد ونه در design برنامه) برخی کاراکتر ها مثل چ یا پ یا گ یا ژ بصورت ... می افتند.
چه کار باید بکنم؟:عصبانی++: