المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : New Record in New Form problem.



C# Programming
05-09-2009, 10:05 AM
Hi
I'm writing a db app with the following features :

1. have a list of items (FormReportItems)
2. for new Item and edit Item, the new form open (FormItem)
3. the new item or current item pass to FormItem constructor and return that specific item to update data in form list (FormReportItems), some thing like this :


AppDataSet.SampleTableRow itemNewRow = this.appDataSet.SampleTable.SampleTableRow();

FrmSampleTable frm = new FrmSampleTable(itemNewRow, this.appDataSet);
if (frm.ShowDialog() == DialogResult.OK)
{
this.appDataSet.SampleTable.AddSampleTableRow(itemNewRow);

DataManager dm = new DataManager();
dm.SampleTableWithImages(this.appDataSet);
}

it work correctly while working in relational data.
each item can some images in Images table, hence i must update data with images. my problem is to pass images table to FormItem and get result back to current form (FormReportItems) then update data. for this i've passed current dataSet to FrmSampleTable constructor as second parameter to hold inserted or edited images in FormSampleTable (FormItem), when FormSampleTable returns DialogResult.OK the dataBase must be update to commit changes.

my problem is when i want to pass images dataTable to current dataSet, it does not have any records, wheras in FormSampleTable it have some records.
can anybody help me about this issue ?
what's your idea in Insert & Edit relational data Form ?
thanks