|
OK thanks for your help so far.
Another idea: Would it be a better idea to integrate/import the DLL(s) during run-time? So rather than including them via Visual Studio's "References" to include them directly in the classes that need them?
I imagine that this way compiling would always be fine and that the statement could be put inside a try/catch structure so catching the situation when a DLL isn't available would be easier...
Do you have any suggestions how this could be done?
Thanks a lot!
|
|
|
|
|
Hello,
I am a new user of this forum. I need some advice. In System.Net.Sockets namespace there are two class, NetworkStream and Socket Classes and in System.IO there is Stream class for using TCP/IP connection between server and clients. I have read their members, properties and events in MSDN, they are nearly the same but I wonder there are any advantages or disadvantages between them. For my program which class should I use? I use TCP/IP and DNP (Distributed Network Protocol) for my application, some devices connected to LAN sends data to my application also my application can send commands to these devices. But I can not decide which class do I use.
|
|
|
|
|
Hi all.
I have a problem...
On one PC this code: DateTime _dateTimeNew = Convert.ToDateTime(_date + " " + _time); works fine as it returns the _dateTimeNew with the value '11/6/2006 4:00 PM' but on my PC the _dateTimeNew value is '11/6/2006'
in this example the date is '11/6/2006' and the time is '4:00 PM'
Sorry, i know this is a difficult one...
Please help.
Regrds
Nico
-- modified at 10:34 Monday 6th November, 2006
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Have you run it through the debugger, and checked the values of the variables? You also want to check handling your date a little differently. It seems like the _date and _time can be handled in a different way.
|
|
|
|
|
Yes i've tried that. i even assigned the whole value '11/6/2006 4:00 PM' to a string Variable called _test and did it like so...
string _test = _date + " " + _time;<br />
DateTime _dateTimeNew = Convert.ToDateTime(_test);
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Take a look at the culture for them. Convert.ToDateTime on strings uses the current culture. If you want to force it into a particular format, use an IFormatProvider to force it into a specific culture.
CultureInfo culture = new CultureInfo("en-GB");<br />
<br />
string dateTime = Convert.ToDateTime(_date + " " + _time, culture);
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
oh sorry, i modified my code now...
it was supposed to say DateTime _dateTimeNew = Convert.ToDateTime(_date + " " _time)
This is how it is in our code... yet it throws away the _time variable's value and the _dateTimeNew Variable only gets the '11/6/2006' part not the whole '11/6/2006 4:00 PM'
It really has me boggled.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Still - take a look at the CurrentCulture. Remember, the input to the Convert is the string, so this is dependent on the culture.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, i'll try that. The thing that i can't get is why it would work on one pc and not on the other...
But thanks i'll try it your way...
Thank you for your time.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Because the culture is set differently on each machine.
|
|
|
|
|
no, it's the same... we checked the regional settings if that is what you mean by culture being different.
Still, this problem is still a problem...
Thank you for taking time to help.
Enjoy your day...
Regards
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi Guys!
I'm trying to build an application that will allow a user to enter some information into a number of boxes on a Windows Form, which will then be entered into a HTML page, which will then be converted into a PDF.
The info entered will be:
Heading 1
Info 1
Price 1
Heading 2
Info 2
Price 2
...etc
This should then be added into the correct places in an HTML document.
The user never really needs to see this HTML page but it is the only way I can think of getting the correct layout with images etc. that will be needed for the PDF.
This should then be converted into PDF.
If someone can please help with the first part of this problem, and then we can all work through the next stages when applicable?!
Thanks!!
Dave Hunter
|
|
|
|
|
Hi, Dave.
I did some pdf generation on www.DownloadAClue.com[^], but I didn't use HTML as an intermediate step. Instead, I found a PDF library and basically coded the layout for the files.
Do you have a specific need for the interim step, or is it just a matter of trying to avoid laying out the pdf manually?
|
|
|
|
|
Hi,
Trying to read the data from an excel spreadsheet in C# 2005, but there is an error as follows:
The Microsoft Jet database engine could not find the object 'Cities$'. Make sure the object exists and that you spell its name and the path name correctly.
The excel speadsheet is placed in the same place as Program.cs and the sheet name is indeed cities.
This is the code:
private void btnExcel_Click(object sender, EventArgs e)
{
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;""";
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
using (DbConnection connection = factory.CreateConnection())
{
connection.ConnectionString = connectionString;
using (DbCommand command = connection.CreateCommand())
{
// Cities$ comes from the name of the worksheet
command.CommandText = "SELECT ID,City,State FROM [Cities$]";
connection.Open();
using (DbDataReader dr = command.ExecuteReader()) //fails here...
{
while (dr.Read())
{
Console.WriteLine(dr["ID"].ToString());
}
}
}
}
}
|
|
|
|
|
Are you sure the page has the same name?
|
|
|
|
|
When I open the file Book1.xls, the sheet name is Cities whereas in the select query I am using [Cities$]. used Cities instead but no change.
|
|
|
|
|
fmardani wrote: The excel speadsheet is placed in the same place as Program.cs
The Book1.xls needs to be in the same directory as your .exe. Place the Book1.xls file in the \bin\Debug directory if you are debugging and in \bin\Release if you are running in release mode.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi...
I want to use FIFO queue concept for PC serial port communication through PC com port for data transmission & reception.
Can anybody suggest me any good document available on net for this or any suggestion how i can use it in my application...?
Thanks,
Vinay
|
|
|
|
|
Hi
ich brauche dringend Hilfe bei DirectShow
Gruss
Stephan
|
|
|
|
|
Lesen sie die forums am http://sourceforge.net/projects/directshownet/
Diese forum ist nuer fuer Englische sprache.
Aber was ist deine frage?
|
|
|
|
|
I don't know how to generate a random string.
Please help me.
I have Visual Studio 2003.
Vasildb
|
|
|
|
|
Depends on how random you want it...
Though, System.Random class should do it. Take the random double and to a ToString() on it.
|
|
|
|
|
Can you elaborate a little bit more? Is it a fixed length? is there a min size or max size? What characters can you use? 0-9 and a-Z or special chars too?
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
create an array of chars and create each char as a random string using the random class.
|
|
|
|
|
If know the IP Address of a system connected to my LAN, how can i determine the list of folders shared by the system.
Thanks.
|
|
|
|