|
I'm doing a Win32 (commercial) application currently and this is a simplified view of how I do it.
For inserts:
- get user input from screen
- call business class to do validation, etc...
- business class calls generic data layer passing GUID as primary key
I use the GUID class to prepare a unique number. This way it will work for several users.
For updates:
- user selects a certain row
- business class uses this primary key to retrieve data along with a concurrency ID. This could be a timestamp in SQL, but I'm using another GUID instead.
- user does edit
- business class calls data layer, passing editted rows fields, GUID and concurrency ID
- data layer checks that the current concurrency ID still matches the one in the DB and then does UPDATE.
HTH
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG (latest pic 1) (latest pic 2)
|
|
|
|
|
Is there a way to make a certain column in the datagrid fill up to a 100% in the datagrid?
|
|
|
|
|
Not dynamic (before connecting DataSource):
datagrid.PreferredColumnWidth=datagrid.Width
Dynamic (only if You use DataGridTableColumn) in Resize event of DataGrid:
datacolumn.Width=datagrid.Width
but - remember about rowheader and vscrollbar width.
Hi,
AW
|
|
|
|
|
Hi all
I have a couple of quick questions:-
1. What do I do to allow my code to process one section of code at runtime and one section of code at design time?
2. Is there a forms collection? Basically I have an MDI app where I will require to shut down all the windows that have been opened programatically upon a certain user action.
Thanks in advance
ANdy
|
|
|
|
|
Almost every peace of code in windows programming is processed at runtime
well for this problem. u may save the references (pointers) of the currently
open forms in a hashtable or in any dynamic datastructure(e.g list) and
upon an event (e.g button click ) u just iterate that list and close the
forms by calling the appropriate messagecall.
bye
|
|
|
|
|
1. Use DesignMode property of components
Hi
AW
|
|
|
|
|
Here's a link from MSDN that deals with a similar subject. Perhaps it will help.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/reaworapps1.asp
Jim Stewart
|
|
|
|
|
I am developing a web app that calls on the execution of an external application. The code compiles with no errors, however, the external execution is never implemented.
I am not at all sure what I am doing wrong. I've done the same thing using a windows form and it works. Could it be a security issue? Is it how I'm calling on the external application?
Me, wrong!?! Nah, you just need to change your thinking to make me right.
|
|
|
|
|
TeraCoder wrote:
I am developing a web app
Is this a WinForms embedded in IE app or an ASP.NET web app? The former you will need to setup the security policy via the .NET framwork configuration (mscorcfg.msc). The latter you will need to give the ASP.NET and the IIS user account execute rights for the process in question.
Hope this helps
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
i face some problem in passing struct data type in web service style.
i create a web service:
---------------------------------------------------------------------
[WebMethod]
public string HelloWorld(System.Drawing.Color c)
{
if(c == System.Drawing.Color.Red)
return "RED";
return "NOT RED";
}
---------------------------------------------------------------------
i face no problem in generating web service proxy for the above code
by using wsdl tool.
i write a dummy test code:
---------------------------------------------------------------------
Service1 s = new Service1();
Console.WriteLine(s.HelloWorld(System.Drawing.Color.Red));
---------------------------------------------------------------------
i get the compilation error
dummy.cs(8,35): error CS1502: The best overloaded method match for
'Service1.HelloWorld(Color)' has some invalid arguments
dummy.cs(8,48): error CS1503: Argument '1': cannot convert from
'System.Drawing.Color' to 'Color'
any suggestion in solving this problem? thank you.
regards
yccheok
|
|
|
|
|
Sounds like you have defined another Color type or it theres a version mismatch...
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
leppie, that's what I thought too.
Give it a try, there's something wierd going on.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
animation mechanics in SVG (latest pic 1) (latest pic 2)
|
|
|
|
|
im looking too add some features to a simple console app that runs with my program via the command line's -console command. Im trying to find a easy way to make key words i.e echo,consolesave to change color when they are typed. i have a vague idea on how to do this. i also want any text with the "qoutation marks" to change color as well. Does anyone have any easy way of doing this? thanks alot
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
What happened to the RichTextBox?
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
i figured it out... i just used a string array...and such !!
jesse m
The Code Project Is Your Friend...
|
|
|
|
|
ERROR : "The type or namespace name 'Net' does not exist in the class or namespace 'System' (are you missing an assembly reference?)"
I get this error on 'using System.Net;' and I'm obviously not understanding something quite important. I've been doing console-apps in C# for a while now and I have never bumped into this assembly-stuff before. I've searched the net and MSDN without figuring this out. Please help me
Edit: I figured it out at last!! (At least I think so)
Sprudling
|
|
|
|
|
I am looking for sample code where someone has used the Navigate2 method of the IWebControl2 object in C#.
Can anyone help me?
Thanks in advance for helping me out!
d
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
s.rod. has covered this many times here on the CP - look around.
|
|
|
|
|
Okay,
I've got two apps.
1) in C++ using WinInet.
2) in C# using WebRequest
When requesting the same URL in each I get a diffenent page of HTML returned.
The C++ version is fine, but the C# version is not.
It seems to stem from the fact that the site is saying its and unsuported browser from the C# app!!!! I get the same undisired result in the browser Opera.
So, does anyone know what provides the same functionality as WinInet from .NET?
I was thinking maybe I should not be using Webrequest, but Webclient, but I get the same result. I'm guessing that something in the header of the .NET implementation is not there, or disimmilar to Internet Explorer.
|
|
|
|
|
Use System.Net.HttpWebRequest instead and set your UserAgent string to match your PC's browser.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Thanks. I'll give it a try.
You don't know what IE6's UserAgent string is like to you?
I know its somthing like - Mozilla4.0(compatible, IE6) bla bla bla.
Thanks,
Giles
Quote from a clever bloke :
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
|
|
|
|
|
No still not having it. The CHttpConnection set of classes in MFC work fine for the url, but HttpWebRequest is not working even why I apply the User-Agent to the header.
Quote from a clever bloke :
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
|
|
|
|
|
Giles wrote:
No still not having it.
What the URL, I can try it?
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Here it is:
http://www.gsgdirectory.co.uk/CGI-BIN/GSGDir.exe?SDETAILSPAGE&NUMGSG=124383[^]
The .NET classes return a different page, to IE.
As I said the WinInet library returns the same page as IE. If you want to test it quickly Chris has built page grabber class in this article : http://www.codeproject.com/internet/webgrab.asp[^]
It uses the MFC http classes which I'm right in thinking use WinInet. Also the VB Internet Transfer control correctly pulls down the page.
Thanks,
Giles
Quote from a clever bloke :
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
|
|
|
|
|
Giles wrote:
Here it is:
http://www.gsgdirectory.co.uk/CGI-BIN/GSGDir.exe?SDETAILSPAGE&NUMGSG=124383[^]
The .NET classes return a different page, to IE.
This appears to be happening because of a javascript redirect within the HTML. I'm not sure how WinInet or the VB transfer control handles that. Both HttpWebRequest and WebClient gave the same results. Not the one you are looking for though It could be a frames issue as well.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|