|
|
I need a program that will run on a server that will be sitting idle waiting for a website to send it an xml file. when the xml file gets sent to the server I need to parse the xml file and insert some of the data into a oracle database.
The program needs to be a http listener.
the xml file will be small.
Where do I start for making this program?
Does anyone know if Oracle has a function like this built into it?
Thanks all.
|
|
|
|
|
You can do it in .NET really easy.
All you need to do is a Web Service, the site will call a method on that web service and pass the data, and then the web service will insert into Oracle.
|
|
|
|
|
How do you do this??
Can you make it so that an automatic method is called all the time. I cant make the server call a method. all I can do is enter in the address of my server and that is what the other server will send the XML file too.
I know usually you need to call a method, but is it possible to have it call a default method or somehting like that? Any Ideas?? Thanks all.
|
|
|
|
|
Hi.
1) I have a table in a database with a column of type DateTime. Im my application i have a "select" query in which i want to compare a local DateTime variable called mydate with the one in the database, something like:
" SELECT.... WHERE myTable.date1<'"+mydate+"' ".
Can you tell me the right syntax for this?
2) I have SELECT command and i read the result with a reader (while(myReader.Read()). The problem is that this command retrieves me at least 2 elements (let's say rows) from the table, but i only can read the first one. Is there a solution?
Thanks!
|
|
|
|
|
1. Use parametized queries. See SQL Injection Attacks and Some Tips on How to Prevent Them[^] for information on why.
string sql = "SELECT ... WHERE DateField < @Date";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@Date", mydate);
SqlDataReader rdr = cmd.ExectueReader()
while(rdr.Read())
{
} And that also answers 2.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Anyone knows how to change the MAC of the first Network adapter using C#?
Thanks
|
|
|
|
|
Why do you want to?
Maybe this helps -->
MAC INFO[^]
I do not mind getting old. It beats all the other options that can think of.
|
|
|
|
|
I need this feature for a LAN application, I can provide to the user an interface with IP, Mask, Gateway and DNS configuration but not the MAC, so if anyone tryed this in C# please let me know.
|
|
|
|
|
Yeah, but WHY would you want to change the MAC? There are valid reasons to do so, but they are rarely ever used.
Changing the MAC address doesn't follow any "standard" methods. It's going to be different from vendor to vendor, hence, you'll need to consult with the vendor of the card your using to get the methods they supply in their drivers.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible to share static variables across AppDomains?
I want to write an application like NUnit (for a different purpose). I wanted to replicate NUnit's ability to recognize test fixtures and tests by just placing attributes over my classes and methods. But my application has some variables that I'd like the dynamically loaded assembly (loaded in a different AppDomain) to be able to use. I can pass them as MBR objects, but then for that I've to force implementors of the dynamically loaded assembly to implement a particular interface.
It would be nice if I could just "inject" my static variables into the newly created AppDomain so that the loaded assembly can use it directly. Is there any way I can do it?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi
I have a set a breakpoint on a method in which a Thread is being started,after stepping through,its giving error
An unhandled exception of type 'System.Threading.ThreadStopException' occurred in mscorlib.dll
Additional information: Thread was being stopped.
and this is giving on line where its accessing TextBox,most prolly unable to access MainThread?
how could i resolve this?
Thanks
MyBlogs
http://weblogs.com.pk/kadnan
|
|
|
|
|
|
Please show me you code. I can help if I can see you code that is giving you these exceptions.
|
|
|
|
|
Once a user edits the label in my listview control, I need to make sure that the label is in all upper case. So I'm using the AfterLabelEdit event to view what the new label is and to change it to upper case if I need to. Here is the code I've written:
private void AfterLabelEdit(object sender, System.Windows.Forms.LabelEditEventArgs e)
{
string labelText;
int ItemIndex;
labelText = e.Label;
ItemIndex = e.Item;
listView1.Items[ItemIndex].Text = labelText.ToUpper();
}
Unfortunately, this does not work. The label still will have lower case letters. Does anybody know what I'm missing here?
Frustrated Detroit Tiger Fan
|
|
|
|
|
Using .NET Reflector, I found this code (in ListView.WmReflectNotify ):
this.inLabelEdit = false;
NativeMethods.NMLVDISPINFO nmlvdispinfo1 = (NativeMethods.NMLVDISPINFO) m.GetLParam(typeof(NativeMethods.NMLVDISPINFO));
LabelEditEventArgs args2 = new LabelEditEventArgs(nmlvdispinfo1.item.iItem, nmlvdispinfo1.item.pszText);
this.OnAfterLabelEdit(args2);
m.Result = args2.CancelEdit ? IntPtr.Zero : ((IntPtr) 1);
if (!args2.CancelEdit && (nmlvdispinfo1.item.pszText != null))
{
this.Items[nmlvdispinfo1.item.iItem].Text = nmlvdispinfo1.item.pszText;
}
return;
As you can see, the new text of the ListViewItem is set after the AfterLabelEdit event, so any changes you make in the event handler will be overwritten.
I know I'm not solving your problem, but at least I'm telling you why it happens.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
That definitely explains why my text is still in lower case.....but, thanks to Luis, I figured out how to do it. I was missing one line of code. After I set the label text in the listview control so that all the text is in upper case, I then cancel the edit so that the text that I want is not overwritten.
listView1.Items[ItemIndex].Text = LabelText.ToUpper();
e.CancelEdit = true;
Thanks for the help!!!
A not so frustrated Detroit Tiger Fan
|
|
|
|
|
As has been already mentioned, the reason why that happens is because the label text is set after the event.
To counter that you just need to add one more line at the end of your code:
e.CancelEdit = true;
So your new code will look like:
private void listView1_AfterLabelEdit(object sender, System.Windows.Forms.LabelEditEventArgs e)
{
string labelText;
int ItemIndex;
labelText = e.Label;
ItemIndex = e.Item;
listView1.Items[ItemIndex].Text = labelText.ToUpper();
e.CancelEdit = true;
}
--Aditya
|
|
|
|
|
In a C# application, I want to kill another application. If I use the Process.Kill method, I get unpredictable behaviour on my PC that even forces me to re-logon.
Probably, the killed application leaves open resources.
If I use the Process.CloseMainWindow, the application displays a dialog asking for confirmation to exit. How do I respond to that from my C# application?
Are there other solutions?
Thanks in advance.
Meo
|
|
|
|
|
In the past I've always used the Process.Kill method and it never gave me any problems. Try posting some of your code so we can find out what you might be doing wrong. Here's how I've done it in the past:
Suppose you want to write a method that takes a string as a parameter and that sting is the name of the process you'd want to kill:
<br />
private void KillProcess(string processName)<br />
{<br />
Process[] processes = Process.GetProcessesByName(processName);<br />
<br />
foreach (Process p in processes)<br />
{<br />
p.kill()<br />
}<br />
}<br />
|
|
|
|
|
I have stripped my code as much as possible to isolate the problem.
If I try to kill another application, say notebook, it works fine.
So I think it must be rtrobo.exe leaving resources that causes troubles.
Note: this code is only used in debug mode.
static void Main(string[] args)
{
Process robotProcess = new Process();
robotProcess.StartInfo.FileName = @"C:\Program Files\Rational\Rational Test\rtrobo.exe";
robotProcess.StartInfo.Arguments = @"Test_001 /user admin /project e:\Sobek\TestcasesNew\Testcases.rsp /build 'Build 1' /NoLoginServices /logfolder Default /play /log Mylog /nolog";
robotProcess.Start();
// In debug mode, wait until rtrobo finishes startup.
Process [] procs = Process.GetProcessesByName( "rtrobo" );
for (int i=0; i
|
|
|
|
|
Hi,
I'm newbie in c# and I create a windows Application.
I want to call a c function in my program.
(I want to call libTiff function)
How can I do this?
Regards.
Have a nice day
bibax en fait un max!
|
|
|
|
|
|
Thx for reply, it seems to be what I search.
Now I have to understand it and use it.
thx
Have a nice day.
bibax en fait un max!
|
|
|
|
|
HI,
I need to get the value of Address from XML file and want to display this Attribute value on Label
Pls tell me the XPATH for Retriveing value of Address
I also need the valie of lastjob
How should i do validation the values from XML file because there can be multiple enrty from user into XMl file how can i select a particular node from XML file
Fomat of this file is as given below
-----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
- <root>
- <farm-config>
- <farm name="dev1">
- <connection address="192.168.1.3" user="ohm" selectedConnection="1" password="sanjeev">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
- <database state="0" name="bd_house1" sourceType="Monkey">
- <tables state="0" name="CAT">
<columns state="0" name="DATE" />
<columns state="0" name="TIME" />
<columns state="0" name="DAY" />
<columns state="0" name="MONTH" />
<columns state="0" name="YEAR" />
<columns state="0" name="PRODWEEK" />
<columns state="0" name="PRODDAY" />
<columns state="0" name="WEEKDAY" />
<columns state="0" name="SILO" />
<columns state="0" name="CAR" />
<columns state="0" name="PRODUCT" />
<columns state="0" name="VOLUME" />
</tables>
- <tables state="0" name="DOG">
<columns state="0" name="DATE" />
<columns state="0" name="TIME" />
<columns state="0" name="DAY" />
<columns state="0" name="MONTH" />
<columns state="0" name="YEAR" />
<columns state="0" name="PRODWEEK" />
<columns state="0" name="PRODDAY" />
<columns state="0" name="WEEKDAY" />
<columns state="0" name="SILO" />
<columns state="0" name="CAR" />
<columns state="0" name="PRODUCT" />
<columns state="0" name="VOLUME" />
</tables>
</database>
</farm>
</farm-config>
</root>
Regards
sanjeev
|
|
|
|