|
OK - this is the last time. I had a quick look and I think I see what you want.
To attempt translation... you have several TextBoxes on a MdiChild Form. On a ButtonClick on that Form you want to send the contents of all the TextBoxes to a different MdiChild Form so you can populate a DataGridView. Is that correct?
If so, the first step is to get the data from the textboxes into a useable format in the Button's Click event handler. I would recommend a class instance with properties to hold each piece of data, but a string array or List<string> would do.
Next, you need to create a custom event like I showed you before. Raise that event like I showed you, also in the Button's Click event handler.
Next, in the MdiParent, after you have instanciated but before it's shown, subscribe to your custom event (the handling method should be created automatically for you).
You will also need a field to hold the reference to the form with the DataGridView.
In the form with the DataGridView, create a method or property that takes data in whatever format you decided in the first step and updates the DataGridView.
In the MdiParent's custom event handler method, call the other form's method/property (assuming it's not null) passing the received data.
Colin Mackay has a great article[^] - look at the section called Sibling to Sibling.
Now you have the principle, go ahead and try it, and post back with any specific problem.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Please please help with this simple Q from a C newbie....I spent hours trying to find the answer online...
I want to run this on a linux box. Open a file containing a list of file names and then run a linux commands on each of the list for example:
The file contains a list of files names eg:
test
test1
test2
test3
How do I code in C so that it opens the file and then foreach of the elements do a system command eg: ls
in perl it would be something like:
#!/usr/local/bin/perl
while(<>){
chomp;
$cmd="ls $_";
system($cmd);
print "$cmd\n";
}
Thanks in advance!
|
|
|
|
|
Hi,
this is the C# forum, C# is one of the .NET languages.
For plain old C you should post on the C++/MFC forum.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Thursday, February 19, 2009 5:47 PM
modified on Sunday, June 12, 2011 8:23 AM
|
|
|
|
|
Hi Evryone
I build WebService on Windows server 2003
when i try to connect from my C# program, it wright:
"Unable to download following files from http://11.11.11..."
is someone know whay ?
|
|
|
|
|
Impossible to say considering you don't show any of the code that is calling the web service, nor anything about the method you're calling, what it does, what it's supposed to do, ...
|
|
|
|
|
I only try to add web reference to my WS - and this is the message
|
|
|
|
|
In that case, you Google the error message ("web service add reference Unable to download following files from http")and you get this[^].
|
|
|
|
|
Does the .NET framework contain any classes that assist with caching data locally, and then automatically synchronizing that data with a website as soon as the machine is connected to the internet?
Adobe Air has direct support for this. I wonder if .NET has anything addressing this.
|
|
|
|
|
Nope. You either have to use a third party solution, or roll your own.
|
|
|
|
|
In a pc contain default hardware components. If i have add addtional components. while if the checking process will be taken on every booting time & detect any device add, if u have added to check and mismatched, the system will be come a shutdown. they matched means continue to loading OS.
And as what type of devices should be add to list out in the form of label.
To checking process using an serial number of products.
if u have use any type of database or various technique(registry, text file).
for example: already a pc contain 2 HDD normal. add another one will not boot the system.
|
|
|
|
|
Uhhh... what???
I didn't understand anything you said.
Are you asking if you can prevent Windows from booting if the hardware in the machine changes??
|
|
|
|
|
hai Dave Kreskowiak,
But i have Sorry for u haven't understand this question.very sorry for my poor English communication & and sending Questions.
my point is - simply say for - if anybody can change for my system parts, the system will not Boot. The default parts may be placed to return means no problem to boot&contiued,if any parts add or change my system set never boot.
my option is - each hardware parts contain a unique number.so i have used this NO to protect my system, unnecessary to anybody add an additonal parts or change it detect to use the serial no.
For Example: motherboard changed same brand, add 1 more Hard drive & cd drives or changing......
|
|
|
|
|
Basically, you're trying to copy protect your software. In my humble opinion, a fruitless effort.
If you're trying to use hardware serial numbers, you're wasting your time. Most manufacturer don't put serial numbers in their hardware, save for hard drives. But even using hardware is too unreliable and if your software breaks because someone had to replace a motherboard, you just lost a customer because you introduced more downtime to the system than was necessary.
If security is that big of a concern, look into USB security dongles.
|
|
|
|
|
hai Dave Kreskowiak, thank u for guidence.Because i haven't well Knowledge any one Field.Just i have learn intial stage.so guide me.
your solution is correct.But some times usb dongle has failure (or)usb port failure - what we do.
** i have want this type of basic & simple protection rules containing program.After i have changed your idea based program.
** Another one point is- i have using this type of progarm to protect for copy entire primary partition (c . Because the installed progaram files should be clone to copy and run on the another system.It contain a exact same motherboard or partial matched motherboard drivers another system.so it is run easily, so how to protect.
|
|
|
|
|
Member 4235601 wrote: your solution is correct.But some times usb dongle has failure (or)usb port failure - what we do.
Sure, you can get the motherboard or harddrive serial number(s) and use that. But, what if the mobo or drive fails?? The problem is the same.
You simply cannot protect your app against copy protection to the point where it is foolproof. It's been an industry pipe-dream for decades and continues to be such.
Member 4235601 wrote: Another one point is- i have using this type of progarm to protect for copy entire primary partition (c. Because the installed progaram files should be clone to copy and run on the another system.It contain a exact same motherboard or partial matched motherboard drivers another system.so it is run easily, so how to protect.
There is no way to protect against this. Yes, someone can close the partition/drive your app is on and put a copy of it on another machine. There's nothing you can do to stop it.
Now, given your total inexperience, comming up with your own protection scheme is going to be nearly impossible. So, you'll end up using a third party product to (cough) "protect" your app. You can pretty much bet that every one of them has already been cracked, or if it hasn't been on the market that long, WILL be cracked in a very short time.
|
|
|
|
|
The same concept question is:
Now a days in windows based Operating System installation files & other software files contaning partition(primary) of -c: can be copied entirely, and run different system. (they are all using drive image techniques). it's only the same brand & model based system only used.oterwise different there driver files are ocurring the error.
because inner components specification varies on brand & model.
so how if u have protect this copy.
This type of copy, i have decide to using serialNumber to system protection.
send ideas & Solutions my mail id: d.jagadish@hotmail.com
|
|
|
|
|
Good luck with that! This can be broken all too easily.
|
|
|
|
|
|
Member 4235601 wrote: It is provide software security.
There's no such thing...
Member 4235601 wrote: but i have using dirve to use Operating system protection.
Again, it will come down to a single IF statement that can be reverse engineered quite easily and altered so that no matter what the serial is you're looking at, your app will ALWAYS work. Read the comments at the bottom of the article you linked to.
|
|
|
|
|
i have fully collapsed my concept.But i have not want to design higher security level.i have want simple type of prtoection.
so what is the your solution.if u have already told using dongle,but without dongle using how to protect the clone of primary partition(contain operating system) in the hard drive.
if i think the protection should be placed in when the time of cloneing of partition, otherwise if the cloneing files extracted to the other drive, when the time of operating system load to use protection.
give me any idea or if u have design project your own thinking knowledge.
thank u.
|
|
|
|
|
Member 4235601 wrote: i have want simple type of prtoection.
That was funny!
Member 4235601 wrote: so what is the your solution.if u have already told using dongle,but without dongle using how to protect the clone of primary partition(contain operating system) in the hard drive.
Use the code you found in the article you linked to and get a serial number from the hardware. It's about as good as anything else. Just don't be surprised when someone breaks it.
Member 4235601 wrote: or if u have design project your own thinking knowledge.
That's never going to happen. I never tell anyone how I protect my apps - for very obvious reasons.
|
|
|
|
|
Hi
Im havin problems with my connection to my databases.
I have a default connection string hardcoded in the appconfig file.
I have a main form where i use opendialog to connect to another database of my choice. Everything works fine on this form, it connects to the new selected database.
BUT now as soon as i go to a child form, it seems to loose that connection to the selected database and then makes use of the default hard coded string in the appconfig file.
How do i keep the new selected connection over all my forms?
Please if anyone could help me..would greatly appreciate it.
Thanks
|
|
|
|
|
With no code we can't tell where the error is. However, if you create a static string variable in your application for the connection string and use it instead of the configuration connection string (only using the configuration string on start up) then it will likely avoid your issue.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Thanks for the response.
Did what you said in another project, where i had programmatically created my dataset,binding source and table adapters etc. it worked 100 %.
but the problem with this project is that i drag and dropped the components.
And now when I call the tableadapters.fill() method on the child form, in the autogenerated designer code, it gets its connection string from
ProjectName.Properties.Settings.Default.StaffConnectionString
which is in the app.config file.
Is this one of the limitations of using drag-and-drop components?Or is there a way of working around this?
I really hope there is a way around cos this is going to require alot of recoding.
Thanks again for the response..
|
|
|
|
|
We have been using ADO.Net with all System.Data.SqlClient classes such as SqlConnection. Things worked fine but lately everything is acting up. One of the senior developers suggested to change the connection string to an Odbc connection string. Now leaving aside why he suggested so, this is my question:
I believe if we change the connection string, we also have to change the source from objects such as SqlConnection to OdbcConnection objects. He says we don't and it should be as simple as changing the connection string. Is this true?
I believe the format of the connection string has to be in the correct format for the classes being used. No?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|