473,545 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retaining Last Value in the Text Boxes in VB.NET

How do you retain the last value the user keyed in a text
box? I should be able to show the values when the user
runs the executable for the second time.

Appreciate help.
Suresh
Jul 19 '05 #1
5 2822
Suresh,

See, there is no single "best" option. I could just give some examples on
which way fits best the nature of the application:

a) An "Options" dialog box of a desktop application. Usually settings are
stored in the registry or in a configuration file. Please refer to the
Microsoft.Win32 .Registry class and to the System.Configur ation namespace for
more detailed information and examples.

b) A "Preference s" web page of a Web application. Web applications most
often work with some kind of database and usually store all information
within the database. Please refer to the System.Data namespace documentation
for more info and examples.

c) Customer details in a desktop CRM application. Such complex applications
also usually rely on some kind of database or structured storage.

P.S. In fact, the question you are asking is too "broadband" . I suggest you
are facing a particular problem, and if you would describe things you want
to achieve, I think the community could came up with more detailed advice.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hot mail.com> wrote in message
news:0e******** *************** *****@phx.gbl.. .
Dmitriy,

What would be the best option to do this? Do you have a
sample coding on this?

Thanks in advance,

Suresh


Jul 19 '05 #2
Dmitriy,

Thanks for your reply.

All right, here's what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form
1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as
aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon
form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to
change any other details of the part number other than the
part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh

-----Original Message-----
Suresh,

See, there is no single "best" option. I could just give some examples onwhich way fits best the nature of the application:

a) An "Options" dialog box of a desktop application. Usually settings arestored in the registry or in a configuration file. Please refer to theMicrosoft.Win3 2.Registry class and to the System.Configur ation namespace formore detailed information and examples.

b) A "Preference s" web page of a Web application. Web applications mostoften work with some kind of database and usually store all informationwithin the database. Please refer to the System.Data namespace documentationfor more info and examples.

c) Customer details in a desktop CRM application. Such complex applicationsalso usually rely on some kind of database or structured storage.
P.S. In fact, the question you are asking is too "broadband" . I suggest youare facing a particular problem, and if you would describe things you wantto achieve, I think the community could came up with more detailed advice.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hot mail.com> wrote in message
news:0e******* *************** ******@phx.gbl. ..
Dmitriy,

What would be the best option to do this? Do you have a
sample coding on this?

Thanks in advance,

Suresh


.

Jul 19 '05 #3
Dmitriy,

Thanks for your reply. My choice was a text file too. Just
curious to know how do you code the values to the
registry? Do you have a sample. 'Cos I have not written
any codes before to write to the registry. Also won't the
registry cause a security issue when deploying the project?

Suresh
-----Original Message-----
Suresh,

Now I see. I think registry or a simple text file would be the best choicehere. When the user closes the Form 1, read the text box value and save itto the registry/file with the appropriate Framework classes. And upon Form 1start-up, check whether you have previously stored value and pre-populatethe text box.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hot mail.com> wrote in message
news:1a******* *************** ******@phx.gbl. ..
Dmitriy,

Thanks for your reply.

All right, here's what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form 1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to change any other details of the part number other than the part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh

>-----Original Message-----
>Suresh,
>
>See, there is no single "best" option. I could just give
some examples on
>which way fits best the nature of the application:
>
>a) An "Options" dialog box of a desktop application.

Usually settings are
>stored in the registry or in a configuration file.
Please refer to the
>Microsoft.Win3 2.Registry class and to the

System.Configur ation namespace for
>more detailed information and examples.
>
>b) A "Preference s" web page of a Web application. Web

applications most
>often work with some kind of database and usually store

all information
>within the database. Please refer to the System.Data

namespace documentation
>for more info and examples.
>
>c) Customer details in a desktop CRM application. Such

complex applications
>also usually rely on some kind of database or
structured storage.
>
>P.S. In fact, the question you are asking is

too "broadband" . I suggest you
>are facing a particular problem, and if you would

