|
i want to write some variables values to an xml file
then
read these files into local variables into myapplication from xml file
ma_refay
|
|
|
|
|
Take a look at the classes in the System.Xml namespace especially XmlDocument , XmlTextReader and XmlTextWriter .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i have about 30 image on my form
5 images per row
i want to store the image_row & image_no in array
so i want 2 dimension arrayto store image position in that way
0,0 first row & first image
2,4 third row & fifith image
and so on
ma_refay
|
|
|
|
|
Hello,
You could use an ArrayList or Hashtable and Add another ArrayList or Hashtable or ImageArray to each member.
All the best,
Martin
|
|
|
|
|
Hi,
I have to store a list as an external file of part codes and corresponding descriptions for later retrieval by other applications. What's the best way of doing it?
Each entry in the list consists of two strings, a part code and a description. I could just write to a text file and read from it again or should I use XML? Anyone have any ideas or examples of how to implement such code?
Thanks
|
|
|
|
|
Personally, I always favor XML over a plain text file. First, you can define an additional schema that allows you and other applications to easily validate whether the XML file contains data in a valid format. Second, you can use XPath to easily lookup the description for a part code. Finally, you are probably able to use the XmlSerializer class to easily create the Xml file in your application; depends on the way the you implemented the list to be stored in your application.?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Use XmlTextWriter .
For part key pairs, try this:
<code>XmlTextWriter </code>writer = new <code>XmlTextWriter</code>(_PartsListFilename, null);
writer.<code>Formatting </code>= Formatting.Indented;
writer.<code>WriteStartElement</code>("parts");
foreach ( <item> )
{
writer.<code>WriteStartElement</code>("part");
writer.<code>WriteElementString</code>("Code", <item>.Code);
writer.<code>WriteElementString</code>("Description", <item>.Description);
writer.<code>WriteEndElement</code>();
}
writer.<code>WriteEndElement</code>();
writer.<code>Close</code>();
Evil cannot be conquered in the world... It can only be resisted within oneself.
|
|
|
|
|
Hi,
I hope someone can help.
I have to import some data from a text file into a database. The text files are loaded into a datagrid to be previewed and validated before being imported.
There are some conditions to the import, each child record must have a pre-existing parent record before it will be imported etc. The validation is handled in a stored procedure.
What I need to do is return all of the values that have failed to import in a collection.
public ItemEventCollection failures = null;
...
public ItemEventCollection EventImport(SecurityContext sc, ItemEventCollection EventCollection)
{
if (EventCollection != null)
{
foreach (ItemEvent itemEvent in EventCollection)
{
try
{
ItemEventInsertCommand.Execute(DataAccessManager(sc), itemEvent);
}
catch
{
failures.Add(ItemEvent);
}
}
}
return failures;
}
If I step through the code, failures always has a count of 0 when I know there are rows failing the import conditions. I need to add them to failures then pass it back to a datagrid.
How?
Do I use the out keyword or simply return the ItemEventCollection, I'm really stumped on this one, please can someone help?
Best regards
Scott
|
|
|
|
|
i am gettting the error message saying that "the google api map key used for this site is registered for different site. also please guide me for coding part,i dnt know what changes should i do in order to be able to view google map written in asp.net.
|
|
|
|
|
How is it possible if an object exists?
At present I have a code similar to this line:
//This retrieves the object...
objectData = MethodName(Name)
If the object does not exist, it goes to the catch statement.
How can I just check if it exists so that it does not go to the catch statement?
Something like:
if (MethodName(Name) not null)
{
}
else if (MethodName(Name) == null)
{
}
Thanks
|
|
|
|
|
if(objectData != null)
{
//do your codings here
}
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
I would like to check something like:
if (methodname(name) != null)
Is this possible?
|
|
|
|
|
yes it is possible
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Yes, but only if the returning value of MethodName is a nullable object. If not your codition is always true.
Post the snippet of MethodName...
Regards,
Mark
|
|
|
|
|
What is "MethodName" doing?
|
|
|
|
|
|
arkiboys wrote: creates an object
How?
|
|
|
|
|
objectData = MethodName(Name);
if (objectData == null)
{
}
else
{
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
i want to convert button style to appear as circle
or
drawing circle on the form and event these circles
ma_refay
|
|
|
|
|
have to create customised buttons with two images one is for up and another one is for down.
when the user clicks the image need to show the down image.
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
hi
can anyone give me a sample application to create delegate in C#?
|
|
|
|
|
MSDN delegates tutorial[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I have created Button control programatically using
Button btn = new Button();
btn.ID = "btn1";
btn.Text = "Button 1";
Panel1.Controls.Add(btn);
i want to set the enable property for this button to be false.
how do i do it
vasu
|
|
|
|
|
|
sorry i have not given the full scenario.
what i want to do is fetch the property and its value from database.
how do i say [ctrl].[property] = [value]
|
|
|
|