|
auloepid wrote: bind a data-set in a gui to a table in a database
That is pretty easy after you done it once.
Follow:
In Solution Explorer
Right click you Project -> Add -> New Item
Then in the Add New Item Window
Select DataSet and give it a name
Click Add
A new DataSet is added
While looking at the DataSet.xsd
Go to Server Explorer
Connect to the Database
Once the connected you can then drag and drop
What ever you need
God Bless,
Jason
Paul Conrad wrote:
Chuck Norris keeps the hamsters going whenever Chris is gone on vacation. Just stares them down and they keep the servers going
|
|
|
|
|
Thanks a lot Jason. Will this cause the gui to update in sync with the database then?
Deji
|
|
|
|
|
I don't think it keeps the ds in a live updated state with the db.
God Bless,
Jason
Paul Conrad wrote:
Chuck Norris keeps the hamsters going whenever Chris is gone on vacation. Just stares them down and they keep the servers going
|
|
|
|
|
Not like you do with Pro*C or ESQL... and more's the pity.
|
|
|
|
|
Hi all,
I have a windows C# EXE. In most cases, it will be killed abruptly from TaskManager (its session will be killed).
Is there any Event in C# to handle those abruptly closing of EXE?
Need in urgent.
Thanx in advance
vidh
|
|
|
|
|
If you kill something from the task manager the idea is that it should stop dead right there and then.
Before Vista you were trusted to be able to hook into the system shutdown events and even stop the shutdown if needed. THis was abused way too much and iirc Vista now will notify you, give you a few seconds, and then carry on anyway.
It'd be just the same with a kill command from the task manager, if the OS allowed you to intervine it would be abused a lot and so just isn't there.
On a personal note if I tried to kill an app and it declined I would be very angry, it's my machine and I know what I want to happen better than the app does, I didn't click End Process by accident!
|
|
|
|
|
harvid wrote: Is there any Event in C# to handle those abruptly closing of EXE?
TaskManager will TRY and close the app nicely first. This is a normal close event on the main form of your application. If your app doesn't respond, it'll just be stopped and killed. There is no event and no chance for your code to even care. It's the "bullet in the brain" method of killing your app.
|
|
|
|
|
Like Dave and originSH said, the purpose of the task manager is to stop a task/process pretty much in it's tracks. You can try the OnClose method, but it might not do you a whole alot.
Letting task manager do it's bit by shutting down the app with no intervention done by the app is what should be intended. Nothing more irritating than telling task manager over and over to kill a process because it won't go away.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi Dave,Paul and originSH,
Thanks a lot for your comments.
Let me explain my actual scenario,
I have a C# Windows EXE which will call my Webserive hosted in another Webserver asynchronously.
We have an UI interface which will call the above mentioned C# Windows EXE. when EXE gets abruptly aborted from UI Interface, my webservice still running in webserver machine.
Any options or methods to stop my webservice when my EXE stops abruptly?
Pls help me out.
Thx
Vidh
|
|
|
|
|
Hi, I recieve a chunk of XML as a string that i want to then deserialize, but none of the XmlSerializer.Deserialize overloads accept a string as parameter, mostly only streams, textreaders or xmlreaders. Surely there has to be a quick way to convert a string to one of those formats?
|
|
|
|
|
The streams live in System.IO, have a look there.
|
|
|
|
|
I don't think there's a smart way of doing this.
You could allocate a byte array, create a MemoryStream on it, and then write your string to the memory stream. Then you can deserialize from that.
|
|
|
|
|
Jon Hulatt wrote: I don't think there's a smart way of doing this.
System.IO.StringReader
|
|
|
|
|
Off the top of my head, you could try this:
public T FromString<T>(string serializedObject) where T : new()
{
XmlSerializer xmlSer = new XmlSerializer(typeof(T));
StringReader sr = new StringReader(serializedObject);
XmlTextReader stream = new XmlTextReader(sr);
try
{
T obj = (T)xmlSer.Deserialize(stream);
return obj;
}
catch(Exception ex)
{
}
finally
{
sr.Close();
stream.Close();
}
}
|
|
|
|
|
beautiful, thanks a lot
|
|
|
|
|
Glad to help.
|
|
|
|
|
Is there a way to create a simple button with no xp skins or anything? (like the buttons in minesweeper)?
I tried to disable UseVisualStyleBackColor but it still shows a blue rectangle on the button after it's been clicked.
|
|
|
|
|
You might find that one of the various FlatStyle options on Button does the job. Otherwise just draw the button yourself in an overridden OnPaint.
|
|
|
|
|
If you're using Visual Studio open up Program.cs and remove the line Application.EnableVisualStyles(); inside the Main function. This is what tells the app to use the Windows XP theme; doing this will remove the visual styles from every control in the app.
|
|
|
|
|
I have a web page with 3 date fields. One is required, the other 2 are optional.
These will be written to a database once the user clicks save.
Should I use the in-built customvalidator method? What about spaces?
Should I write a separate validator for dates using the dreaded REGEX?
Can I validate them all using FindControl in a ForEach loop (the id's all begin 'dt****')?
Any advice welcome.
Cheers
|
|
|
|
|
Use the custom validator - there's a method on the DateTime class called TryParse. This is a great way to check to see if the date is valid. Also, use a required validator on the date that is required.
|
|
|
|
|
Hey thanks for your willingness to help but ahm!! sorry that i'd have to disappiont you,but i really do not know how to implement the redo or undo actions
|
|
|
|
|
Well that's a shame, but who precisely was this aimed at? There are some excellent articles here on CP about implementing Undo/Redo - perhaps they might be of some assistance.
|
|
|
|
|
Hi
I have a application which creates a message queue and then recieves the message in it.when i create a test application it was working fine,now when i change this to a webservice its showing me an error which i logged in log file ,the error is as following queue doesnt exists or you do not have permission to perform the operation.Is it anything related with rights.
Actually the queue need to be created programmatically but it also not working.so i created it manually but also above error comes..why is it coming
Thanks in advance
Regards
DilipRam
|
|
|
|
|
The web service will be running under the heavily curtailed permissions of the ASPNET worker process. You need to grant access to this user for the queue.
|
|
|
|