PC Review


Reply
Thread Tools Rate Thread

adding local varialbes - String?

 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      1st Apr 2005
I have a DataTable:-
private void CreateForm(DataTable dt, string headerText)
{
}

string formTitle = tbxFormTitle.Text;
string formNotes = tbxFormnotes.Text;
DataTable dtForm = GetDataTable(formSql);

And i'm calling 2 local variable
dtForm,formTitle

Like so
CreateForm(dtForm,formTitle);
How can i add a 3rd one for example the string formNotes?



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Mohammad
Guest
Posts: n/a
 
      1st Apr 2005
Patrick, this question highly malformed to me. Could you explain it a
little bit better?

 
Reply With Quote
 
Morten Wennevik
Guest
Posts: n/a
 
      1st Apr 2005
Hi Patrick,

If I understand your question correctly you need to overload your
CreateForm method.

Put all code from your current CreateForm() into the new version and call
it using a default parameter.

private void CreateForm(DataTable dt, string headerText)
{
CreateForm(dt, headerText, "Default Title");
}

private void Createform(DataTable dt, string headerText, string titleText)
{
// Put all code from CreateForm(DataTable, String) here
}

....

CreateForm(dtForm,formTitle);
CreateForm(dtForm,formTitle, formNotes);

Both will work.


--
Happy Coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      1st Apr 2005
Thx Morten for the reply..
Thats exactly what i want to do to overload my method!!!
I will try ur advice and if i have any related questions will let u
know.
Thx



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding local user to local group or deleting local user fkitzmann Microsoft Windows 2000 4 16th Feb 2008 03:02 AM
varialbes look very big in two columns format Mike C Liu Microsoft Word Document Management 4 9th Aug 2006 01:00 AM
adding local varialbes - String? Patrick Olurotimi Ige Microsoft ASP .NET 3 1st Apr 2005 06:59 AM
Using Environment Varialbes in the URL? =?Utf-8?B?TXVueXVs?= Windows XP Internet Explorer 0 22nd Oct 2004 03:43 PM
unbound varialbes error Nguyen Microsoft ADO .NET 0 15th Mar 2004 10:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:44 AM.