|
Yeah you're right... I totally missed that.
I think he's using .Net 1.1, but I can't remember what the difference was. With a .Net 2.0 project, it should be working if the assembly is added like he said.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
Erhm, you don't have the configurationmanager object there...
The .NET 1.1 ols fashion way is
System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]
(or ofcourse)
using System.Configuration;
and
ConfigurationSettings.AppSettings["ConnectionString"]
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
What version of visual studio / .NET Framework are you using. The code you have will only work in .NET 2.0 (Visual Studio 2005).
Also, replace the () with [] after AppSettings because once you've fixed this error your going to get another.
|
|
|
|
|
|
(I was typing my reply when your old post disappeared! I figured it had been moved, but I had some trouble finding it. Anyway, here's what I was trying to say before.)
You're thinking a little old-skool there. I think if you take advantage of the .Net Framework, you can eliminate the middle-tier and still keep things secure. You don't want to get into COM-hell, which is not entirely eliminated with .Net assemblies. The Windows client and the SQL database are enough. Keep it simple. If you are going to store your information in a database, you won't need to serialise your objects... that's really only useful if you're using files for storage or if you really need a middle-tier. To store an object all you need is to put the current values of the member variables into columns in your database. So if you had an object like this:
class myObject {
int myNumber;
string myString;
...some functions and such...
}
You would simply create a database table like this:
create table myObject (
object_id int,
myNumber int,
myString varchar(x)
)
You need an object ID so you can make sure you don't get multiple instances mixed up. You could use any property of the object to make it unique - doesn't have to be an integer.
Then you create a stored procedure to store this object data (and perhaps send back a new unique ID), and another stored procedure to retrieve objects based on their ID. You will be able to use these stored procedures in a secure fashion from the client, and you will be able to take advantage of all kinds of cool security features designed for this exact purpose, and all your validation can be performed on either of (or both of) the two layers. As long as you're not doing super-complex math or predicting the weather or something, you should be able to push all the validation down to the database layer. That is the way to go if you suspect multiple versions of the client, but if you have total control over client updates, then you are safe doing that stuff on the client and avoiding a round trip to some server somewhere. I've just finished a very complex application that uses this model - there was no reason for a middle tier. You haven't given any reason why you really need that.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
|
That makes sense. Are you using some kind of off-the-shelf user interface? I'm curious as to why you don't build that yourself. IMO, the best thin client is a web browser. You have full control over the versioning of the software that way, because when you change the web site, it changes for everyone at the same time. In that case, you do have a middle tier, sort of. You have the thin client (browser), the middle tier is the web server with the ASP(x) engine, and then of course the back-end database.
Occasionally, it's not worth it to dumb-down your software to work on old machine, and more cost-effective to upgrade the office machines. It all depends on the size of the company and how many machines would have to be replaced in order to bring it into the modern world. Companies need to keep their office equipment up to date, and a lot of times, deprecated software can help 'motivate' that change. If that makes sense...
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
Hi,
Can anyone help me how to create three floats in dev express mask editor.
Eg
-12.00,12,1
|
|
|
|
|
Can ny one tell the method how to get a unused port number so that a server can listen on that port.
|
|
|
|
|
u can download Active Ports[^] to see which of the ports are being used.
Regards
Shajeel
|
|
|
|
|
Hi,
How to compare the values of 2 datepickers?
How to validate the columns of a datagrid like the coulmns should accept only the numeric values?
Thank you,
Regards,
Deepa.
|
|
|
|
|
Hi ,
I need to redirect the contents of the command to a file. I tried doing this using follwing peice of code but it doesnt seem to be working.
System.Diagnostics.Process QueryProcess = new System.Diagnostics.Process();
String command = @"ipconfig/all";
QueryProcess.StartInfo.FileName = command;
QueryProcess.StartInfo.Arguments = " >c:\\a.txt";
QueryProcess.Start();
QueryProcess.Close();
Kindly look into the problemand tell me the solution ASAP.
Thanks and Regards,
Sankalp Verma
|
|
|
|
|
pls help..
what can i do if i wish to load the xml onto my grid view using java script without going back to the server.
thank you
|
|
|
|
|
You try AJAX...
Please refer www.w3schools.com for more reference.
|
|
|
|
|
I saved the windowstate of the other application, such as a folder.
when I reopen it, I use the following code:
////////////////////////////////////////////////////////////////////
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartArgument = "c:"
p.Start();
Application.DoEvents();
SetWindowPos(new HandleRef(null, p.MainWindowHandle), new HandleRef(null, IntPtr.Zero), 10, 10, 0, 0, 0x15);
//////////////////////////////////////////////////////////////////////
but when it run to "Application.DoEvents();", the p exited, then p cann't get MainWindowHandle.
so the method failed.
any other method?
|
|
|
|
|
Meybe create a new process object and attach it to your running process, and then 'do your thing'
|
|
|
|
|
hello friends..........
can anybody give me some idea abt
overriding ondatabinding method in case of binding data to datagrid.
thanks in advance
soori
|
|
|
|
|
Do you really want to override it, or just create a new event handler? The Design View can be used to add an event handler to a control, or you can do it like this:
myDataGrid.OnDataBinding += new System.EventHandler(this.myEventHandler);
The OnDataBinding method itself doesn't really do anything but call the event handlers that are defined to respond to that event, and handles some issues that arise when databinding occurs (which happens when you call the DataBind() method). Did you want to change that behavior? If you override it, you will have to explicitly call the base class function in your override, or you will lose the default behaviors that keep the DataGrid functioning properly when new data is bound to it. Since you are aware of the times that you call DataBind(), you can handle any extra processing at that point, or you can create an event handler that does your extra stuff. I don't think you ever need to override the events themselves.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
If I use software like OpenOffice and try to drag text I could notice that
1. when I drag inside the document I'm moving the text
2. when I drag outside the document I'm copying the text
Yet it all looks like one smooth operation. With correct cursor feedback (the little + marker next to the icon).
My problem is, once I call DoDragDrop() it's blocking, I have no other opportunities to change the AllowedEffect to only Copy if I drag over, say, an other control.
And QueryContinueDrag:
1. don't allow me to change the efect
2. don't inform me about the current drop target
How could I do that?
(i.e. how could I modify the allowed effect depending on the target (i.e. wether it's me or not))
|
|
|
|
|
Almost every component has a few drag/drop events which can be used to switch the allowed effects.
In your case you should use the DragLeave event to change the effect when the mouse leaves your form for example.
As long as the mouse hovers somewhere in your application you can do whatever you want with the DragEnter and DragOver events of each component that is under the cursor.
--------------------
Bertram Weckmann
www.svizzer.com
--------------------
|
|
|
|
|
You are wrong or I missed something.
DragEnter is only called on the target of drag and drop (not the source of the data) and the allowed effect can't be changed (as it is set by the source of the drag not the target), as the target can just the selected effect.
I need to change the allowed effect when I drag in other control/component, including other application. the dragenter is not the appropriaote event as it is something I need to do in the source of the dragging, not the destination
|
|
|
|
|
Well, when you start the dragdrop operation you can set the effects which are allowed. After that point it is up to the component over which the cursor is dragged which of these effects are shown. So if it is a component which does not belong to your application, you can only give it a set of effects and which of those will be chosen is up to the application.
I made a very very simple example:
http://g10.wilde-edv.de/PublicStuff/DragDropTest.zip
There you can drag the Button1 to the text field or to the button2. I set the allowed effects to copy and move. The button2 only accepts move and the text field only copy. So the icon is changed to the appropriate effect as soon as you drag over the control.
When you drag outside the form the other applications will pick either the copy or the move effect, or none if they do not accept the data.
Hope that helps.
|
|
|
|
|
Sorry I didn't explain my self vey well...
I would like to do something like that in the source:
// == pseuo code
if(source == this)
AllowedEffect = All
else
AllowedEffect = Copy
just like word.
when you drag text inside a word document it move it, if you drag to an other document it's a copy.
your sample don't address this issue at all.
In fact it seems you haven't realised yet that it is seemingly impossible with the public API of the control...
Thanks for trying to answer anyway
|
|
|
|
|
OK now Im trying to understand what you originally wanted.
The AllowedEffect has to be set at the beginning of the drag/drop operation. Afterwards it is read-only.
But nevertheless you can imitate the behaviour of Word:
Start the drag/drop operation with the allowed effects Move AND Copy.
Just fill the data in, but dont remove it yet from the source.
Then just set all target controls to allow ONLY Move and design the DragDrop event handlers in a way that the data is actually moved, so remove it from the source.
Now if the user drags it out of your application almost every other application will pick the copy effect because they dont have any drag/drop handler for a move operation from anything coming from somewhere else. And since you left the original data where it was at the beginning, everything done by other applications will be a copy operation.
And there is your Word behaviour. Inside your application you have a Move, outside you have a Copy.
Got you this time?
|
|
|
|
|
I am new hand to C#. I want to create a number of label(System.Windows.Forms.Label), like using lblMsg(0) in VB6 or m_lblMsg[0] in MFC++6, how can i do that ?
Can i use array to done this ? i tried using "lbl[0]", but has error message prompt by the IDE.
Thanks
|
|
|
|