|
I am really sorry my friend, I dont have access to credit or any other kinds of cards to buy from amazon or others. kindly i am asking for free source.
thx
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hello,
I wan to able to change the label when i select a radiobutton.
For example when i select the Yes radiobutton, it will show the text as Y and not Yes.
Is there a way to do that?
|
|
|
|
|
Yes. What control do you want to change the text on when the RadioButton is selected?
|
|
|
|
|
click, thanks for the reply.
|
|
|
|
|
"click" is an event. Do you want to change the text on the RadioButton, or a Label, or what?
Anyway, just wire the event "click" event to the control, then inside it: radioButton1.Text = "my new text"; or labelText1.Text = "my new text"; etc.
|
|
|
|
|
For example:
private void radioButton1_Click(object sender, EventArgs e)
{
radioButton1.Text = "my new text";
}
but to wire the event:
this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click);
which is done automatically by the designer, but if you don't have VS, just add the above to your form's constructor with a change to the radio button control's name of course that matches the method signature (e.g. "radioButton1_Click" in this case).
|
|
|
|
|
hmmm, i did that, and when i go back to the previous form which has the radio button. The text of the radio button becomes the value that i type in the program.
Exmaple, i click on Yes button, the value is Y but when i return back to the form, the text of the radio button becomes Y instead of Yes originally.
|
|
|
|
|
Are you working with a Tabcontrol, or are you calling another form?
|
|
|
|
|
Ooohh, I think you are calling a messagebox or another form. If so, you need to access the main form's (1st form, or parent form) control. Can you give me a code example?
|
|
|
|
|
If that is the case (haven't seen your code yet), then here is an example of what you want I believe:
MyNewForm form2 = new MyNewForm();
DialogResult result = form2.ShowDialog();
if (result == DialogResult.Yes)
radioButton1.Text = "Yes";
Note the "Text" being set after return from the previous form's "Yes" button, but you have to ensure the DialogResult being returned from form2 is DialogResult.Yes for this to work.
|
|
|
|
|
Hi. Thanks for helping me alot! =)
but i figure it out already.
Thanks. =D
|
|
|
|
|
On radioButton1_CheckedChanged event you can set text to label.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
change text to label ?
thanks for the reply.
|
|
|
|
|
use this code
if(radiobutton1.value==true){
{
radiobutton1.Text="Y";
}
else
{
rariobutton1.Text="Yes"
}
plz write this code in click event
Have a nice day
|
|
|
|
|
I have a question that I am unsure of the answers and its possible that the Local Database cache is something I am looking for.
I have created an Inventory Application for all of our items at our agency. This is over 5000 items. When adding or modifying an item, I have it pull Distinct values from the Manufacturer, Model, Vendor, etc. The reason for this is so it will be easier to standardize everything using Autocomplete. We have orders from many manufacturers and the way it is now, there is some items in there as:
HP, or Hewlett Packard, or Hewlett Packard Co., etc.
Using autocomplete will popup an example that you can choose from so hopefully you will select Hewlett Packard to standard it better and make it easier for reports.
As you can tell, the problem is the amount of data it pulls to populate the comboboxes. That is a lot of data to pull from a SQL server even if it is a stored procedure and only pulling Distinct values.
Is there a way to possible cache this information once on the application load and use it over and over? I am only worried about caching it on the application loading (locally) or maybe even once a week.
Any ideas would be grateful. Thank you!
|
|
|
|
|
Did you normalize your database?
e.g. do you have a Manufacturers table, with fields MFG_ID and MFG_name?
when you do, your articles table should store MFG_ID, not MFG_name (less data, less confusion)
and your comboboxes could get populated by the Manufacturers table (much less data)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
As that might have been ideal... no I didn't
I took an existing database (which was made in Access) and created a new database from scratch.
I used the same table layout the access database it has (created way before I got there) and basically created something to read and import it into the SQL database.
So basically my Inventory table has a
Manufacturer, Vendor, Model field in each.
I know what you are talking about, but for me to do that, it would be very time consuming I believe since nothing is standardized. I can change that in the future..
|
|
|
|
|
I forgot to mention that this is a remote database housed on a SQL 2005 server. It is not local
|
|
|
|
|
It will have to be done sooner or later. Later probably means more code to change, and more data in the tables; so why not do it sooner?
You can automate a lot of it: add a MFG table, and a MFG_ID to existing tables; then write some code to copy MFG_name form existing tables to new MFG table and insert MFG_ID values. All this does not clean the situation, it merely normalizes, and moves the different spellings of HP to the MFG table (all with different IDs).
However you can now list the MFG table, sort it, and start cleaning it (merging different MFG_IDs that should be the same).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Sounds like a great idea! I'm going to start working on that.
Thanks!
|
|
|
|
|
Actually, I am just going to work on doing that. But just for knowledge, would the local database cache in visual studio work for something like this?
|
|
|
|
|
My database experience is limited, so I'm afraid I don't have a clue, except to say that generally caches are meant to speed up things.
You might consider asking in the database forum.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Firstly - do take luc's advice, you need to normalise you database.
Once the database is normalised it then becomes easier to service the combo/auto complete fields because you would now have the concept of Master Tables or Static data.
I am assuming you are using winforms so this is how we do it.
Have a static class called MasterTables with a property for each table that services the combo's. In the getter have it check if a local datatable variable for the table is null and load it if required. This leaves the data in memory on the local machine. If the user adds a record to a master table you set the mastertables property to null and it will automatically be loaded next time it is called.
Caveat, this does NOT refresh master tables modified on other client machines, for that you need to wire up events back to SQL Server. I have never seen a need to do this with the type of apps I write.
|
|
|
|
|
Hey every body, I am just trying to do some application in C#(like to transfer data from 1 pc to another) from my Network knowledge(up to I have learned),If one of the computer is set not accept connections ,it will not accept data transfers or other connections. So while I was trying to connect to the other PC using C# , is there a way to know such kind of problems or is it possible to open the connection ? If there is something wrong on my question please notify me .
Thank you.
|
|
|
|
|
Not able to open connection can be boiled down to configuration.
You usaly connect to specific IP on specific port. Routers, Firewalls and other internet securty solution can result in blocking port and ip if not in their white list.
The other possibilty is the program host or client offline
|
|
|
|