473,387 Members | 1,512 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,387 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 19 '05 #1
3 968
Either you can overload the CreateForm method to have one more parameter or
you can use string concatenation and add the thrid string with the second
string iteself seprated with and character(say #) and in the CreateForm
method you can again seprate back the two strings.

Hope this helps.

"Patrick Olurotimi Ige" wrote:
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 19 '05 #2
Hitesh..
Can you post me a sample!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #3
Sample for the override method:
private void CreateForm(DataTable dt, string headerText, string headerNotes)
{
}

and make a call like this:
CreateForm(dtForm,formTitle,formNotes);

Sample for string concatenation:

formTitle += "#" + formNotes;
call in the same way as you are doing
CreateForm(dtForm,formTitle)

and in the method do this way:

private void CreateForm(DataTable dt, string headerText)
{
string formNotes = "';
//some verification here like whether there is any text after the # in the
headerText variable

if(headerText.Length > headerText.IndexOf("#") + 1)
formNotes = headerText.Substring(headerText.IndexOf("#")+1);

//do the normal processing here
}


"Patrick Olurotimi Ige" wrote:
Hitesh..
Can you post me a sample!

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #4

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

Similar topics

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...
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.