2 Replies - 3081 Views - Last Post: 27 March 2009 - 11:18 PM Rate Topic: -----

#1 oasisjoel  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 274
  • Joined: 11-September 08

Adding A Column To Table

Posted 25 March 2009 - 08:46 PM

Help, I want to add a new column in my table by pressing a button, When I press the button for the process for the 1st time it worked but when I press again it told me that the "ReferencePeriod" already existed. What can I do? I tried the tables[0].columns.clear() but it doesnt allow me to add a table after clearing it

	DataSet resultData = new DataSet();
				DataSet resultAccountList = new DataSet();
				resultAccountList = Helpers.Common.GetAccountList(_billingSystem);
				resultData = Helpers.Common.GetAccountList(_billingSystem);
				resultData.Tables[0].Columns.Add("ReferencePeriod");
				resultData.Tables[0].Columns.Add("BillingStartDate");
				resultData.Tables[0].Columns.Add("BillingEndDate");
				resultData.Tables[0].Columns.Add("DueDate");
				resultData.Tables[0].Columns.Add("BillingAmount");
				resultData.Tables[0].Columns.Add("ResultCode");
				resultData.Tables[0].Columns.Add("ErrorInfo"); 


Is This A Good Question/Topic? 0
  • +

Replies To: Adding A Column To Table

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: Adding A Column To Table

Posted 27 March 2009 - 03:38 AM

are you trying to add all of the columns again? why? If the columns are already there, there is no reason to add them again. Simply write one line of code to add one new column.
Was This Post Helpful? 0
  • +
  • -

#3 oasisjoel  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 274
  • Joined: 11-September 08

Re: Adding A Column To Table

Posted 27 March 2009 - 11:18 PM

sorry but solved it.. I tried to cache the dataset that im getting from my database
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1