|
hi, how can i read an xml file and put its elements values on textboxes
Thanks alot
Hamody
|
|
|
|
|
Use XmlDocument and see MSDN about XmlDocument.
for example :
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"c:\myfile.xml");
xmlDoc.ChildNodes...... etc.
|
|
|
|
|
thanks a lot for your rapid help,
may u please send me the URL for this sample cause am working now on the project and it has to be done as soon as possible
Thanks alot
Hamody
|
|
|
|
|
See this sample from this forum:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&mode=all&userid=1957547&select=1569224&df=100&mpp=50&fr=263#xx1569224xx
|
|
|
|
|
My need is when a client request for listening music,instead of streaming ,i want to save that requested file in the client machine & play it using <embed /> tag,the saving of file is done in backside the client will n't know about it,But when i download that file it ll pop up the window for saving or open or cancel,which i don't need,my procedure seems like streaming of the file.
Bibhu Shankar Panigrahi,
Software Developer
|
|
|
|
|
In one of my VB6 Application, I have used MSXML2.ServerXMLHTTP50 Object to send XML message to other application(Tally7.2 Accounting Software) and receive response in XML from it. I communicate it by giving Computer IP address and Port Number of Tally.The Code is
Dim serverHTTP As New MSXML2.ServerXMLHTTP50
ReqListOfCmp = _
"<ENVELOPE>" & _
" <HEADER>" & _
" <TALLYREQUEST>Export Data</TALLYREQUEST>" & _
" </HEADER>" & _
" <BODY>" & _
" <EXPORTDATA>" & _
" <REQUESTDESC>" & _
" <REPORTNAME>List of Companies</REPORTNAME>" & _
" <STATICVARIABLES>" & _
" <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>" & _
" </STATICVARIABLES>" & _
" </REQUESTDESC>" & _
" </EXPORTDATA>" & _
" </BODY>" & _
"</ENVELOPE>"
PortNo = txtPortNo.Text
serverHTTP.Open "POST", "http://localhost:" & PortNo, False
serverHTTP.send ReqListOfCmp
respListOfCmp = serverHTTP.responseText
Problem is That now I want to do the same thing in C#. What class i have to use in place of MSXML2.ServerXMLHTTP50. As I have to communicate using XML over Http with a Non DotNet Application(i.e Tally). I have tried to search with Remoting but as Server is one of the Non-Dotnet application I am not able to do it.
Plz help me , its urgent..................Thanks in Advance
Abhinav
|
|
|
|
|
I have a DataGrid in a web page which displays results. Now I
want to show some string contents instead of numeric values of a field.
For example I have a field "Type" with (0/1) values and I want to show
(Individual/Company) instead of (0/1) numbers.
I'm using C# .NET
Thanks.
|
|
|
|
|
I'm new to C# and now i need help in saving a .doc file with pre-filled information and use bookmarks to update certain aspects of data in that file like address and name, taken from a database.
none
|
|
|
|
|
Is there an easy way in C# to quary all tables from a database and write them to a XML-file (basically turning a database into XML)?
Johan
|
|
|
|
|
If you get get the database into a dataset (which is very highly likely ) then you can use the DataSet.WriteXml function, does exactly what it says on the tin
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
|
|
|
|
|
This is only a design thread , its not much of a question , I just want to see what other people think is the right way..
Lets say you have 2 interfaces that have a 1-1 relation to eachother.. those two interfaces that can never be used w/o the other.
(eg in a model view presenter scenario where you have a view interface and a presenter class)
normally when a class might be used by multiple consumers it would be correct to use delegates/events to notify the consumer when something have happened.
however in a 1-1 scenario, you could just as well let them be aware of eachother and simply let them call specific methods in eachother.
What is your take and arguments on this?
I myself consider the last approach the most correct from a business perspective, since it does what it should and result in far less code that is still easy to maintain and have no drawbacks over the event based approach.
but the event based approach somehow still _feels_ like the correct way... maybe because it often is the correct way , but in other scenarios?
ideas and arguments please
http://www.puzzleframework.com
|
|
|
|
|
Can you guarantee that no class in the future would like to be notified of the change? If so then strongly couple them, otherwise you may want to stick with the event approach to allow others in future to subscribe and be notified.
I prefer open approaches that let me hook on functionality later, but I sometimes closely couple classes if im sure its right.
---
How to get answers to your questions[^]
|
|
|
|
|
Keep it simple, if it needs to accomodate more complex scenarios in the future it can be modified. Never go more complicated than necessary. Then again, what's the harm in adding events, even if you don't currently use them? My philosophy anyway... And Kent Beck would likely agree.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
I have an array of objects that i want to add to a DataGridView.
The objects have properties Header, Status, Date and Id (that in this case matters).
Now i only want to show Header and Status in the DataGridView, but i still want the whole object to be bound to the row so that i dont loose the identification (Id) to the object in the array.
How do i do this?
R
Johan
|
|
|
|
|
Maybe this artical helps
http://www.codeproject.com/cs/database/BindArrayGrid.asp
Also, if you don't want to show some column in runtime, simply hide it (.Visible = false).
|
|
|
|
|
Hello Sir
I want to know what is a Batch files.
How can it work and how can we make it.
Practic Makes Man Perfect
|
|
|
|
|
Batch files are files in Windows in which you write a batch(sequence) of DOS commands those are executed one by one when you run the batch file. There are also some conditional constructs like if, else for batch files too.
They can be constructed by simply making a notepad or anyother text editor file and changing its extension to .bat. A batch file can be executed by simply clicking on it.
Regards,
Wasif Ehsan.
|
|
|
|
|
|
Dear Respected Programmers
Hi,
Kindly send me the method or Source Codes that How to use Crystal Report 10 in C# 2005 and which references are needed in design time. {mriazkse@yahoo.com}
Thank you in Advance
|
|
|
|
|
M Riaz Bashir wrote: Dear Respected Programmer
:->
M Riaz Bashir wrote: Kindly send me the method or Source Codes that How to use Crystal Report 10 in C# 2005 and which references are needed in design time.
Try Google[^]
|
|
|
|
|
Is there an easy and efficient way in C# to read a file in blocks, remove all carriage return & line feed characters from the read block and write the remaining block into another file?
I've tried FileStream, StreamReader and StringBuilder without success. I'm obviously missing something here, being a newby in C#.
VagaBond
|
|
|
|
|
Hy,
Try this:
//reading from the file.txt
FileStream fstream = File.Open("file.txt",FileMode.Open);
byte []buffer = new byte[fstream.Length];
fstream.Read(buffer,0,buffer.Length);
string message = System.Text.Encoding.ASCII.GetString(buffer);
message.Replace("\n","");
fstream.Close();
//writing fileSave.txt
fstream = File.Open("fileSave.txt",FileMode.Create,FileAccess.Write);
buffer = System.Text.Encoding.ASCII.GetBytes(message);
fstream.Write(buffer,0,buffer.Length);
fstream.Flush();
fstream.Close();
You use the Replace method to replace the CRLF. If this doesn't work only with replacing '\n', try replacing '\r' too.
There could be another way in this example. In the byte array "buffer" search for 13(ascii decimal value for CR) and 10(LF) values that are sequential. If you find these values delete them from the byte array
Do your best to be the best
|
|
|
|
|
Hi Karkster,
You're the man!!! It works. Thanks a million, pal...
VagaBond
|
|
|
|
|
If you use the ReadLine method, it reads up to a newline, but does not read the newline.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
When adding anything new record, for example a new car, is it always wise to validate the input parameter?
The code that I have is as follows:
public static int InsertCategoryGroup(Car objCar)
{
// Validate parameter
if (objCar == null)
throw (new ArgumentNullException("objCar"));
}
Is this the correct way to do it, or is there a better way? Am I throwing the correct exception, or is there more that I need/can throw. Please can someone comment.
Regards,
ma se
|
|
|
|