|
pashje wrote: Can I do this using xpath (I haven't find any SQL like "like" method under xpath) or may I choose another strategy?
yes you should
XmlDocument doc = new XmlDocument()
doc.Load(filename);
XmlNodeList list = doc.SelectNodes("//DATA@[your argusments here]");
I suggest grabbing the old book "XML in a nutshell". You need to know a few commands for xpath to get this to work.
Then just to a foreach on the XmlNodeList
foreach(XmlNode node in list){}
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
contains would be the most useful function in this case
XmlNodeList list = doc.SelectNodes("//DATA[contains(.,'123')]");
only two letters away from being an asset
|
|
|
|
|
i create a application in c#, and i want to call other program such as program in namespace 1 call program in namespace 2 , anybody can help?
-- modified at 8:18 Monday 14th August, 2006
|
|
|
|
|
Calculator will launch by this.
System.Diagnostics.Process.Start("calc.exe");
|
|
|
|
|
I'm experimenting with a very basic .Net remoting client server i wanted to make sure i could get it to work before trying something more complex the client server works fine locally i.e. with both server and client on the same machine however when going between two different computers which are local on the network it doesn't work i get a message simmilar to unable to connect to remote server or something to that effect the configuration files are below:
<CLIENT>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="GPSWaypathData, GPSWaypathData" url="tcp://10.34.144.109:8989/GPSWaypathData" />
</client>
</application>
</system.runtime.remoting>
</configuration>
<SERVER>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="GPSWaypathData, GPSWaypathData" objectUri="GPSWaypathData" />
</service>
<channels>
<channel ref="tcp" port="8989" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
Any help would be really apreciated
-- modified at 8:02 Monday 14th August, 2006
|
|
|
|
|
Did you check the firewall settings (Control Panel->Windows Firewall) on the server? It is possible that port 8989 is blocked for incoming traffic. You could try explicitly adding the port to the Exceptions list.
|
|
|
|
|
No theres no firewall in place between either of the computers
|
|
|
|
|
I meant the firewall built into Windows.
Try running netstat -a on the command line to check if the server is running on the port you specified. To check whether the server is reachable from the client, try running "telnet <server ip=""> <port no="">" and see if it connects.
|
|
|
|
|
Hi
Is there Any ApI Function that Give the Current resulation of Windows ??
With Thanks....-><-
MHF
|
|
|
|
|
Try the Screen.PrimaryScreen.Height and Screen.PrimaryScreen.Width properties.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
thanks this Screen.PrimaryScreen.Bounds.Width work
MHF
|
|
|
|
|
Hi to all,
it's urgent.
I know how to build a DirectShow FilterGraph in VC++6, but I dont know it in C#.
How to build a DirectShow FilterGraph in C#?
How to find a Register Filter (in IBaseFilter Interface) using it's name?
How to Connect pins of 2 filters?
If possible explain with example.
please help me.
Thanks & Regards,
Aniket Salunkhe
-- modified at 7:04 Monday 14th August, 2006
|
|
|
|
|
This is a follow on question from:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&XtraIDs=1649&searchkw=hodges&sd=5%2F16%2F2006&ed=8%2F14%2F2006&select=1619517&df=100&noise=5&mpp=50&fr=319#xx1619517xx
I have been able to populate a context menu with data from a database. However I now have the problem of working out which item has been selected from the menu.
This is the code that adds the items to the menu:
private void addPersonalPhonebookItem(string name, string number)<br />
{<br />
ToolStripMenuItem personal = ts_phonebook_personal;<br />
ToolStripMenuItem personalMenuItem = new ToolStripMenuItem();<br />
<br />
personalMenuItem.Name = name;<br />
personalMenuItem.Text = name + " (" + number + ")";<br />
personalMenuItem.Click +=new EventHandler(phonebookMenuItem_Click);<br />
personalMenuItem.Tag = name + number;<br />
personal.DropDown.Items.Add(personalMenuItem);<br />
}<br />
And this is the EventHandler:
void phonebookMenuItem_Click(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("You Just Clicked: " + e.ToString());<br />
}<br />
How do I get the 'name' or 'number' of the clicked item...
Thanks again in advance,
Phil
|
|
|
|
|
void phonebookMenuItem_Click(object sender, EventArgs e)
{
ToolStripMenuItem mnu = (sender as ToolStripMenuItem);
MessageBox.Show("You just clicked: " + mnu.Name);
}
(Hmmm, ever wandered what the sender property did?)
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Thanks for the quick reply... Great stuff...
Phil
|
|
|
|
|
Not a problem, at least you explained your problem more thouroughly than other people. (And also said thanks which is a nice change )
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I have a console project. How do I execute a commandline statement eg.
cd C:\Program Files
He who laughs last is a bit on the slow side
|
|
|
|
|
A simple question deserves a simple answer but unfortunately one cannot be given for this question, it's more complex than you think because
cd C:\Program Files
Is actually interpreted by cmd.exe and is not a system command. If you simply want to launch a file with arguments or something like that then you can use the System.Diagnostics.Process class.
You'll have to provide more information as to exactly what you want to accomplish, are you writing a "wrapper" around the Windows console? (Based solely on the example command you gave).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
I'm currently busy with my application's installer. I have all done, so all I still need to do is to create the database at installation. I have the sql script for that. How I see this I have to do the following. btw I'm using msde for the database..
1 - restart the service, this I want to do via command prompt.
2 - log into osql and the instance with ... osql -E -S machinename\instancename
3 - execute the script file, sending parameters with, the installation path.
I might be able to somehow link step 2 & 3 with the following command...
osql -E -S machinename\instancename -i "path\script.sql"
I'm just not quite sure how to specify the path values that supposed to be within the script file, that is to where it must create the MDF and LDF files.
He who laughs last is a bit on the slow side
|
|
|
|
|
NeroToxic wrote: I'm just not quite sure how to specify the path values that supposed to be within the script file, that is to where it must create the MDF and LDF files.
Best bet would be to generate the script on the fly. This way to can specify absolute paths in the script and not get bogged down with the current working directory which can cause big problems sometimes.
NeroToxic wrote: He who laughs last is a bit on the slow side
Love it
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed.Poore wrote: Best bet would be to generate the script on the fly.
I was afraid that would be the case
But many thank for all the help, appreciated.
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi,
I want to make a search with xQuery but while I am a beginner I got an "invalid token" with my query and cannot figure it out why it occurs.
Here is my xml part :
<archive><br />
<image name="" path=""><br />
<olay><br />
</olay><br />
<yer><br />
</yer><br />
<zaman><br />
<gecegunduz><br />
</gecegunduz><br />
<saat><br />
</saat><br />
<gun><br />
</gun><br />
<ay><br />
</ay><br />
<yil><br />
</yil><br />
</zaman><br />
<anahtar><br />
<item><br />
</item><br />
</anahtar><br />
</image><br />
</archive>
and this is my query :
query = "for $x in /archive/image return if ((contains($x/@name," + c + ") or (contains($x/@path," + c + ") or (contains($x/olay," + c + ") or (contains($x/yer," + c + ") or (contains($x/zaman/saat," + c + ") or (contains($x/zaman/gun," + c + ") or (contains($x/zaman/ay," + c + ") or (contains($x/zaman/yil," + c + ") or (contains($x/anahtar/item," + c + ")) then return $x";
I simply follow the pattern of msdn :
XPathDocument xPathDoc = new XPathDocument(@"C:\test.xml");<br />
XPathNavigator xPathNav = xPathDoc.CreateNavigator();<br />
XPathExpression xPathExpr = xPathNav.Compile(query);<br />
XPathNodeIterator xPathIter = xPathNav.Select(xPathExpr);
so what is wrong with this ? Please help..
p.s. : the exact thing I try to do is making a complete search inside my xml document. when the user writes something in the textbox and click search, using this query, I try to get every node containing the keyword anywhere inside..
best regards..!
-- modified at 6:34 Monday 14th August, 2006
.:: Something is Wrong ::.
|
|
|
|
|
Hi.
Im working on a MDI-application in C#.
For this i want to realize modal dialogs, which are only valid for the calling mdi-child.
that means, if i activate/click on another mdi-child, it will be activated, despite of the modal dialog in the other child.
in my current approache i show a modal dialog as a normal form. by handling the activate/deactivate-events i tried to simulate the behaviour of a modal dialog by calling the Activate()-method on the form that should be modal. but that doesn't work.
i tried to call Activate() on the modal form in the Deactivate-handler of itself and in the Activate-handler of the owner. both doesn't work.
is there perhaps any possibility to cancel the deactivation of a form?
here is the relevant code in the main-form:
//method in the MainForm, that is called when an MDI-child wants to show a dialog
public void ShowAsModalForm(MdiForm modal, MdiForm owner)
{
owner.Tag = modal; //save current displayed dialog for the child in a member-variable
modal.Deactivate += new EventHandler(Modal_Deactivate);
owner.Activated += new EventHandler(ModalOwner_Activated);
modal.Show();
}
//the owner of a modal dialog was activated
void ModalOwner_Activated(object sender, EventArgs e)
{
Form owner = sender as Form;
if (owner != null)
{
Form modal = owner.Tag as Form; //getting the current modal-form form the member an activate it
if (modal != null)
modal.Activate();
}
}
//the modal dialog was deactivated
private void Modal_Deactivate(object sender, EventArgs e)
{
Form modal = sender as Form;
if (modal != null) //activate it
modal.Activate();
}
the ModalOwner_Activated-Method seems never called, though registered in Activated-event.
the other possibility is Modal_Deactivate, which is called on deactivation but modal.Activate() has no effect, not thinking about thats the wrong way, because by handling the deactivate-event i can't decide if the modal dialog should be shown or not (because the user clicked on a other mdi-child).
Can anyone help me?
thx
|
|
|
|
|
Hi All,
I have an EXE program which runs as a Windows Service on my Windows 2000 professional system. The programs runs fine while running as a service. The problem is that if I log off the current user, the my service stops. But if we refer to the SQL Server service manager, it continues to run if we log off or shutdown or restart the system . Even the actions are reflected in every login. Like if in any login we stop the SQL Server Agent, then in other login(on the same system) also the SQL Server Agent is in stopped status.
So howcome i implement this kind of functionality in my windows service.
Any help will be greatly appreciated
Thanks in advance
Deepz
|
|
|
|
|
Why not you check which user account it is using to run.
The sql service could be using some account like "service account" or "local system account". you might need to use something like that to keep your exe running.
Hope this helps
- ashish
|
|
|
|