describe things you want
>to achieve, I think the community could came up with
more detailed advice.
>
>--
>Dmitriy Lapshin [C# / .NET MVP]
>X-Unity Test Studio
>http://x-unity.miik.com.ua/teststudio.aspx
>Bring the power of unit testing to VS .NET IDE
>
>"Suresh Kumaran" <ku********@hot mail.com> wrote in

message >news:0e******* *************** ******@phx.gbl. ..
>> Dmitriy,
>>
>> What would be the best option to do this? Do you have a >> sample coding on this?
>>
>> Thanks in advance,
>>
>> Suresh
>
>.
>


.

Jul 19 '05 #4
"Suresh Kumaran" <ku********@hot mail.com> wrote in news:1a2c01c372 e2
$4************* ***@phx.gbl:
Dmitriy,

Thanks for your reply.

All right, here's what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form
1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as
aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon
form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to
change any other details of the part number other than the
part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh


I wouldn't use a "simple text file". Use an Xml file. Do this the same
way as I descibed in your question about "Most Recent Document".

--
Michael Lang, MCSD
See my .NET open source projects
http://sourceforge.net/projects/colcodegen/ (simple code generator)
http://sourceforge.net/projects/dbobjecter (database app code generator)
http://sourceforge.net/projects/genadonet ("generic" ADO.NET)

Jul 19 '05 #5
No I don't have a sample, but just look at the Microsoft.Win32 .Registry
class documentation in the MSDN - I beleive there are several samples. As
for security issues, your code will need to be granted a RegistryPermiss ion
with appropriate access rights. This is usually not a problem for desktop
applications running on a local machine, though.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hot mail.com> wrote in message
news:1b******** *************** *****@phx.gbl.. .
Dmitriy,

Thanks for your reply. My choice was a text file too. Just
curious to know how do you code the values to the
registry? Do you have a sample. 'Cos I have not written
any codes before to write to the registry. Also won't the
registry cause a security issue when deploying the project?

Suresh
-----Original Message-----
Suresh,

Now I see. I think registry or a simple text file would

be the best choice
here. When the user closes the Form 1, read the text box

value and save it
to the registry/file with the appropriate Framework

classes. And upon Form 1
start-up, check whether you have previously stored value

and pre-populate
the text box.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Suresh Kumaran" <ku********@hot mail.com> wrote in message
news:1a******* *************** ******@phx.gbl. ..
Dmitriy,

Thanks for your reply.

All right, here's what I want. My application is being
developed using VB.NET The design is this.

A. Form 1 designed for user to enter the part number. Form 1 has two buttons "Okay" and "Cancel" If the user
clicks "Okay", a textfile is validated and read for the
details of the partnumber,and the part number is passed as aparameter to form 2.

B. Form 2 shows all other details of the partnumber such
as drawing date, approved date, description etc. These
values are placed on Form 2. Three button are availableon form 2, "SAVE" "CANCEL" "EXIT" The user is allowed to change any other details of the part number other than the part number. User changes any details saves and exit the
application.

The requirement is that, if the user comes back the
application the second time around. I should be able to
show the partnumber he/she was working on in the Form 1.

How do I retain this value and show it?

Hope I have explained.

Suresh
>-----Original Message-----
>Suresh,
>
>See, there is no single "best" option. I could just give some examples on
>which way fits best the nature of the application:
>
>a) An "Options" dialog box of a desktop application.
Usually settings are
>stored in the registry or in a configuration file. Please refer to the
>Microsoft.Win3 2.Registry class and to the
System.Configur ation namespace for
>more detailed information and examples.
>
>b) A "Preference s" web page of a Web application. Web
applications most
>often work with some kind of database and usually store
all information
>within the database. Please refer to the System.Data
namespace documentation
>for more info and examples.
>
>c) Customer details in a desktop CRM application. Such
complex applications
>also usually rely on some kind of database or structured storage.
>
>P.S. In fact, the question you are asking is
too "broadband" . I suggest you
>are facing a particular problem, and if you would
describe things you want
>to achieve, I think the community could came up with more detailed advice.
>
>--
>Dmitriy Lapshin [C# / .NET MVP]
>X-Unity Test Studio
>http://x-unity.miik.com.ua/teststudio.aspx
>Bring the power of unit testing to VS .NET IDE
>
>"Suresh Kumaran" <ku********@hot mail.com> wrote in message >news:0e******* *************** ******@phx.gbl. ..
>> Dmitriy,
>>
>> What would be the best option to do this? Do you have a >> sample coding on this?
>>
>> Thanks in advance,
>>
>> Suresh
>
>.
>


.


Jul 19 '05 #6

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

Similar topics

1
6614
by: cgplays.com | last post by:
I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp that changes the 3rd pulldown (Dbase) depending on what the user enters in the 2nd (Wk). My associate wants the values inside the select box to retain their values after hitting the Go-Submit button when selecting the 3 choices- they want to see the values retained on the...
2
1688
by: JC | last post by:
Hi, I am a novice at .net and have created a page of text boxes that are populated from a database. I want the user to be able to change the values in the box then submit the page and have these value updated to the databse. However, whenever I post the page it is the old values that are posted, not the newly entered ones. I am totally...
10
274
by: Suresh Kumaran | last post by:
How do you retain the last value the user keyed in a text box? I should be able to show the values when the user runs the executable for the second time. Appreciate help. Suresh
5
10502
by: Bill | last post by:
Hello, Could anyone post some simple code or advise me on how I can display the SSN number like *****7890 in a text box, even thought the user entered 1234567890, and the value of the variable would remain the same. Only thing I can think of is, accept the user input load it into a varible, and then just take the last 4 digits of the number...
0
2083
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table id="Table1" GridLines="Both"
2
6300
by: php_Boi | last post by:
i have designed an application that is a dynamic submission form. i have text fields and listboxes. now i am able to retain the values of the listboxes when i populate the listbox "manually"(single listbox) like this... <select name="title"> <option value="1"<?php if ($_POST == '1') { echo 'selected="selected"'; } ?>></option> <option...
3
9834
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user control inside a parent user control with an update panel. Can you guys help me hwo to retain the values. I have set EnableViewState to true. Where is...
1
1644
by: coolguyraj | last post by:
I have a PHP and javascript code to take value from two text boxes and calculate on triggering the "OnBlur" function and display in the third box. The code works fine with one line item,If i have more that one line item.i will be able too calculate the value only for the last line item added ,But if i change any of the values in the two boxes...
2
1876
by: anusha.vempati9 | last post by:
Hi All, I am calling a cgi file from a perl module. The cgi file contains the HTML form and some HTML fields(like check boxes). In my logic, I am trying to submit the form and calling the same cgi file again. While doing this, i am not able to retain the values of the HTML fields (check boxes values ) which i set earlier before...
0
7496
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
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...
0
7941
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5354
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...
0
3485
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...
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
738
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...

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.