|
Mohamed Nabawy wrote: have more than 55000 Customer and i wanna Fill Combobox with this customers
That's a little bit "too much" to be useful as a dropdown-list. I strongly recommend a popup with a datagridview.
Mohamed Nabawy wrote: . there is any way
to load form quickly and to enter Combobox quickly
Databinding is usually a bit slower than slamming the items in there manually.
Mohamed Nabawy wrote: i use background worker but this hang my form and my app is run slowly can i use threading and how
i want solutin plz
Threading doesn't make it quicker. You'd load the list async from the DB, but databinding still has to be done on the mainthread. Binding 55000 items to a ComboBox, just to let the user select one, is a bit overkill. Things would really speed up if you convert it to a readonly textbox with a "set"-button. Open a new form (modal), and then load those 55k items. In a virtualized datagridview, if performance is an issue.
|
|
|
|
|
Eddy Vluggen thanks
|
|
|
|
|
To add to what Eddy said - it's a very silly idea to put that many items into a control of any sort if you expect the user to have to pick one of them himself.
Think about it as a user: how are you going to find the one item you want out of 55,000? How much time are you going to waste looking?
Find a better solution! Search, filter, whatever - but not "here's a big list - you sort it out".
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
|
As others have said 55,000 items in a combobox is a HORRIBLE idea. How is anybody going to find an item in there? Find a better design.
|
|
|
|
|
HORRIBLE idea
thanks SledgeHammer01
|
|
|
|
|
Hello Everyone,
I am trying to access a page which is secure behind a login system. I do have credentials, but I am trying to automate this as I have to download this page every month.
When I try to use HTTPWebRequest, it doesn't works. I tried to investigate this using Fiddler as well, and here is the log:
Protocol Host URL
HTTP TUNNEL to subdomain-x.site.com/needed-page.html <- My request
HTTP TUNNEL to subdomain-y.site.com
:
.
HTTPS subdomain-y.site.com some-url
What I am trying is:
1. Create Web Request
2. Create Cookie Container
3. Create Network Credentials
4. Create Headers
5. Get Response
However, this returns the Login Page itself. Any help will be highly appreciable.
|
|
|
|
|
Impossible to say with the info you've given. You need to analyze the login page source code to see how the credentials are sent back to the server and how the actual page you want to access is authenticated. If its just a random SSL page, you just need to fill in the HTTPWebRequest.Credentials object.
|
|
|
|
|
Hi All,
Could you please assist me in saving and retrieve images to MySQL database using an Image Path.
Let me know, if you require any additional information to assist me.
Thank you,
Nirmal
|
|
|
|
|
You need to explain what assistance you need. If you want to save the actual image, then save it as a byte stream or blob (whatever is the MySQL equivalent). If you want to save the file's location then it is just a character string.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thank you for your response.
I am saving the image as LongBlob. But retrieving an image through search function, i get parameter not valid error.
byte[] bytesofphotosretrive;
bytesofphotosretrive = (byte[])r["photo"];
MemoryStream mst = new MemoryStream(bytesofphotosretrive);
{
frm1.pictureBox5.Image = Image.FromStream(mst);
}
Please assist.
Regards,
Nirmal
|
|
|
|
|
nirmalgopalakrishnan wrote: i get parameter not valid error. Where?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
byte[] bytesofphotosretrive;
bytesofphotosretrive = (byte[])r["photo"];
MemoryStream mst = new MemoryStream(bytesofphotosretrive);
{
frm1.pictureBox5.Image = Image.FromStream(mst);
}
the error points to this parameter : frm1.pictureBox5.Image = Image.FromStream(mst);
|
|
|
|
|
Well it should not be too difficult to guess which parameter is in error. Use your debugger to step through the code and see exactly what is happening.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
It's pointing to the error in line 164, which is as below:
frm1.pictureBox5.Image = Image.FromStream(mst);
The exception message is: "System.Argument.Exception: Parameter is not valid. at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) at System.Drawing.Image.FromStream(Stream stream)at btnResearch_Click(Object sender, EventArgs e) in D:\Mat\frmRecSearch.cs: line 164.
|
|
|
|
|
Well we already know that. Have you used the debugger to try and determine why the parameter is invalid?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Could you please email me. nirmalkumarg3@gmail.com
|
|
|
|
|
Sorry no, if you have issues to discuss around this problem then post them in this forum; that is why we use it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Cool, no issues. It points to a null parameter in the debugger. But the same code, when executed with just an image add and retrieve (a new c# project), the application works really well. I am unable to determine what is the problem here
|
|
|
|
|
nirmalgopalakrishnan wrote: I am unable to determine what is the problem here From a previous post you have the following code:
byte[] bytesofphotosretrive;
bytesofphotosretrive = (byte[])r["photo"];
MemoryStream mst = new MemoryStream(bytesofphotosretrive);
{
frm1.pictureBox5.Image = Image.FromStream(mst);
}
So you need to find out why mst is null at this point. Your code is assuming that you always get a valid byte array from r (whatever that is), and hence a valid stream. However, if either of these commands do not return the expected result you are going to have a problem which you are not catering for. You should never assume that method calls like this will always succeed; add some error checks so you can diagnose it properly when it fails.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Thank you for your response. The link which you provided was really helpful. But i am not sure how to include the same in my application, since i am saving data from 15 text boxes.
I am confused as to where to include the image details.
Regards,
Nirmal
|
|
|
|
|
I have a form that has an array of text boxes dynamically added to a splitcontainer on a form. I use the same array to add text boxes to the form twice (different data for different table). I would like to use an event handler, preferably once, to change background color to yellow when textbox[i] receives focus, and back to white when it loses focus. I am currently going around in circles. Can anyone help me? Thanks for your input
Everett
|
|
|
|
|
Add in a lambda, at the point where you create the textboxes. Like the example below;
public Form1()
{
InitializeComponent();
var tb = new TextBox();
tb.GotFocus += delegate (object s, EventArgs a)
{
(s as TextBox).BackColor = Color.Red;
};
tb.LostFocus += delegate(object s, EventArgs a)
{
(s as TextBox).BackColor = Color.Green;
};
Controls.Add(tb);
}
|
|
|
|
|
hi, your idea is right, but the textbox has't the event GotFocus & LostFocus, instead of, has the event Enter & Leave.
|
|
|
|