|
Duncanmhor,
sorry for bordering u again bud the problem is i don't know the name of my field. i have only a combobox with the name of tables and a textbox for user input, so the field can be any column in my table. how do i solve it now?
|
|
|
|
|
I'm not sure what your application is doing, but if you have the names of the tables, you should also have the names of their columns. You could simply change the string based on the selected table and fill your select statement with or clauses
eg
<br />
select * from yourtable where a like arg or b like arg or c like arg...<br />
From what you are telling me though, I'd have serious concerns about the way your application is designed.
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Djavid j wrote: we don't use stored procedres in this project
Why not? Is it a management decision?
|
|
|
|
|
Hey all
Q1:
I have a numericupdown which the user can change. Upon change a number of datetimepicker is supposed to be shown, according to the value of the numericupdown. How should i add these datetimepickers? Create them all in the designer (i need maximum 31) and set visible=false, or with flowlayout panel, and create with the new keyword??
Q2:
How can i change values of multiple components through functions? In Q1 i created, lets say 31, datetimepickers. I named them dtp1, dtp2, dtp3, and so forth. How can i do something like this:
(pseudo code)
<br />
for (int i = 0; i < numberofdatetimepickers; i++)<br />
{<br />
dtp[i].enabled = true ;<br />
} <br />
|
|
|
|
|
Hi,
Q1.
You could use Visual Designer to compose the maximum complexity, then hide what you
don't need. But that is a lot of work, and generates a lot of code, and leads to all
kinds of Control names.
I find it easier to write code to do that, so I would generate the Controls at run-time;
this means your code has to set all relevant properties, in particular Location.
If you do it in a loop, you can store all these Controls in a collection (an array,
an ArrayList, a List< DateTimePicker>, whatever)
Sometimes I tend to create one Control with Designer, then write code to Clone() that
one, adjust its properties, etc. That way, you can design and see the properties for
your Control prototype.
Q2.
If created at run-time, the Controls don't have individual variable names, but reside
in a collection (array, ArrayList,..) which you can enumerate with a for loop or a
foreach loop.
Otherwise, you could:
- enumerate all the Form's Controls (thru Controls property) and skip the ones you don't
need;
- or create a collection once (new array or ArrayList, then add the references), then
enumerate as much as you like.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
thx alot for the suggestions
If i create the controls at runtime, and add them to an array, can i then add the array to something like a flowlayoutpanel, and still acces them through the array? or will i have to make a new array, consiting of all the items in the flowlayoutpanel?
|
|
|
|
|
Hi,
you cannot add an array to a Panel or other Container, but you can add all the Controls
in the array to the Panel/Container, one by one. You could do that in the same loop
where you create them and add them to the array.
Controls are reference types, so when you call "new SomeControl" you create a SomeControl
and get a reference to it, which you can store multiple times, e.g. once in an array,
once in the Controls property of some Container (to make them show on your Form).
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Everthing in my solution is compiling and linking and running ok.
Two days ago, I now receive the following message when I run the solution.
"There were development erros. Continue?"
It seems to run ok. I am concerned and would like to fix it.
Gene
|
|
|
|
|
Professor Gene wrote: "There were development erros. Continue?"
development erros? Really? I've never seen that message are you sure? I have seen this one:
"There were build errors. Would you like to continue and run the last successful build?"
If that is the message you see then if you click "Yes" you are not running the code that does not compile because ... well it has to compile before it can run. Also if that is the message you are seeing it seems you need to work on your reading and comprehension skills.
|
|
|
|
|
led mike wrote: "There were development erros. Continue?"
Now it's not just end-users anymore who don't read error messages properly anymore.
This whole business is going down...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
What? Are you fishing for an invitation into our club? Talk to Mark Salsbery[^], he's currently in charge of candidate screening.
|
|
|
|
|
I'm just fed up with hearing customers telling me "there was an error message. Fix it! No, I didn't read it and can't tell you what is said."
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: "there was an error message. Fix it! No, I didn't read it and can't tell you what is said."
Is this your application? If so do you produce logs of some sort? That is a far superior approach than relying on users to read messages.
|
|
|
|
|
Sure it does, but for our average customer even opening a simple text file is beyond scope...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
mav.northwind wrote: but for our average customer even opening a simple text file is beyond scope
Why would you have a customer open a log file?
|
|
|
|
|
Because many don't have internet access on the machines our applications are running on so they can't simply mail the files to us...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
This is starting to get old... provide a printing feature and have the fax them to you or even snail mail them, anything you can think of is superior to having a customer read a log file or even worse, not use the log file at all which is what it sounds like you are doing.
|
|
|
|
|
Hi People - I have been tasked with a project to choose the best method and tools to deploy our c# app - it probably needs to include obfuscation, maybe some form of encryption/source code protection etc and certainly be able to run without the framework being previously installed. I know there are a few products out there - Can anyone recommend some/give some advise ?
Thanks
|
|
|
|
|
Symeonb wrote: Hi People - I have been tasked with a project to choose the best method and tools to deploy our c# app - it probably needs to include obfuscation, maybe some form of encryption/source code protection etc and certainly be able to run without the framework being previously installed.
All of those requirements can be met using the standard setup project*, save for one. The only problem would be this:
Symeonb wrote: certainly be able to run without the framework being previously installed.
Maybe I am unsure about what you mean by this, but you have to have the .NET framework installed on the users machine. Maybe you meant that the setup project has to install the framework if it isn't already. What you can do is add a perquisite for the framework, and if it isn't installed, then you can have your setup project install it.
About the requirements you wanted to have run with setup. What you will have to accomplish to get the setup project to do them is to override the Installer. You can override all install methods, such as Install, Uninstall, Rollback, etc. See the link below for an example of how to do this.
Overriding the installer class[^]
* File -> Add -> New Project> -> Other Project Types -> Setup and Deployment -> Setup Project
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi - Thanks for the comments - just as an fyi we have decided to go with the softinstall product from bitfactory software - it does most of what we want and talking to the guys there, it looks like they have some exciting new developments coming out as well.
Rgds
Symeon.
|
|
|
|
|
Hi,
I like to write an application to access the IO pins on the compact flash port of an IPAQ running Windows Mobile 5.0.
Is this possible ? and is there any sample code for this?
In the end I'am desingning a CF to RS232 interface with extra functions inside.
regards
Henrik
|
|
|
|
|
Hello guys!
I want to save a System.Drawing.Graphics graphic as a *.bmp file, and tried it using the StreamWriter. I know this from saving text to a *.txt file, but found out, that this doesn't work with System.Drawing.Graphics graphics.
Has anyone an idea how this could work, I didn't find anything useful in the MSDN library.
Thanjs and best wishes.
|
|
|
|
|
The following steps should work:
1. Create a new instance of a System.Drawing.Bitmap object.
2. Derive a Graphics object from your bitmap by calling its FromImage method.
3. Perform your drawing operations using the Graphics object.
4. Call the Dispose method on your Graphics object.
4. Save your image to a file by calling the Save method on your bitmap object.
Hope this helps.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for your help, now it works
|
|
|
|
|
Hi,
C#, VS2005
I have an aspx page which loads a crystal report as a pdf.
The code loads the report, connects to the sql server database, sets the report parameters and creates the report.
This works fine when the stored procedure behind the report takes up to a couple of minutes. But when the stored procedure takes around 3 minutes the aspx page just hangs and never returns.
Has anyone seen this behaviour? - I assume there is a time out I need to set somewhere...
Thanks in advance...
Chas
|
|
|
|