|
ihe wrote: 1. How can I make a program’s able to link with its database independent of location?
You need to specify the server location in your connection string, so, in practical terms searching for your database is not feasible - you would need to connect to every instance of every server and see if your database was on that server. There would eb all sorts of security issues, and if the database existed on multiple servers which would you use.
ihe wrote: 2. How can I link the two? The front-end is not in the same computer as the database.
See answer 1, using the conneciton string. A good source of info is www.connectionstrings.com[^]
ihe wrote: 3. How can I make my apps able to read/ write real-time data?
Not sure what you mean. You write to and read from a database in real time.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thanks. www.connectionstrings.com is very good.
Real time:
Let us assume that there is an on-going continuous process. I want to be able to monitor it, without being present. I want to design a program that would write the start time / end time to a database without a user clicking a button. The program would monitor and detect when the process is ongoing.
If there is any variable associated with this process, the program would write these values in the database as well.
The program should write the values as the process is occurring. It should not involve any human interference as this would cause a loss in time (lag time) for the human to click the control (for saving).
The program should monitor, detect and write the event as fast as the process occurs. A type of survellience.
Please explain how I would go ahead in this program
ihe
|
|
|
|
|
ihe wrote:
Please explain how I would go ahead in this program
Its your coursework, not ours Have a try and come bac with specific problems, but if you have no idea where to start ask your tutor.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I have listview that contain multiple groups.
each group has multiple items.
when I select single item it gets highlighted.
but when I click on group the listview item selection is changed. I get no item selected.
What I should I do to keep the item selected unless user clicks on other item not group.
Please tell.
|
|
|
|
|
Hi
Is there any way in which i can convert a xml file to a word document..can u please demonstrate with a small example??
|
|
|
|
|
You can use word interop to write xml file's content to word document. If you google 'how to create document with word interop' you'll find tons of examples.
|
|
|
|
|
Now i am already using the interop object.I just want to know if this can be done in any other way.
|
|
|
|
|
|
What I am wanting to do is something along these lines but I can not figure out how to do it, if it is at all possible...
What I want to do is place several shortcuts directly into a folder onto the desktop and place a icon onto that folder.
(easy enough)
Now for the problem arises. I am now needing to make the folder on the desktop with the icon act like a autorun. That is to say if the user double clicks the folder for the folder to automatically open the default shortcut instead of opening the folder displaying all the shortcuts.
We want the shortcuts to be availiable but only if they rightclick the folder and say explore.
Any Ideas?
Both in how to do this manually, then in how to do this in code. But If I could figure out the manual part I probably could figure out the code.
|
|
|
|
|
This sounds messy and complicated for the end user ( because you want a folder to not act like a folder ).
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As you want to alter the default behaviour of a folder, thats going to be very tricky.
One possible hackaround could be, create a new file extension and alter the behaviours. That way you could have a default action of 'open program', but also had a secondary action to open a folder.
The only other possible thought would be to see how you can create those 'special' windows folders (control panel, .net assembly etc) if you could work that out...but that would be a nightmare of registry hacks, and not something I would like to see a program 'do' if I was a user.
|
|
|
|
|
I agree it is not something I would normally be wanting to do but it is being required of me to find a solution like this. It sort of works like the mac application package folder from the research of what their requesting of me.
|
|
|
|
|
Does anyone know how to access a media player playlist and its songs without having to instantiate the AxWindowsMediaPlayer?
[EDIT] I am aware of the wpl location and parse the xml, but doesnt help with the auto playlists.
modified on Tuesday, September 1, 2009 5:19 PM
|
|
|
|
|
Ok, silly question...excuse me while I try to understand exactly how the stack works:
Example:
int a = 123;
int b = 456;
int c = b;
If the stack was horizontal, with first in on the right, you have: c = 456 | b = 456 | a = 123
Now set:
b = 789;
You have: c = 456 | b = 789 | a = 123
Ok, fine, no problem...but how did b get changed if you have to 'pop' c off to get to b?
|
|
|
|
|
Locals in C# do not get on the stack in the MSIL phase. They will, of course, after the JIT compiler has done its job, but that's a different kind of stack.
Both are easy to check:
- for the MSIL way, open the assembly (in the meaning of ".NET assembly" which is a file) with the Reflector and set it to IL view
- for the native way, put a breakpoint somewhere and debug, when you hit the breakpoint open the disassembly window
|
|
|
|
|
Some more info:
For locals, MSIL has stloc and ldloc in various forms, they operate on "local slots" (and the stack of course, to get their operands from, but they don't put their data there)
(talking to myself, yay)
|
|
|
|
|
I'm assuming by stack you mean the stack that the program stores it's local variables in (not one you've produced yourself using the Stack class.
When the variables are stored, the stack is just a way of looking at the specific area of memory. Unlike the .Net Stack class, you don't have to pop things off to access them. The same region of memory could also be treated as a list, a queue, or anything else. The program stores the address of each variable, and then accesses them directly, so you can access b without touching c . Then, when the function finishes, all the variables are popped off of the stack.
This is one of several ways of storing local variables in a function, and is very low level stuff. You shouldn't have to worry too much about it.
Disclaimer: The .Net Framework may do something different to the stack, but the principle should be the same.
|
|
|
|
|
Thanks for the replies, yes I was talking about local variables, and not the Stack class. Yes, I agree that I don't want to worry too much about low-level memory management.
The confusion came about because of all the images on the internet that show the stack as a bunch of boxes on top of each other. Someone asked me that question, and I suddenly realized I couldn't give them an answer!
Thanks again,
--Alex
|
|
|
|
|
Hi,
the stack is a region in memory pointed to by a special register, the stack pointer.
It is special in the sense that some assembly instructions implicitly use the stack pointer:
CALL/JSR push the current PC on the stack
RETURN/RTS pop the old PC value from stack and store it in the PC register
PUSH pops anything onto the stack
POP pops anything from the stack
On top of that, the stack pointer can be used as a regular base register, so indexed addressing is supported. Local variables, while stored on the stack are accessed with an offset (or "displacement") so there is no pushing/popping involved.
Summary: the stack works as a regular stack (implied pushes and pops) when program flow alters (CALL, RETURN); it is used as a memory region (with base address+offset) when local variables are accessed.
All the above is valid at two different levels:
- assembly instructions (as in native code applications);
- .NET environment with IL instructions (managed code).
|
|
|
|
|
I'm having a problem in sorting strings. All the strings are saved in a text file. Now i retrieved the strings from the text file and transferred it into an array. I'll be using radix sort to sort the strings because I think its the most appropriate algorithm to use beside any other sorting algorithm. But first I want to convert all the strings into their corresponding ASCII codes and store all the ASCII codes into a temporary array so I can sort them in a much better way.
Now my problem is always get the FormatException during run-time. How will I solve that error? I already declared an array that's an int type but i still get that error.
using (StreamReader outputLastNames = new StreamReader("lastnames.txt"))
{
for (int i = 0; i < vehicleCountInt; i++)
{
arrayOfLastNames[i] = outputLastNames.ReadLine();
convertedLastName[i] = Int32.Parse(arrayOfLastNames[i]);
}
}
important notes:
convertedLastName[i] is an int[] type
arrayOfLastNames[i] is a string[] type
modified on Tuesday, September 1, 2009 2:42 PM
|
|
|
|
|
OK, I don't get why you want to convert to ASCII, but never mind. What do you get the FormatException on? If you don't show us the code that gives the problem, it is next to impossible to help. Don't paste the lot, just the relevant fragment, and don't forget to enclose it in <pre></pre> markers to preserve the formatting (makes it easier for us to read).
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
How do expect to parse a (person's?) name to an int?
If your last name is 1127 it would work; but not with most names.
|
|
|
|
|
Just a guess, but are you sure all of the characters in the name can be converted to int?
only two letters away from being an asset
|
|
|
|
|
How can a character in a name be converted to an int?
Anyway - this will handle it using the TryParse method, though I suspect you're going to spend most of your time in the else block.
int converted;
if(Int32.TryParse(arrayOfLastNames[i], out converted)
{
convertedLastName[i] = converted;
}
else
{
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Int32.Parse would work with char and not strings. i.e. (char)'A' will be converted to its ASCII equivalent but (string)"A" will not. You will need to get each character of the last name and then convert.
AFAIK .Net uses UTF8 encoding to store strings, probably that is the reason it is not working now.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|