|
Hello All,
How can i dispaly the first recorde in the combobox blank when it is binded with the datasource
Regards
Hay
|
|
|
|
|
Change the dropdownstyle property to dropdownlist.
|
|
|
|
|
Yes i changed it but no impact it still dispaly the first record.
Thanks
|
|
|
|
|
|
ComboBox1.Items.Add("Washtington DC");
ComboBox1.Items.Add("second values");
ComboBox1.Items.Add("third value");
the ComboBox1.Items.Add("Washtington DC"); will be the first value in combobox when u run ur project.
But u have to fill ComboBOx in Form1_Load Event otherwise it will not works
|
|
|
|
|
Thanks for your reply
but the add method dosnt work when the combobox binded with datasource.
Hay
|
|
|
|
|
U have to fill it from DataBase or u trying to fill it manyally by filling urself.
if u not using dataBase the method Add have no way to do not work.
Or I suggeset you to open new C# Windows Application then drop one ComboBox and begin filling using Add method.
I hope this heslps you...
|
|
|
|
|
Thanks so much about your help.
The problem that i fill the combobox from the database and the add method dosnt work when the datasource work.
Thanks
Hay
|
|
|
|
|
i hope this helps u now
comboBoxState.DataBindings.Add("SelectedValue", customersDataSet1, "Customers.Region");
|
|
|
|
|
hi,
When i am filling a dataset from oracle table, I am getting an error 'Overflow OCI-22053'. This caused by the numeric field. There is the solution available in microsoft site also. But I just can't understand.
Please help me.
VS 2003
Uday Shetty
|
|
|
|
|
It sounds like the number you are passing in is just too big. If the numeric field only supports a max value of say 65535 and you pass it in a long value that's say 1234567, then it will throw an overflow exception. I guess a way to fix it would be either to change the size of the numeric field in the database, or if that's not possible you can return an error to the user or just set it to the max size and ignore the rest of the number.
-- Rocky Dean Pulley
|
|
|
|
|
Is there an elegant approach to specifying an argument list for a method at run time? I'm working on an app that makes a set of analysis of a data set. Which analysis and to make and in which order order is specified at run time. I'd like the class to be able to inform a class that calls it what arguments are needed.
Using a params object [] array in the argument will of course give me complete freedom for consuming what ever is submitted, but doesn't provide a mechanism for telling the program what to put into the array.
class MyData{}
class DataStudy{
MyData InputData;
}
class DataAnalysis{
static float Average(MyData InputData){}
static float WeightedAverage(MyData InputData, float weightfactor){}
static float WeightedMomentAverage(MyData InputData, float weightfactor, float momentfactor){}
}
Thanks.
cmayo
|
|
|
|
|
Have a look at the System.Reflection namespace.
If you have a Type object (can be got via object.GetType() ) try the GetMethods and GetProperties functions. They will give you objects describing the methods with all their arguments.
|
|
|
|
|
Hi,
I am trying to pInvoke a vc++ dll from c#, the c# code
try to pass an integer into the dll and change
the global variable declared in the c++ dll, but it failed.
The global variable (int) changed inside the c++ procedure called by
the c#, but once the program run outside the procedure, the global
variable restore to its original value, why ?
And how can I change the global variable declared in the c++ dll when pinvoke by c# ?
Thanks
|
|
|
|
|
To me it does not sound like a pInvoke problem but a generic dll problem.
How did you declare you local variable in c++? is it a static int?
Did you check if your c++ dll is unloaded after the pInvoke? (try to add trace code to the _main)
/cadi
24 hours is not enough
|
|
|
|
|
i would save and object as a treeview inside a ASCII textfie so can i read it again and assign to a new treeview:
tfile = myOldTreeVew.toTextFile();
.... close the applicaion
.... open again the application
myNewTreeView.ReadFromTextFile(tfile);
Obvialy these functions don't exist, but i need something like them.
|
|
|
|
|
Have a look at this article. I think it provides everything you need.
|
|
|
|
|
I would like to save the screen of windows form as an image, would you please advice on how can I do so?
Print Screen may not work as I may need the screen of form that is not currently using. Besides, I do not have button on the form that I want to print, i.e. I invoke the print screen function from another form.
Thanks very much.
|
|
|
|
|
You could get the DC of the form and do a bit block transfer:
<br />
IntPtr hwndDesktop = GetDesktopWindow();
<br />
Size s = form.DesktopBounds.Size;<br />
<br />
Graphics graphicsForm = Graphics.FromHwnd(hwndDesktop);<br />
<br />
Bitmap bitmap = new Bitmap(s.Width, s.Height, graphicsForm);<br />
<br />
Graphics graphicsBitmap = Graphics.FromImage(bitmap);<br />
<br />
IntPtr dcForm = graphicsForm.GetHdc();<br />
IntPtr dcBitmap = graphicsBitmap.GetHdc();<br />
<br />
bool result = BitBlt(
dcBitmap,<br />
0, 0,<br />
form.DesktopBounds.Width, form.DesktopBounds.Height,<br />
dcForm,<br />
form.DesktopBounds.Left, form.DesktopBounds.Top,<br />
SRCCOPY);<br />
<br />
_________________________________
Please inform me about my English mistakes, I still try to learn your language!
|
|
|
|
|
hi all,
I need to replicate Two Databases using C#?
One Database is in "pubudu\MSDE" SQL Server ..Other Database is in "kushan\MSDE" Server.
Can any body please tell me How to replicate above two databases?
any anwers would be greately appreciated.
regards,
pubudu.
|
|
|
|
|
Are you talking about SQL Server Replication or some sort of manual process?
|
|
|
|
|
hi,
I know that SQL Server 2000 has some functions for Data Replication.But I need to know there are other free softwares for Data Replication?
Or can we do it as manual way?
regards,
pubudu.
|
|
|
|
|
I am not familiar with any free software that does this but you might be able to find something. Are you looking to have the data replicated immediately as it is changed?
|
|
|
|
|
Hello,
Usually when I drop some controls at the MDI Parent and later open Mdi Child forms, I can see MDI Parent controls on the top of child forms. Is there any way that we can display Child forms without displaying MDI Parent controls. I know that SetWindowPos can make a child form topmost. but It'll be on the top of all other forms too which is not a good solution to the problem.
Any suggestions in this regard will be appreciated.
TIA
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
Try setting Visible property to False on the controls on the MDI parent form at the time of displaying a particular child form (when you do not want to display them alongwith the child form).
|
|
|
|