Click here to Skip to main content
15,907,392 members
Home / Discussions / C#
   

C#

 
GeneralRe: hiding listview items Pin
Mundo Cani5-Mar-07 17:16
Mundo Cani5-Mar-07 17:16 
GeneralRe: hiding listview items Pin
Glen Harvy5-Mar-07 17:27
Glen Harvy5-Mar-07 17:27 
GeneralRe: hiding listview items Pin
Keshav V. Kamat5-Mar-07 17:24
Keshav V. Kamat5-Mar-07 17:24 
AnswerRe: hiding listview items Pin
Mundo Cani5-Mar-07 17:09
Mundo Cani5-Mar-07 17:09 
GeneralRe: hiding listview items Pin
Keshav V. Kamat5-Mar-07 17:22
Keshav V. Kamat5-Mar-07 17:22 
QuestionRetrieving values from DataTable Pin
myNameIsRon5-Mar-07 15:49
myNameIsRon5-Mar-07 15:49 
AnswerRe: Retrieving values from DataTable Pin
Glen Harvy5-Mar-07 16:13
Glen Harvy5-Mar-07 16:13 
GeneralRe: Retrieving values from DataTable Pin
myNameIsRon6-Mar-07 18:56
myNameIsRon6-Mar-07 18:56 
QuestionCollision Detection in DirectX Pin
Koocurrent5-Mar-07 14:33
Koocurrent5-Mar-07 14:33 
QuestionObject cannot be cast from DBNull to other types Pin
ujupanmester5-Mar-07 13:07
ujupanmester5-Mar-07 13:07 
AnswerRe: Object cannot be cast from DBNull to other types Pin
Colin Angus Mackay5-Mar-07 13:48
Colin Angus Mackay5-Mar-07 13:48 
AnswerRe: Object cannot be cast from DBNull to other types Pin
Glen Harvy5-Mar-07 16:04
Glen Harvy5-Mar-07 16:04 
AnswerRe: Object cannot be cast from DBNull to other types Pin
sam#5-Mar-07 18:27
sam#5-Mar-07 18:27 
GeneralRe: Object cannot be cast from DBNull to other types Pin
ujupanmester6-Mar-07 9:34
ujupanmester6-Mar-07 9:34 
GeneralRe: Object cannot be cast from DBNull to other types Pin
ujupanmester6-Mar-07 9:54
ujupanmester6-Mar-07 9:54 
Questionsimple radio button question Pin
dino20945-Mar-07 13:00
dino20945-Mar-07 13:00 
AnswerRe: simple radio button question Pin
Luc Pattyn5-Mar-07 13:21
sitebuilderLuc Pattyn5-Mar-07 13:21 
AnswerRe: simple radio button question Pin
Koocurrent5-Mar-07 15:02
Koocurrent5-Mar-07 15:02 
AnswerRe: simple radio button question Pin
engsrini5-Mar-07 18:42
engsrini5-Mar-07 18:42 
QuestionWindows Service Pin
Darkness845-Mar-07 12:41
Darkness845-Mar-07 12:41 
AnswerRe: Windows Service Pin
Luc Pattyn5-Mar-07 13:22
sitebuilderLuc Pattyn5-Mar-07 13:22 
QuestionTo activate flash or real player plug Ins in widgets Pin
mikkasava5-Mar-07 12:05
mikkasava5-Mar-07 12:05 
QuestionOpton to re-use code Pin
Glen Harvy5-Mar-07 11:53
Glen Harvy5-Mar-07 11:53 
Hi.

I have several datatables that each have the same structure. They represent individual bank accounts.

When the user selects the bank account and then saves the transaction I use the following code:

      if (cbPayBillsWhichAccount.Text == "Administration Fund")<br />
      {<br />
        try<br />
        {<br />
          mybodycorpDataSet.AdminFundRow newRow = this.mybodycorpDataSet.AdminFund.NewAdminFundRow();<br />
<br />
          if (this.dtpPayBillsTransactionDate.Text == string.Empty)<br />
          {<br />
            newRow.Date = DateTime.Today;<br />
          }<br />
          else<br />
          {<br />
            newRow.Date = Convert.ToDateTime(this.dtpPayBillsTransactionDate.Text);<br />
          }<br />
<br />
          newRow.Debit = true;<br />
          newRow.ChequeNumber = this.tbPayBillsChequeNumber.Text.ToString();<br />
          newRow.Payee = paySupplierName;<br />
          newRow.Amount = Convert.ToDecimal(tbPayBillsHowMuch.Text);<br />
          newRow.Reconciled = false;<br />
<br />
          this.mybodycorpDataSet.AdminFund.Rows.Add(newRow);<br />
          this.adminFundTableAdapter.Update(mybodycorpDataSet.AdminFund);<br />
        }


What I wish to do is re-use the code (essentially all the "newRow" lines) as ammended for each chosen bank account.

How would you suggest I go about this?



Glen Harvy

QuestionIs it better to use args to return values or function type? Pin
BRShroyer5-Mar-07 11:13
BRShroyer5-Mar-07 11:13 
AnswerRe: Is it better to use args to return values or function type? Pin
led mike5-Mar-07 11:38
led mike5-Mar-07 11:38 

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.