|
HI...please anyone tell me how to convert a word document into a xml document.
|
|
|
|
|
Click the "Save As" menu item and in the dialog set the "Save as type" selection to Xml Document
|
|
|
|
|
:-> you took my great answer that's a 5 heh!
|
|
|
|
|
look up the Microsoft Word 2007 object model and see what options are available for saving a document as xml.
The link below discusses how to convert a word document to either PDF or XPS using the word object model. However, if you save it as XPS, you can then retrieve all the XML content. Regardless the article below should give a good insight into using the word object model.
http://msdn2.microsoft.com/en-us/library/bb412305.aspx[^]
|
|
|
|
|
how i fill treeview with checked boxes from database?
from two tables have relations
the frist table will be parent nodes
and secind table will be child nodes
and how i will treat with checked??????
plz answer on me with code or send code to me
on
huss_Aldin@yahoo.com
|
|
|
|
|
I can help you by making parent node and child node in one table
and the code will be
public void LoadItems2Tree (TreeNode parentnode , int ParentID)<br />
{<br />
DataCommand = new SqlCommand();<br />
DataCommand.CommandText = "SELECT * FROM Items WHERE ParentID = @ParentID ORDER BY ItemID " ;<br />
DataCommand.Connection = Connection.SqlCon;<br />
<br />
DataParam = DataCommand.Parameters.Add ("@ParentID",SqlDbType.Int);<br />
DataParam.Value = ParentID; <br />
<br />
foreach (DataRow Dr in QueryResult(DataCommand).Tables[0].Rows)<br />
{<br />
TreeNode MyNode = new TreeNode(Dr["ItemName"].ToString());<br />
MyNode.Tag = (int)Dr["ItemID"];<br />
parentnode.Nodes.Add (MyNode);<br />
LoadItems2Tree (MyNode , (int)Dr["ItemID"] );<br />
}<br />
}<br />
<br />
<br />
public DataSet QueryResult (SqlCommand SqlQuery)<br />
{<br />
DataSet DaSet = new DataSet();<br />
DataAdapter = new SqlDataAdapter(SqlQuery);<br />
DaSet = new DataSet();<br />
DataAdapter.Fill(DaSet , "DataTable");<br />
return DaSet;<br />
}<br />
<br />
remmber one table only , and for the check boxes , may be you can find it in treeview properties
Kind Regards
I know nothing , I know nothing
|
|
|
|
|
Hi,
I have an application where I print bills to POS printer connected to serial port COM1. How can I check if printer in turned on and printer status is ok.
When I do serialPort.Write(myString) I do not get any error.
How can I check printer or serial port status?
Thank, Jure
|
|
|
|
|
Most POS printers have a driver/api so that you can do these things more easily.
THe most common printers (in the UK anyway) are the epson TM80's which can use the epson unified stuff:
http://www.pos.epson-europe.com/support/drivers.htm[^]
If yours is a different manufacturer I'd suggesting checking with them.
|
|
|
|
|
Hi,
I am not using any drivers for my printer because I don't use graphical printing. I send text directly to serial port.
<br />
SerialPort serialPort=new SerialPort("COM1",9600,Parity.None,8,StopBits.One);<br />
serialPort.Open();<br />
serialPort.Encoding = Encoding.GetEncoding(852);<br />
serialPort.Write(stringToPrint);<br />
serialPort.Close();<br />
So I must urgently install driver if I completely understand you.
|
|
|
|
|
In addition to what originSH said, a lot of serial type devices also support a control set, where by you send off some command sequence to the device and expect a response. If you don't get a response (or it times out or whatever), then you know something's up.
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Can you tell me what can I do in my code?
<br />
SerialPort serialPort=new SerialPort("COM1",9600,Parity.None,8,StopBits.One);<br />
serialPort.Open();<br />
serialPort.Encoding = Encoding.GetEncoding(852);<br />
serialPort.Write(stringToPrint);<br />
serialPort.Close();<br />
Thank,
Jure
|
|
|
|
|
how could i change tab page tab hand fold size?
in tabcontrol i have two tab page, so i want to resize their hand hold size which sum of their width must equals to tab control width .
|
|
|
|
|
I think you have to use the Padding property of the TabControl.
|
|
|
|
|
Hi,
in my button_click code I have let's say 4 loops, how can I make them run at the same time and one after another?
|
|
|
|
|
I think I understand what you mean.
To do them at the same time, you will want to nest one loop inside another
<br />
for(int i = 0; i < 10; i++)<br />
{<br />
for(int x = 0; x < 10; x++)<br />
{<br />
Console.Writeline(string.Format("x is = {0}", x.ToString());<br />
}<br />
<br />
Console.Writeline(string.Format("i is = {0}, i.ToString());<br />
}<br />
What will happen is, loop i will initialize, and after executing, it will get to loop x. When it gets to loop x, it will execute, and this output will be produced at the console.
x is = 0
x is = 1
x is = 2 etc etc etc
Once Loop x has finished, loop I will continue, and Loop x will be executed every step through loop i, until it is finished. You could put another loop inside i, or x.
TO run one loop right after another, just do it like you would a regular loop, just with another right after, like so:
<br />
for(int i = 0; i < 10; i++)<br />
{<br />
Console.Writeline(string.Format("i is = {0}, i.ToString());<br />
}<br />
<br />
for(int x = 0; x < 10; x++)<br />
{<br />
Console.Writeline(string.Format("x is = {0}", x.ToString());<br />
}<br />
<br />
Hope that answeres your question
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
suck123 wrote: run at the same time
read about threading
life is study!!!
|
|
|
|
|
threading won't make them run at the same time either (due to time slicing) unless you have SMP and at least 5 CPUs...
it will run the main app spawn the 4 threads for a total of 5 (one is required for the main app) then execute them one at a time like so:
run one thread then save and unload, load the next and run a little bit then save and unload repeat till all of the threads exit... (yes even if the main app exits first!)
|
|
|
|
|
use 4 PCs !
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
hiii
i am unable to find some namespaces in my visual studio 2005 but when i search on microsoft website they exists like Microsoft.DirectX.AudioVideoPlayback
plz help me wat to do and hw?
thnx...
Tarun Suneja
|
|
|
|
|
|
tnks buddy 4 helping me.
bt i am not able to get this link.
i reached upto library page. but nothing after that
plz help......
|
|
|
|
|
|
I found an ftp client class from this site and I used the List Function which is as follows:
public ArrayList List()
{
Byte[] bytes = new Byte[512];
string file_list = "";
long bytesgot = 0;
int msecs_passed = 0;
ArrayList list = new ArrayList();
Connect();
OpenDataSocket();
SendCommand("LIST");
ReadResponse();
//FILIPE MADUREIRA.
//Added response 125
switch(response)
{
case 125:
case 150:
break;
default:
CloseDataSocket();
throw new Exception(responseStr);
}
ConnectDataSocket(); // #######################################
while(data_sock.Available < 1)
{
System.Threading.Thread.Sleep(50);
msecs_passed += 50;
// this code is just a fail safe option
// so the code doesn't hang if there is
// no data comming.
if (msecs_passed > (timeout / 10))
{
//CloseDataSocket();
//throw new Exception("Timed out waiting on server to respond.");
//FILIPE MADUREIRA.
//If there are no files to list it gives timeout.
//So I wait less time and if no data is received, means that there are no files
break;//Maybe there are no files
}
}
while(data_sock.Available > 0)
{
bytesgot = data_sock.Receive(bytes, bytes.Length, 0);
file_list += Encoding.ASCII.GetString(bytes, 0, (int)bytesgot);
System.Threading.Thread.Sleep(50); // *shrug*, sometimes there is data comming but it isn't there yet.
}
CloseDataSocket();
ReadResponse();
if (response != 226)
throw new Exception(responseStr);
foreach(string f in file_list.Split('\n'))
{
if (f.Length > 0 && !Regex.Match(f, "^total").Success)
list.Add(f.Substring(0, f.Length - 1));
}
return list;
}
But everytime I get files from ftp using this function it includes a date plus other characters plus the name of the file itself.
For example: I want to get all the files inside a certain folder in ftp. The filenames of which are Text1.txt, Text2.txt and Text3.txt. Yet when i tried to retrieve its files using this function, it returns
08-29-07 06:42PM 0 Test1.txt
08-29-07 06:42PM 0 Test2.txt
08-29-07 06:42PM 0 Test2.txt
My question is, how can i retrieve files from ftp returning only the original filenames which are Text1.txt, Text2.txt and Text3.txt.
Thanks
|
|
|
|
|
toink toink wrote: 08-29-07 06:42PM 0 Test1.txt
08-29-07 06:42PM 0 Test2.txt
08-29-07 06:42PM 0 Test2.txt
You may need to parse the output of the FTP process.
|
|
|
|
|
Hi,
I have a strongly typed list that contains a collection of objects, which I can bind to, however I also need to be able to bind to a child object contained in the list, and bind it the gridview.
Does anyone know how to do this?
Regards
Paul Custance
|
|
|
|