473,811 Members | 3,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding local varialbes - String?

I have a DataTable:-
private void CreateForm(Data Table dt, string headerText)
{
}

string formTitle = tbxFormTitle.Te xt;
string formNotes = tbxFormnotes.Te xt;
DataTable dtForm = GetDataTable(fo rmSql);

And i'm calling 2 local variable
dtForm,formTitl e

Like so
CreateForm(dtFo rm,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 980
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(Data Table dt, string headerText)
{
}

string formTitle = tbxFormTitle.Te xt;
string formNotes = tbxFormnotes.Te xt;
DataTable dtForm = GetDataTable(fo rmSql);

And i'm calling 2 local variable
dtForm,formTitl e

Like so
CreateForm(dtFo rm,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(Data Table dt, string headerText, string headerNotes)
{
}

and make a call like this:
CreateForm(dtFo rm,formTitle,fo rmNotes);

Sample for string concatenation:

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

and in the method do this way:

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

if(headerText.L ength > headerText.Inde xOf("#") + 1)
formNotes = headerText.Subs tring(headerTex t.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
1278
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 = GetDataTable(formSql); And i'm calling 2 local variable
47
3376
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 are objects whose representation within the code is more important than their actual value. Two symbols needs only to be
3
13181
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 local Administrator (so they should have sufficient permissions). Would any one out there know how to programmatically add a local user to a local group in C#? TIA
10
2209
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 has string value. I really do not understand why push_back() function is trying to remove previously inserted data. Thanks for any help
0
9604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.