|
hello... tried the method but i was getting only the background color of the panel ie only white bitmap when the panel was of color white... the bitmap didn't have the square that i drew on the panel...
haseeb
|
|
|
|
|
Hi,
you must do all drawing in the Paint event handler; if you dont you will not see
your drawing when for some reason the control needs to be redrawn (e.g. when
your form gets restored from minimized/maximized, when an overlapping form gets removed,
when printing, etc).
When you change the things that need to be drawn, just call Invalidate() to fire
the paint event.
|
|
|
|
|
Initially XML file is like this
<?xml version="1.0" ?>
<lasers>
<laser LaserName="Laser1" ModelName="Nufern v1.0" SerialNo="1" ManufacturerName="Nufern v1.0" Maximumpower="200w" >
<properties">
<image>CW-Waveform.jpg</image>
<WaveTypes>
<WaveType Name="CW Ramp" url="ramp.html" isavailable="true" />
<WaveType Name="CW Analog" url="analog.html" isavailable="true" />
</WaveTypes>
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true" units="C"
gauge="false" thresholdval="10" />
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="false" units="C"
gauge="true" thresholdval="10" />
</tabular>
</properties>
</laser>
</lasers>
then
>>>>>>>>>>>>>>>>>>>>namespace is EncryptDecrypt
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Application.StartupPath + @"\laserProp.xml");
XmlNamespaceManager mgr = new XmlNamespaceManager(xmldoc.NameTable);
mgr.AddNamespace(string.Empty, "urn:MyNamespace");
XmlNodeList xmlnodelist;
XmlElement ele = xmldoc.DocumentElement;
xmlnodelist= ele.SelectNodes("//lasers//laser//properties//tabular//property",mgr);
Is working fine but, to validate xml with xsd i made changes to the xml as
<?xml version="1.0" ?>
<lasers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:MyNamespace" xsi:schemaLocation="urn:MyNamespace
laserProp.xsd">
<laser LaserName="Laser1" ModelName="Nufern v1.0" SerialNo="1" ManufacturerName="Nufern v1.0" Maximumpower="200w"
xmlns="urn:MyNamespace">
<properties xmlns="urn:MyNamespace">
<image>CW-Waveform.jpg</image>
<WaveTypes>
<WaveType Name="CW Ramp" url="ramp.html" isavailable="true" />
<WaveType Name="CW Analog" url="analog.html" isavailable="true" />
</WaveTypes>
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true"
units="C" gauge="false" thresholdval="10"/>
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100"
pwd="false" units="C" gauge="true" thresholdval="10"/>
</tabular>
</properties>
</laser>
</lasers>
Now the same xpath is not working
I also tried with urn:EncryptDecrypt but no result
please help me on this
Thanks in advance
-- modified at 7:06 Saturday 14th April, 2007
|
|
|
|
|
Initially XML file is like this
<lasers>
<laser lasername="Laser1" modelname="Nufern v1.0" serialno="1" manufacturername="Nufern v1.0" maximumpower="200w">
<properties">
CW-Waveform.jpg
<wavetypes>
<wavetype name="CW Ramp" url="ramp.html" isavailable="true">
<wavetype name="CW Analog" url="analog.html" isavailable="true">
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true" units="C"
gauge="false" thresholdval="10">
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="false" units="C"
="" gauge="true" thresholdval="10">
then
>>>>>>>>>>>>>>>>>>>>namespace is EncryptDecrypt
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Application.StartupPath + @"\laserProp.xml");
XmlNamespaceManager mgr = new XmlNamespaceManager(xmldoc.NameTable);
mgr.AddNamespace(string.Empty, "urn:MyNamespace");
XmlNodeList xmlnodelist;
XmlElement ele = xmldoc.DocumentElement;
xmlnodelist= ele.SelectNodes("//lasers//laser//properties//tabular//property",mgr);
Is working fine but, to validate xml with xsd i made changes to the xml as
<lasers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:MyNamespace" xsi:schemalocation="urn:MyNamespace
laserProp.xsd">
<laser lasername="Laser1" modelname="Nufern v1.0" serialno="1" manufacturername="Nufern v1.0" maximumpower="200w"
xmlns="urn:MyNamespace">
<properties xmlns="urn:MyNamespace">
CW-Waveform.jpg
<wavetypes>
<wavetype name="CW Ramp" url="ramp.html" isavailable="true">
<wavetype name="CW Analog" url="analog.html" isavailable="true">
<tabular>
<property id="228" name="BRM" currval="0" prgbar="true" selected="true" min="0" max="100" pwd="true"
units="C" gauge="false" thresholdval="10">
<property id="200" name="Output power" currval="0" prgbar="true" selected="true" min="0" max="100"
pwd="false" units="C" gauge="true" thresholdval="10">
Now the same xpath is not working
I also tried with urn:EncryptDecrypt but no result
praveenkumar palla
|
|
|
|
|
I find it very difficult to believe that you're not the same person who posted the exact same question earlier today, and got the right answer given to them. If this is an incredible co-incidence, go down a page, and you'll see that another user asked the same question, and got the right answer as to what the problem is.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
I have a listview with items. I select, for instance 2 items for removal. I run my code to remove in database, wich work just correct.
Then i run my method for fill, in a class, to refill the listview from database.
In the case where i selected 2 items only 1 disappered from the listview, the other is still showing. If i select 1 item, that one is still showing after the fill.
I do not understand what happens. I rather new in C# but i have done the same in VB.NET and FoxPro 9.0 and i have no problems.
Here is the code. Anybody that can tip me about whats wrong ?
if (result == DialogResult.OK)
{
clsReadKatalog clsReadKatalog;
clsReadKatalog = new clsReadKatalog();
foreach (int idx in this.Katalog.SelectedIndices)
{
String xid = this.Katalog.Items[idx].SubItems[5].Text;
int tabortid = this.Katalog.Items[idx].Index;
clsReadKatalog.TaBortPost(xid); // DELETE FROM DATABASE
}
String urval = null;
urval = "SELECT * FROM pwd WHERE ownid="
+ "'" + this.GlobalAnvändare + "'"
+ " AND posttyp='1'";
OdbcDataReader Reader = clsReadKatalog.LäsKatalog(urval);
if (Reader.HasRows)
{
clsReadKatalog.FyllKatalog(Reader, this.Katalog); // REFILL FROM DATABASE
}
Here is the code for fill listview: This is the same method i run the first time, to fill the listview, before i make my selection for remove, and then it pick right from database.
public void FyllKatalog(OdbcDataReader Reader,ListView Lista)
{
Lista.Items.Clear();
int x=0;
while (Reader.Read())
{
Lista.Items.Add(Convert.ToString(Reader["beskr"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["anv"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["pwd"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["privatekey"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["vektor"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["id"]));
x += 1;
}
Reader.Close();
}
With Kind Regards
Heino
Heino Nurmik
|
|
|
|
|
henur wrote: String xid = this.Katalog.Items[idx].SubItems[5].Text;
int tabortid = this.Katalog.Items[idx].Index;
clsReadKatalog.TaBortPost(xid); // DELETE FROM DATABASE
Wouldn't a proc that takes a collection of Ids to delete make more sense ? What is tabortid used for ?
henur wrote: Lista.Items.Clear();
int x=0;
while (Reader.Read())
{
Lista.Items.Add(Convert.ToString(Reader["beskr"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["anv"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["pwd"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["privatekey"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["vektor"]));
Lista.Items[x].SubItems.Add(Convert.ToString(Reader["id"]));
x += 1;
}
Reader.Close();
If this pulls out data you thought you deleted, then you can't possibly have deleted it. Unless the reader was created before something was deleted, but that doesn't seem possible, either.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ok , "tabortid" is just a remaining after that i removed the items by the selected items.index.
But about the deletion, yes they are removed in the database. In debug-mode i do a hold, and then open the access-database and check the table....and they are gone.
And really, i have a similar problem in an other place. When i add a item, when i refill the listview the new one is not added to the view, but be sure! ...it is in the database.
So...i don't get it!
|
|
|
|
|
What you're describing is not possible. If you delete a row, and refresh from the DB, the row will be gone, unless you don't clear the control first ( and I see, you did ). So, something else is going on here.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That's true...something else....
Well , i will go thru my code again and see if i can find anything that could cause my problem.
As you said earlier "...if the reader is created before.." in some way the problem "feels" like that. So i will check that possibility.
Heino
|
|
|
|
|
hi ...
i wan to export data in sql server 2005 with wizard but take follow error !!!!!
"Only part of a ReadProcessMemory or WriteProcessMemory request was completed (System)"
is any query (in sql server) that i can export data ?
thanks
|
|
|
|
|
What does this have to do with C#? It belongs in the SQL Forum... But I see you've already asked it there!
|
|
|
|
|
[Serializable]
Class A
{
public event Handler OnChange;
public A()
{
this.OnChange += new Handler(this.Save);
}
public void Save()
{
filestream.Save(Serialize(this));
}
}
class B
{
A myA;
public B()
{
myA = new A();
why doesn't it serialize myA, but it tries to serialize B ?
THANKS ALOOOOT to the one\s who help me solve this.
NaNg.
|
|
|
|
|
I don't see why that should happen, what is the 'stuff' that you do ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
set a property which checks if this.OnChange != null and if not it triggers it.
|
|
|
|
|
nevermind, I found the problem while debugging.
It saved in the event B from some reason.
I just added: [field: NonSerialized()]
to every event.
It works fine now.
Thanks anyways
|
|
|
|
|
HI all,
i am using ClickOnce to deploy my application, whenever i run the below code its asking me to check is ur application is running under click once,
my code,
if (ApplicationDeployment.IsNetworkDeployed)
{
// Hold a reference to the current deployment
ApplicationDeployment currentDeploy = ApplicationDeployment.CurrentDeployment;
// Check to see if an update is available on the server
if (currentDeploy.CheckForUpdate())
{
// One is available, go get it
currentDeploy.Update();
// Make sure you save application state here
DialogResult dr = MessageBox.Show(
"Update downloaded, restart application?",
"Application Update", MessageBoxButtons.YesNo);
if (dr == DialogResult.Yes)
{
Application.Restart();
}
}
}
if (ApplicationDeployment.IsNetworkDeployed)
if i din't use this ApplicationDeployment.IsNetworkDeployed, its giving INVALIDDEPLOYMENTEXCEPTION--Application not installed.
Please help me how to overcome this thing..
Thnx in advance,
prashanth
|
|
|
|
|
i need to convert from network stream to byte[]...
please help
|
|
|
|
|
What does the code look like ? ( I'm curious how a network stream looks, is it just a stream object ? )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
TcpListener tcpListener = new TcpListener(2112);<br />
tcpListener.Start();<br />
TcpClient tcpClientIP = tcpListener.AcceptTcpClient();<br />
NetworkStream nsIP = tcpClientIP.GetStream();<br />
StreamReader srIP = new StreamReader(nsIP);<br />
string resultIP = srIP.ReadToEnd();
as u can see the last result is a sting... but before that i need it to be byte[] because i am using an encryption...
|
|
|
|
|
OK, converting a string to a byte[] is pretty easy, why do you need to convert it *before* it's a string ? You read a stream using the methods it offers, does it offer one to read a byte [] ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
the received stream is encrypted... and the encryption methode i used is dealling with the byte[]
so i need to convert the stream to byte[] first and then decrypte the byte[], then convert it back to string
|
|
|
|
|
Hello everyone, I have this problem when saving Arabic letters into Oracle do you think it's the dataset?? please help.
ps. I keep getting "???? ?? ????"
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
What's the datatype you're trying to store into ? What's the SQL look like ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
VARCHAR2, and im trying to store some Arabic text
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|