|
For over a year now I have used "Media Player Classic" because it has
a very good set of command line arguments. I renamed it to MPC.exe and
initiate it in this manner.
string sysCommand = Environment.CurrentDirectory + "\\mpc.exe";
string filename = " /play /close /fullscreen \x22" + fname + "\x22";
System.Diagnostics.Process proc =
System.Diagnostics.Process.Start(sysCommand, filename );
proc.WaitForExit();
|
|
|
|
|
I need assistance on how to write codes that will allow my software users to backup data from the database and also restore [SOL Server 2000]
|
|
|
|
|
Look in the SQL Server documentation for BACKUP and RESTORE . Then call the appropriate commands using SqlCommand.ExecuteNonQuery();
|
|
|
|
|
My application is converting .doc, .xls, .pdf files to .pdf. I have Adobe Acrobat 6.0 running for the conversion. This is an automated process. Sometimes if the file is created in 7.0 and the program tries to convert the file it fails because there is a messagebox saying that the version is a newer or most times it simply fails. Is there a way to check in the code if this file is created in a higher version they don't attempt on converting the file.
|
|
|
|
|
PDF files are binary files; they do however start with 8 ASCII characters indicating the
PDF version they adhere to. Example: %PDF-1.3 (remark: no terminating null)
So you might check for a specific version or version range before trying to process a PDF file.
Luc Pattyn
|
|
|
|
|
I wonder what are things I can put in XML in regular C# code, variable names maybe, guess not, but what can we use it for?
Files path for resource files, or something like that, what is use of XML in regular Windows program, hope this isn't wrong room... btw?
Can I put user data for example some options settings instead of con fig or registry?
Can I put some user input like user list or use it like small data-base file?
|
|
|
|
|
You can basically put anything you want in XML, the Extensible part of Extensible Markup Language.
only two letters away from being an asset
|
|
|
|
|
OK, but can someone provide some sample usage of it, sound great but have no idea what to do with it, and how it can improve my application?
|
|
|
|
|
Have you tried searching for XML here
only two letters away from being an asset
|
|
|
|
|
I did but there are so menu things don't know where to begin... even MSDN is very confusing on that... most articles talk about Word or SQL... don't need neither right now...
|
|
|
|
|
Then you're in teh wrong place. Go buy a book on XML and read it for starters.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Then you're in teh wrong place. Go buy a book on XML and read it for starters.
Almost any XML book I know of is not on specific topic like What should I do with XML in my .net C#, program or something... beside not much choice on that topic here... I'll look around on-line instead I guess...
|
|
|
|
|
TrooperIronMan wrote: What should I do with XML in my .net C#, program
After supposedly reading online resources such as CP and MSDN as well as books and you still can’t answer this question it's time to chose a new career.
TrooperIronMan wrote: Almost any XML book I know of is not on specific topic like What should I do with XML in my .net C#,
If you find the book that tell you what to do for your specific project you'd better keep it secret because half the posters on CP will be bombarding your inbox wanting to know where to get a copy.
Books, magazines, articles, etc. are not going to tell you what to do for your own little world, you have to do something creative, like actually think for yourself.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote:
If you find the book that tell you what to do for your specific project
I though more likely about best practice...
Mark Nischalke wrote: After supposedly reading online resources such as CP and MSDN
Hard to read much on 56k that brake up line every minute or so that is why I hoped someone do have link for more specific article or sections...
Mark Nischalke wrote: it's time to chose a new career.
nah... too late for that... now...
|
|
|
|
|
The best advice is, don't use it until you need it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I do have one scenario I can think about right now that require something like xml or config file... but would like to try xml on it...
For now all I'm doing is learning new tech... so i just explore...
|
|
|
|
|
You can do just about anything you want with an XML file, just as you have listed.
I personally use them for small databases or settings. For example, I made an XML file containing all the countries in the world. I use this in my applications to populate a Countries ComboBox or DropDownList
Live in fragments no longer. Only connect.
|
|
|
|
|
bluewavestrider wrote: For example, I made an XML file containing all the countries in the world. I use this in my applications to populate a Countries ComboBox or DropDownList
there you go, can you supply some source code, I though about same thing have some drop down lists that I would like to be able to save to XML since user can add some data to them... but it get saved in plain text file... not so cool solution...
|
|
|
|
|
You can use XML for anything that you want. It's just a flexible data format, it has no specific purpose.
XHTML is XML. SOAP uses XML. AJAX uses XML. RSS uses XML. It's everywhere...
---
Year happy = new Year(2007);
|
|
|
|
|
I know but I still need some examples of good practice... and how to do it... so... anyone
some code please
|
|
|
|
|
Your question can't be answered. What code are you hoping for ? The net abounds with examples of uses of XML, for example, config files, or data files. But, your question is too open ended. The best practice is, if you need to store heirarchical data, or data whose layout may change, XML is worth considering.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
OK, this is one of scenarios I'm currently working on:
there is combo box I enabled user to add some data in it, I want to save all that data at program close, and to load same data when program start (it's list of cities btw)
I want to save last used file path and load same file at program start up if user confirm it want to continue to work on same data.
I want to output some text boxes, datetime pickers, etc at and of work so same data can be loaded at start up if user want so... basicly creating data set in xml...
So those are things I'm trying to achieve I can use textual files (and I do use them right now), but I believe with XML it would be easier to manipulate data and more flexible?
So any help now?
|
|
|
|
|
Sorry if title bit abrupt. I have an Access Database, in this database are two tables, one is a table of teams and the other a table of players. My table of teams contains 11 index numbers (1 for each player).
My program currently loads all the teams from the database, while loading each teams, it search's the other table for the players details using the index number.
I know this will query the database 11 times for each team. This seems to really slow down the program to an unmanagable speed.
What is the best and fastest way to talk to an access database and am i going about it the right way? A sample of how I am currently querying the database is below. Thanks
string strQuery = "SELECT * FROM t_DT_Teams;<br />
OleDbCommand dbsCommand = new OleDbCommand(strQuery, dbsConnection); <br />
OleDbDataAdapter dbsAdapter = new OleDbDataAdapter();<br />
dbsAdapter.SelectCommand = dbsCommand;<br />
<br />
DataSet dbsDataSet = new DataSet();<br />
dbsAdapter.Fill(dbsDataSet, "t_DT_Teams");<br />
DataTable dbsDataTable = dbsDataSet.Tables["t_DT_Teams"];<br />
<br />
// i then loop through each team and do roughly the same to find a player<br />
<br />
dbsConnection.Close
|
|
|
|
|
Instead of using * you should try to list the column names directly. I can't tell you what the exact performance hit is, but I know you should always try to list the columns you want.
I don't know if there is any better way to do this then how you are currently doing it. Do you use the dataset, you can set the datatable in place of the dataset if you don't need it. Also, try using the using(connectionType connection = new connetiontype(connectionstring){}. You don't have to close your connection when you are done as this will do it for you.
Wish I could help More.
|
|
|
|
|
avanwieren wrote: You don't have to close your connection when you are done as this will do it for you.
Very bad advice. You should always close the connection because it immediately frees up the resources on the database so it can be accessed by another application, or even a different part of the same application.
If you don't call close you are at the mercy of the garbage collector as to when the connection is finally closed. Each time you open a connection you'll need a new one as the previous one isn't closed yet. This might cause the application to fail if the database is too stretched to open a new connection. The cause won't be immediately apparent because the cause of the error isn't at the point the connection is opened, it is at the point the connection should have been closed, but wasn't.
|
|
|
|