Click here to Skip to main content
15,890,897 members
Home / Discussions / C#
   

C#

 
QuestionC# web service Pin
Chazzysb15-Sep-09 8:09
Chazzysb15-Sep-09 8:09 
AnswerRe: C# web service Pin
Christian Graus15-Sep-09 10:17
protectorChristian Graus15-Sep-09 10:17 
AnswerRe: C# web service Pin
carlecomm21-Sep-09 22:07
carlecomm21-Sep-09 22:07 
QuestionSystem Blocked using ThreadPool Pin
FJJCENTU15-Sep-09 7:36
FJJCENTU15-Sep-09 7:36 
AnswerRe: System Blocked using ThreadPool Pin
Luc Pattyn15-Sep-09 8:10
sitebuilderLuc Pattyn15-Sep-09 8:10 
AnswerRe: System Blocked using ThreadPool Pin
FJJCENTU15-Sep-09 12:39
FJJCENTU15-Sep-09 12:39 
GeneralRe: System Blocked using ThreadPool Pin
Luc Pattyn15-Sep-09 14:34
sitebuilderLuc Pattyn15-Sep-09 14:34 
QuestionHierarchical Update Problem. Pin
hdv21215-Sep-09 7:17
hdv21215-Sep-09 7:17 
Hi i have 2 tables :
Persons (master)
Images (detail)
each person can multiple images. i'm using tableAdapterManager to accomplish this and here is my code in my DataManager class :

public bool SavePersonWithImages(MyDataSet DataSet)
{
           bool saved = false;

           if (DataSet.GetChanges() != null)
           {
               try
               {
                   MyDataSetTableAdapters.PersonsTableAdapter personAdapter = new MyDataSetTableAdapters.PersonsTableAdapter();
                   MyDataSetTableAdapters.ImagesTableAdapter imageAdapter = new MyDataSetTableAdapters.ImagesTableAdapter();
                   MyDataSetTableAdapters.TableAdapterManager manager = new MyDataSetTableAdapters.TableAdapterManager();

                   manager.PersonsTableAdapter = personAdapter;
                   manager.ImagesTableAdapter = imageAdapter;
                   int rowAffected = manager.UpdateAll(DataSet);
                   saved = (rowAffected > 0);
                   DataSet.AcceptChanges();
                }
               catch (Exception ex)
               {
                   MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                   DataSet.RejectChanges();
               }

           }
           return saved;
}


the insert & delete works fine, but my problem when user edit the image with replace that image with new one, it's works successfully, but when i close the form and open it again, it's don't display image! here is my edit button code :

private void barBtnEditPerson_ItemClick(object sender, ItemClickEventArgs e)
{
            if (this.personBindingSource.Count > 0)
            {
                MyDataSet.PersonRow personCurRow = (MyDataSet.PersonRow)((DataRowView)this.personBindingSource.Current).Row;
                FrmZamin frm = new FrmZamin(personCurRow, this.amlakDataSet);
                personCurRow.BeginEdit();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    this._frmLoading = new FrmWait("Saving data ...");
                    personCurRow.EndEdit();
                    DataManager dm = new DataManager();
                    dm.SavePersonWithImages(this.myDataSet);
                    this._frmLoading.Close();
                    this.backgroundWorker1.RunWorkerAsync();
                }
                else
                {
                    personCurRow.CancelEdit();
                }
              this.myDataSet.Images.Clear();
            }
}


can anybody know where does my problem and how to solve it ?
Note 1 : my database is access 2007
Note 2 : my images dataTable does not have any relation with persons dataTable or some other tables (in my DataSet Designer)

thanks in advance
QuestionAddign a new item to a ComboBox Pin
Etienne_12315-Sep-09 7:07
Etienne_12315-Sep-09 7:07 
AnswerRe: Addign a new item to a ComboBox Pin
Wes Aday15-Sep-09 8:05
professionalWes Aday15-Sep-09 8:05 
QuestionRecord RTSP live video from ip camera Pin
Emiliano15-Sep-09 6:21
Emiliano15-Sep-09 6:21 
QuestionHow to show only 2 decimal points when using a double Pin
Etienne_12315-Sep-09 4:29
Etienne_12315-Sep-09 4:29 
AnswerRe: How to show only 2 decimal points when using a double Pin
musefan15-Sep-09 4:35
musefan15-Sep-09 4:35 
AnswerRe: How to show only 2 decimal points when using a double Pin
Greg Chelstowski15-Sep-09 4:36
Greg Chelstowski15-Sep-09 4:36 
AnswerRe: How to show only 2 decimal points when using a double Pin
Luc Pattyn15-Sep-09 4:37
sitebuilderLuc Pattyn15-Sep-09 4:37 
AnswerRe: How to show only 2 decimal points when using a double Pin
Etienne_12315-Sep-09 4:40
Etienne_12315-Sep-09 4:40 
GeneralRe: How to show only 2 decimal points when using a double Pin
musefan15-Sep-09 4:55
musefan15-Sep-09 4:55 
AnswerRe: How to show only 2 decimal points when using a double Pin
0x3c015-Sep-09 5:32
0x3c015-Sep-09 5:32 
GeneralRe: How to show only 2 decimal points when using a double Pin
J4amieC15-Sep-09 5:46
J4amieC15-Sep-09 5:46 
GeneralRe: How to show only 2 decimal points when using a double Pin
0x3c015-Sep-09 5:51
0x3c015-Sep-09 5:51 
AnswerRe: How to show only 2 decimal points when using a double Pin
OriginalGriff15-Sep-09 6:24
mveOriginalGriff15-Sep-09 6:24 
GeneralRe: How to show only 2 decimal points when using a double Pin
0x3c015-Sep-09 6:55
0x3c015-Sep-09 6:55 
GeneralRe: How to show only 2 decimal points when using a double Pin
OriginalGriff15-Sep-09 8:31
mveOriginalGriff15-Sep-09 8:31 
Questionhow to access and run method from main form without creating a new object instance of the form? Pin
stan_lee2615-Sep-09 3:34
stan_lee2615-Sep-09 3:34 
AnswerRe: how to access and run method from main form without creating a new object instance of the form? Pin
Keith Barrow15-Sep-09 4:18
professionalKeith Barrow15-Sep-09 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.