473,394 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

adding local varialbes - String?

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 ***
Nov 17 '05 #1
3 1265
Patrick, this question highly malformed to me. Could you explain it a
little bit better?

Nov 17 '05 #2
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]
Nov 17 '05 #3
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 ***
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carlo | last post by:
I was wondering if someone could help me with this or point me to a good resource. I'm trying to add some attributes to docbook to be used later in effectivity. It was recommended I change the...
4
by: Victor Hadianto | last post by:
Hi, If I have an XmlDocument DOM how do I insert <?mso-application progid="ProgId.Here"?> programmatically? -- Victor Hadianto http://www.synop.com/Products/SauceReader/
3
by: Bart Stes | last post by:
Hey guys, I'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment,...
3
by: Patrick Olurotimi Ige | last post by:
I have a DataTable:- private void CreateForm(DataTable dt, string headerText) { } string formTitle = tbxFormTitle.Text; string formNotes = tbxFormnotes.Text; DataTable dtForm =...
47
by: Pierre Barbier de Reuille | last post by:
Please, note that I am entirely open for every points on this proposal (which I do not dare yet to call PEP). Abstract ======== This proposal suggests to add symbols into Python. Symbols...
4
by: glebur | last post by:
Hi, I'm trying to create a web service client in C# but I get stuck at one of the first steps. When adding a Web reference to the Visual Studio project; I get this error (this is a translation,...
3
by: enilno | last post by:
I'm working on a C# app., and I need to programmatically add a local user to a local group on the computer on which the app. is running. When end-users run this app., they will be logged on as...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
10
by: oktayarslan | last post by:
Hi all; I have a problem when inserting an element to a vector. All I want is reading some data from a file and putting them into a vector. But the program is crashing after pushing a data which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.