|
Hi,
you could keep a Dictionary<string,form> that maps titles to Forms, and before opening
a new Form, look for an existing one if any, then act accordingly. You would have to
remove entries when forms get closed then, using the Closed event.
Or use Application.OpenForms and search for a matching title.
|
|
|
|
|
I searched articles in codeproject and i found an anser in mdi.
|
|
|
|
|
Hi,
I am using C# to insert a date value from the DatePicker into a DateTime
filed in mySQL database.. I am using the following syntax:
'" + datePicker.Value + "'
Plz Help.Thanks In Advance.
|
|
|
|
|
If you want the date part only, you should "'" + datePicker.Value.ToString("yyyy-MM-dd") + "'"
to include the time part too "'" + datePicker.Value.ToString("yyyy-MM-dd hh:mm:ss") + "'"
I hope it helps,
Dirso
|
|
|
|
|
use parameters for command, it will be more effective and secure from sql injection
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Sorry guys i'm a bit of a newbie still...
But anyways here's my question.
I r multithreading! however it's not looking so good... I'm using a beginInvoke to fire off pings at other machines on my network I'm pulling the names from ldap sychronously. Anyways the question i had was "Are async delegates manged by the threadpool"... I thought i read somewhere that they were indeed managed via the threadpool... So next question is how come when i do something like this "ThreadPool.SetMaxThreads(10,10);" The app still fires off the max threads that the threadpool can manage? I.e. 20-25... Hope someone can shed some light on this.. Lemme know if you would like to see some code if that would help define my question/problem! Thanks in advance for any reply's even if it's stfu noobzor and go read a book!
I know the human being and fish can coexist peacefully. -George Dubya Bush
Don't believe me?
http://politicalhumor.about.com/library/blbushism-fish.htm
|
|
|
|
|
i am working on C# form and Have axPivotTable Control.
for Databinding i am Using This Code
SqlConnection cn=new SqlConnection("database=durdu;user id=sa;pwd=");
SqlDataAdapter cmd=new SqlDataAdapter ("select * from marksheet",cn);
DataTable dt=new DataTable();
cmd.Fill(dt);
axPivotTable1.DataSource=(msdatasrc.DataSource)(object)dt;
this throws an error -specified cast is not valid.
i have done lots of googling and does not found single satisfied answer
please tell me how to bind data to a pivot table
its very urgent .<b>
|
|
|
|
|
hi
Dont ever say Urgent again, we dont work for you.
Secondly mybe you can write your code like this
SqlConnection cn=new SqlConnection("database=durdu;user id=sa;pwd=");
SqlDataAdapter cmd=new SqlDataAdapter ("select * from marksheet",cn);
Dataset ds = new Dataset();
DataTable dt=new DataTable();
cmd.Fill(ds);
dt = ds("My_Table");
axPivotTable1.DataSource=(msdatasrc.DataSource)(object)dt;
Remember not to use the Word Urgent here
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
What benefit would a DataSet be?
|
|
|
|
|
monu_khan wrote: axPivotTable1.DataSource=(msdatasrc.DataSource)(object)dt;
You can't cast an object to something that it isn't. You can only cast an object to it's actual class, any of it's base classes, or any of the interfaces that it implements.
C# is type safe, so the object contains information about it's actual type. When you do a cast, you cast the reference, but the object still remains the same type. Therefore, when you cast the DataTable reference to object, you get an object reference pointing to a DataTable object. You can't then cast this to msdatasrc.DataSource, as the actual type of the object does not inherit that class.
If the control can't use a DataTable as data source, you have to copy the data from the DataTable into something that the control can use.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Good day,
Any help with writing the code to set up a browser that chooses a file that will later on be used to update a database.
|
|
|
|
|
1: we dont Post like that on a Forum
2: i See its your First day, let me not be hard on you.
3:Did you make any research on google before you post?
4: Lets see what you have done soe far, We cannot do your Job for you.
Hope this help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
System.Windows.Forms.OpenFileDialog?
|
|
|
|
|
How to find out ip address of a listening port.
|
|
|
|
|
lol what?
I know the human being and fish can coexist peacefully. -George Dubya Bush
Don't believe me?
http://politicalhumor.about.com/library/blbushism-fish.htm
|
|
|
|
|
|
I got this from a chat application here on codeproject, there are other ways. Try to download applications in the site.
String GetIP()
{
String strHostName = Dns.GetHostName();
// Find host by name
IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
// Grab the first IP addresses
String IPStr = "";
foreach (IPAddress ipaddress in iphostentry.AddressList)
{
IPStr = ipaddress.ToString();
return IPStr;
}
return IPStr;
}
Good luck
|
|
|
|
|
Hi,
I found this SO dependent solution. Is there a C# native solution to block all keyboard and mouse input?
[DllImport("User32.dll")]
public static extern bool BlockInput(bool enabled);
Thanks,
Dirso
|
|
|
|
|
|
Hi,
I think they all show exactly the same solution I have... did I miss anything? I'll use BlockInput, but I really would like to have a C# native solution instead (so I could also test it under Mono)
Thanks,
Dirso
|
|
|
|
|
My goal is to have a combo box for genders. I need the combo box to display the selected gender. Currently I have a class that has one of it's properties as gender. 1 is supposed to be male and 2 is female. However I am willing to do it however is best. I would like to incorporate binding since that is how I am doing the rest of my app. i.e. text boxes and datepickers etc
|
|
|
|
|
So what is your problem?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
My problem is that the only thing I really know how to do in data binding is to drag an item from the data sources menu to a text box or a date time picker. Here the most important thing is the selection be the selection that has been chosen in the object. Ideally I can just use objects but if I have to I can go with xml, but either way I really need some direction.
|
|
|
|
|
hi
You need to work a little bit on your English,Do it in XML then, but realy i did not understand what you wanted to do.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
In the most simplest form, I want a combobox that will load on a form that will have have a item selected already. In other words lets say it's a male. So in my object it will have gender equal to 1. I want my form to know that when gender = 1, then it will automatically select male. I want to use data binding because thats how I have the rest o my project set up, and I feel that I will just be asking for trouble, if I use databinding for only half. I already know I can do it with if statements.
|
|
|
|