|
Because it is in the dataset, I cannot email the person who fixes the error what is showing up in the query that populates the dataset. She needs to be able to see the error and what is in the dataset so she knows what values need to be fixed.
When I use the ds.tables[0].rows["column_name"].value It causes it to break. I need all of the rows in a particular column (PName) that are in Table[0] in the dataset. How do I loop through to display all of the rows' values?
~Candi
|
|
|
|
|
i have reached to known using sockets which TCP/IP ports are closed or opened.application which is using/listening the particular port, but how i can know which is the application whick is using/listening the particular port?
|
|
|
|
|
Hi,
I am writing context menus for windows explorer int C# to integrate my application.
I created the menu, But I am facing problem at Attaching an image/icon/bitmap to the menu(like winzip).
Please give me some help so that I can complete.
Thanks
Ramesh
|
|
|
|
|
Just so we're all on the same page here,
Are you asking how you add an icon to a menu WITHIN your application ?
or
Are you asking how you add a menu item with an icon to the windows shell (i.e. Something that appears when a user right clicks a file in explorer for example)?
[Link]
Is a very simple example of this - just search in google (or even here) for "Windows Shell menu c#" or terms like that
Mark
|
|
|
|
|
Hi Mark
Thank you, I got it.
Ramesh
|
|
|
|
|
Hi,
Right let me briefly explain what I am trying to achieve and perhaps someone might be able to point me to the best method to achieve it.
I am creating an updater that will run update sql on clients systems, by using sql embedded into an XML file. This updater needs to be version independent of our client platfroms. The updater is just updating a library that the system references.
My problem is that if I apply an update that uses a newer database schema against an older version, it will cause the update to fail. How would we go about creating objects that perhaps are dynamically built according to the schema of the database and being able to ignore any new columns that have been added.
What I want to achieve is an updater that will update a library in the database, regardless of what version of the system it is using and if that a new update is being applied to an old version it will be able to handle itself and apply only the data that is needed according to the schema.
Sorry this is a little hard to explain, hopefully that makes some sense.
We have looked at an object approach or perhaps doing it all via XML and are not sure which is the best or if we choose object method how do we go about it.
Regards
Paul
|
|
|
|
|
Hmmmm,
Interesting issue. I know we have had similiar issues in the past =
Can I ask how the clients get the update file in the first place ? Is it from some Web Service or do they just download it etc?
I'm also presuming that the Actual application itself which opens this XML file will know that it is possible that it will run SQL on potentially multiple different databases (i.e. ones with different schemas and potentially different versions).
If that is the case then why not actaully send down a ZIP file or Cabinet file with several XML files. One primary XML file with essentially a manifest set of nodes - each one referencing one of the other XML files in the zip/cab, seperated by Version/Schema.
For example the primary XML file might look something like this...
<manifest>
<file version="SQL2000" schema="XXXX" filename="Xmlfile1.xml" />
<file version="SQL2000" schema="YYYY" filename="Xmlfile2.xml" />
<file version="SQL2000" schema="ZZZZ" filename="Xmlfile3.xml" />
<file version="SQL2005" schema="XXXX" filename="Xmlfile4.xml" />
</manifest>
It would then be up to the app itself to work out which version of client database and which schema (or whatever criteria you need) and then check this against the manifest XML file and then load in the relevant SQL xml file and then run the SQL contained within it.
Whilst it may seem inefficient to ship all the files to every client, once it's zipped or compiled into a cabinet file the actual file will be pretty small and you also enjoy the benefit of keeping the update logic seperate for each schema/database type.
Mark
|
|
|
|
|
Hi Mark,
many thanks for response in regards to my question. The way the system will work is that we send an update to the client, they are than able to upload this xml file using the application, the application then applies the updates contaied within the file.
We really want to be able to move away from shipping files with multiple versions, as we want the updater to be completly version independent.
The reason we have chosen XML initially is that we can compare old xml to new xml file to genreate the necessary insert, updates and deletes. Plus if there are new columns it just means tewaking the sql that outputs the xml. Where as to do it by an object model, any methods/fucntions have to be all updated to cope with new columns/tables and any calls to those methods/functions must be updated. This would be laborious, unless there was a method to do it dynamically. The reason we are looking at an object model is that all our programming in the system uses this and we would like to replicate that for ease of use, but I do understand that XML is the most appropriate method.
Thanks again
Paul
|
|
|
|
|
Hello,
I need to find a way to manipulate the displaying of the "From" email address. Since I am also using the Sender field to send the email message on behalf of the Sender. So the the person who receives the message will see some thing like this from the email header (I am using the .Net CDO Mail API):
From: jblow@abc.com on behalf of jdoe@xyz.com
To: john@hotmail.com
Here is the sample code that I have used:
cdo = Server.CreateObject("CDO.Message");
cdo.From = "jdoe@xyz.com";
cdo.ReplyTo = "jdoe@xyz.com";
cdo.To = "john@hotmail.com";
cdo.Sender = "jblow@abc.com";
...
What I really want to do here is that I just want to manipulate the displaying of the From email address header so it will just display as:
From: jdoe@xyz.com
Thanks for any respond.
John
|
|
|
|
|
|
Hi Muhammad,
Can you please give me a little bit more detail?
Thanks,
John
|
|
|
|
|
I am using AllocConsole to add a console window to a window form at runtime but i can't write to it using console.write.
|
|
|
|
|
CiNN wrote: I am using AllocConsole to add a console window to a window form at runtime
Why?
|
|
|
|
|
|
hi all
i save a file in my program in an extension that i made
so i wanna this file to have the icon of my program how can i make it
thanx
Generator
|
|
|
|
|
You can do it manually in many ways:
- through Windows Explorer, Tools, Folder Options, File Types;
- more easily: by double-clicking a file with the new extension; Windows will guide
you through the process.
And you can do it programmatically, it has been described in many CP articles;
search for "File Association".
|
|
|
|
|
|
Hello,
I hope one of you have found a solution to the following problem before. . . Thanks in advance if you have.
I have to implement an interface defined in an external program - I must have a method Notify() in my object
toimplement that interface. When there's an update, the Notify() method is called by the external program. I can
then collect any updates with a method call that returns a System.Array consisting of an ID (given by me when
implementing the connection), and a value.
The problem is that the array that I collect updates from is of fixed size (subsequent updates are not added to
the end of the array like a queue. . ), so sometimes by the time I've collected the update, set a member variable
in another object to the value (m_Object.SomeValue) and returned to respond to any subsequent Notify() calls, the
updates have been overwritten and I've missed some updates. . . Not great. I've removed any calculations I was
doing in these Set() methods, but it still doesn't return in time. .
This is a sample of my set-up:
ManualResetEvent m_NotifyEvent;
Thread m_UpdateThread;
. . . .
m_NotifyEVent = new ManualResetEvent(false);
m_UpdateTHread = new THread(new ThreadStart(RTDUpdates));
m_UpdateThread.Start();
... . .. .
private void RTDUpdates()
{
m_NotifyEVent.WaitONe();
System.Array arrValues = m_RTDServer.RefreshData();
if(arrValues > 0)
{
for (int i =0; i
|
|
|
|
|
You could always store it in a List<...> or ArrayList internally and then just copy it out to an array to return it out.
|
|
|
|
|
tobriain wrote: How can I concentrate on maintaining the proper state of the variables
You mean like making a copy of the Array as your first step?
|
|
|
|
|
Thanks for the swift replies. .
>You mean like making a copy of the Array as your first step?
In any case, processing the updated array, setting the values and returning in time doesn't seem to be working. If I make a copy of the array and return immediately, i'll end up having maybe 10 arrays per second. I need to get the values out of the update array on one thread, maybe, and put them into some kind of dynamic list. Then on another thread, I need to take the values out in order, and set the variables. If that works, although the variables will be set a little bit later than before, they will be set in order, with none of the updates being dropped. How do I go about doing that?
Best regards,
Tom.
|
|
|
|
|
tobriain wrote: How do I go about doing that?
I don't know what you are asking? You have still not supplied a complete description of your Problem/Goal. Surely putting values into member variables is not the end goal of your processing.
|
|
|
|
|
Thanks again for the help.
It's not the end goal, no. I set variables, do some processing and comparisons based on the updates, fir events, update a GUI, save a log etc. Everything after that is working perfectly. Once the variables are set with the updates, my application works as expected. The only problem is that I'm dropping updates. I'm collecting a value from an 'intray' in an external program - an intray that only has space to store one update. I need a thread that does nothing but collect updates, throw them onto a queue and return immediately.
Then I need to nofify a method that updates are on the queue, and get it to remove the updates in order, set variables accordingly and clear the queue. The problem is that I need to do that without 'locking the queue', because then my other thread will not return to collecting data from the external program in time. . . . Any ideas?
Best regards,
Tom.
|
|
|
|
|
Sounds to me like you have a good handle on what you need to do, but are not certain about the details.
What I perceive that you need is this:
1. You need to declare a class available AutoResetEvent.
2. You need to declare a dynamic list of some sort. In this case Queue would work perfectly.
3. You need to set up a thread that runs when this thread becomes signaled.
4. In your notify event handler do two things,
A. Put the incoming data block/message onto the queue.
B. Signal the autoresetevent that there is data to process.
In your data processing thread, make sure that it runs until all items on the queue are processed before returning to wait for the next signal.
As for locking, use a synchronized queue. That way the locking is done for you. If you're worried that locking the queue will cause the notification method to take too long, then you are not using locks properly. You should only lock the queue when you are adding to it or removing from it. Otherwise there should be no need to lock.
Uhm, yeah I spent 6 years dealing with a very similar situation.
Hopefully this helps.
Phil
|
|
|
|
|
Fantastic. Nose to the grindstone now. .
|
|
|
|