How to add more than one value in a Same datafield
I have two comboboxes One MonthCombobox(cmbMonth) and YearCombobox(cmbYear) and the Table Name is Calender in that i have one datafield that is version. my Question is How to add these two combobox Selected values in one datafield of Version.
anitha rPosted Mar 11, 2011, 5:55 AM
anitha rPosted Mar 10, 2011, 2:15 AM
anitha rPosted Mar 10, 2011, 2:12 AM
Suthish NairPosted Mar 9, 2011, 8:40 AM
Krishna GaradPosted Mar 9, 2011, 7:08 AM
magazine.MAG_EDITION = cmbMonth.SelectedItem.ToString() + "-" + cmbYear.SelectedItem.ToString();
replace it like
magazine.MAG_EDITION = cmbMonth.SelectedText.ToString() + "-" + cmbYear.SelectedText.ToString();
But I think it's not compiletime error it's the runtime error only.
anitha rPosted Mar 9, 2011, 6:44 AM
I tried Your Given Code it shows error as SilverlightUnhandledError...am using the following code for add datas to database
private void btnSave_Click(object sender, RoutedEventArgs e)
{
MAGAZINE magazine = new MAGAZINE()
magazine.MAG_ID = Int32.Parse(txtMagazineId.Text);
//magazine.MAG_EDITION = textBox1.Text;
magazine.MAG_EDITION = cmbMonth.SelectedItem.ToString() + "-" + cmbYear.SelectedItem.ToString();
magazine.MAG_DESCRIPTION = txtDescription.Text;
magazine.MAG_UPBY = Int32.Parse(txtUpdatedby.Text);
magazine.MAG_UPDATE = DateTime.Parse(txtupdatedate.Text);
magazine.MAG_FILE =System.Text.Encoding.UTF8.GetBytes(txtBook.Text);
magazine.MAG_IMAGE = System.Text.Encoding.UTF8.GetBytes(txtCover.Text);
magazine.MAG_ACTIVE = true;
objectcontext.MAGAZINEs.Add(magazine);
objectcontext.SubmitChanges(SubmitOperation_Callback,null);
clearform();
}
In this am using this( magazine.MAG_EDITION = cmbMonth.SelectedItem.ToString() + "-" + cmbYear.SelectedItem.ToString();) for add combobox
Krishna GaradPosted Mar 9, 2011, 6:15 AM
string value=cmbMonth.SelectedItem.Text.ToString()+"-"+cmbYear.SelectedItem.
Text.ToString();
noe insert this value in that version field.
Suthish NairPosted Mar 9, 2011, 6:15 AM