|
The error message says what you need to so. That file is not there on the computer. So update your setup such that the file is copied to the user computers while installation.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Now i have form1 and form2
datetimepicker1 and datetimepicker2 is in form1
i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to;
from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
it can work very well
then wrote my code on form2 like this
Form1 frm=new Form1();
string from, to;
from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd");
when i run my code ,from=2010-01-09,to=2010-01-09 on form2
but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1,
then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning.
i want to get the changed dateTimePicker.Value,how could i do
thanks everyone?
|
|
|
|
|
Can you post the actual code, rather than your synopsis? I have some thoughts about what may be happenning, but I don't want to lead you astray by guessing. Copy and paste the code for both forms in your reply, then highlight all of it and click the
code block tag above to preserve your formatting.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
miss YY wrote: set datetimepicker1 and datetimepicker2 modifiers to public on form1
Not necessary and not a good idea
miss YY wrote: on form2 like this
Form1 frm = new Form1();
This is the clue! This is a new instance of Form1 (i.e. not the same one as you are viewing) so the DateTimePicker s are not the same ones and therefore have different values.
Where is form2 created - in Form1? If so, keep a reference in Form1 to the new Form2 . In Form2 , create properties or methods to receive the DateTime s, and set them from Form1 when they change using the reference you already have.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
miss YY wrote: Form1 frm=new Form1();
string from, to;
from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd");
Since you haven't shown the form, the user hasn't had a chance to change the values. "new" does exactly that: creates a new instance of Form1. If you have an existing instance of Form1 that the user has allready selected the to and from dates on, you need to access that instead.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Create a static class that holds the DateTime objects, and simply refer to them from both forms.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
So, I want to make an address book like database for all the plants I encounter. I am going to sort them in a list by scientific name and when I click on one of the names it will show a picture I took of the given specimen in a large picturebox next to the list. Then when I double click on the name of the plant, a new window will open showing multiple pictures of the plant along with categorical data similar to a contact entry (name, address, city, gender, etc). I am not sure how to go about doing this in terms of storing and accessing the picture files. I am not too familiar with SQL but I have seen some examples of address books using SQL servers on this site. My question is how will i store, call, and manage all the pictures of the given plants in an SQL server? Can you call up pictures as you do text data? Any help would be greatly appreciated!
|
|
|
|
|
There are many ways to handle photos in SQL Server, so do a little research. Photos are usually treated as Binary Large Objects (BLOBs) in database parlance, so try searching Google and MSDN, as well as the database forum on this site. The short answer is yes, you can use photos just like any other data, but there are efficient ways to do it and innefficient ways, as well. I'm not an expert on this, not even a beginner, but I have read a lot of discussion about this type of database, and I recommend that you do so before you spend too much time chasing butterflies.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
You have an even more fundamental question to answer before discussing the database and how to store your data. What is the client you are going to use, winforms/wpf or web/silverlight. This will be determined by your audience.
If your project is a personal one then winforms may be the best solution. With SQL server you have a number of choices of how you store your data, you may want to store the actual file in the database or filestore (SQL 2008) or you may want to leave the file in the file system and store it's location in the database.
If you are using the web this is critical as your database size will be DRAMATICALLY different and it will affect your hosting choices.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Personally, I prefer to store such files within the database.
|
|
|
|
|
Hello every one
How I can set the Contextmenustrip for root and disable some items of Contextmenustrip for Children.
I fill tree with an Xml File.
if (treeView1.SelectedNode.Level == 0)
treeView1.SelectedNode.ContextMenuStrip = contextMenuStrip1;
if (treeView1.SelectedNode.Level == 1)
treeView1.SelectedNode.ContextMenuStrip = contextMenuStrip2;
modified on Sunday, January 10, 2010 1:34 AM
|
|
|
|
|
I'm lookinmg for a simple C# program using the DDay.Ical library that adds Attendees both optional and required to a meeting request.
I've seen how to add the email for an attendee in addAttendee method. How do I make it required and optional?
|
|
|
|
|
|
Hi everybody,
I have this abstract method:
public static T DecodeData<T>(byte[] data, string encRules)
But the type T must be defined during runtime. I mean... I have other method like:
GetDownloadType(id);
Depend on the id, I should pass one or another parameter to DecodeData. But I dont know how.
public static Type GetDownloadType (int id)
{
switch (id)
{
case DOWNDIRECT: return typeof(DownDirect);
case DOWNOTHER: return typeof(DownOther);
case DOWNHEHE: return typeof(DownHehe);
default: return null;
}
}
But when I try to use the Type result of this method to pass it to DecodeData... I cant. How should I do this?
Thanks in advanced
|
|
|
|
|
T needs to be resolvable at compile time i.e before runtime when you have access to the type via typeof
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
The type things used in generics are not instances of Type
But of course you could put the calls to DecodeData in that switch (and some code that uses its result too, perhaps, otherwise you may get a similar problem with the result type)
|
|
|
|
|
If you really need to invoke a generic method you could use something like this:
public static class Test
{
public static T GenericDecodeData<T>(byte[] data, string encRules)
{
return default(T);
}
public static Type GetDownloadType(int id)
{
switch (id)
{
case DOWNDIRECT: return typeof(DownDirect);
case DOWNOTHER: return typeof(DownOther);
case DOWNHEHE: return typeof(DownHehe);
default: return null;
}
}
public static object DecodeData(Type type, byte[] data, string encRules)
{
MethodInfo methodInfo = typeof(Test).GetMethod("GenericDecodeData").MakeGenericMethod(
new Type[] { type });
return methodInfo.Invoke(null, new object[] { data, encRules });
}
}
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thanks both.
I think that your solution, Dave, could do the trick!!! Thankssss!!
Kind regards
|
|
|
|
|
Hi,
How can I get the number 123456789012
displayed as: 1234-5678-9012
I tried the following but it didn't work..
String.Format("{0:000-000-000-000}",123456789012);
Thank you.
|
|
|
|
|
Try this:
string.Format("{0:0000-0000-0000}", 123456789012);
|
|
|
|
|
I code in C++ so I'll leave it to you to work out the C# code.
Why not break it into 3 integers for example 1234, 5678 & 9012 & then use String.Format with the 3 numbers.
You get 1234 (the first integer) by taking the integer part of dividing by 100000000 that is int(123456789012/100000000)
You get 5678 (the second integer) by taking the modulus (remainder) on dividing by 10000 that is
mod(int(123456789012/10000), 1000)
You get 9012 (the third integer) by taking the modulus relative to 10000 that is mod(123456789012, 10000)
Hope this helps
|
|
|
|
|
Thanks mate, I just remembered that a masked textbox control is all I need
|
|
|
|
|
System.Console.WriteLine ( System.String.Format("{0:0000-0000-0000}",123456789012) ) ;
System.Console.WriteLine ( 123456789012.ToString("0000-0000-0000") ) ;
Both seem to work to me. What problem does it give?
|
|
|
|
|
Funny, none of them work with me but it doesn't matter as I'm using the masked textbox now.. I'll have to find out later when I have the time.. Thank you guys!
|
|
|
|
|
Hi.
First of all, I have done a few C# applications, but are quite new to C# asp.net web applications.
What I am trying to receive is a simple Media player control on an aspx page. And furthermore a button, that starts the media player with a videostream url. Thats all!
I can easily achieve this in an ordinary c# form, by importing:
AxInterop.WMPLib.dll, Interop.WMPLib.dll and wmp.dll
references in the project. Now i am able to choose a "Windows media player" control in the toolbox, which i can drag into my form. Nice and easy.
But when i import these dll´s in my ASP.NET Web application, I cannot see the media player control in the toolbox. Ive tried to right-click the toolbox, and click "Choose items", and see that 'Windows media player' is checked under the COM components tab. But i still cannot see the control in the toolbox. Only in an ordinary c# application form.
This is driving me nuts. Ive tried googling for hours, but cant find the answer.
So if any kind sould could pinpoint me in the right direction, or make a quick solution file that holds this simple control on an aspx page, i would be very glad!
Thanks alot for your time.
Kind regards,
Lars
|
|
|
|