|
hi guys , im facing a delay problem , i have made a program with c#.net it has couple forms the forms has couple button and couple datagridview and some other controls and every button do the right thing. like adding ,updating and deleting from database and so one , (automation program) . one of my page was working good but after some time its now very slow in working , and only this page is very slow in respond , like (typing in textbox ) is very slow .but not other pages .
im using the Devcomponent in all of my forms , and using some dll's two , and using access database , and even when i extract a setup of the program or made a setup , nothing changed even it get worse on other computers too.
any help . i'll appreciate that .
maybe the problem is my database or the dev components or maybe it bcz of the size of the control that window has carry on , bcz im using a super tab control with 4 tab on it two tab of this 4 tab have alot of control textboxX and comboboxX maybe it bcz of that reason that make the form work very slow . or maybe sth else.
modified 9-Sep-12 11:30am.
|
|
|
|
|
The problem could be anywhere. Try a profiler to identify your bottlenecks, it'll highlight the methods that take the most time to execute.
DevExpress does require additional resources, one of my arguments to not use them. I assume you are using their BeginUpdate methods? Still, that's hardly enough to bring a modern PC to a grinding halt. How about you posting one of the offending queries?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
i have figur it out ty for replay , it was myform key down , it was full of condition ty.
|
|
|
|
|
I have 2 listboxs. 1st one is data bound and secound one is populated by selecting 1st.
eg:
listbox1
jenny
rock
when i click listbox 1 items it also appear in listbox2. now when i click listbox1 item 2 things happen:
1. listbox2 populates with same item selected in listbox1.
2. a textbox which gets valueid from listbox1 item select.
So now, when i try to remove item from listbox2 then itm should be removed from the list and the valueid in textbox related to the item should also be removed.
I have tried o do this by selecteditem property of listbox but it didn't work. since listbox1 is data bound but listbox2 is not.
|
|
|
|
|
Unless I did not correctly understand your question, something like below should work;
Listbox2.Items[1].Remove();
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
ok, but what about valueid which is populated when i add items in lstbox2 from listbox1.
i have a button "ADD". when i select item in listbox1 and click add button item is added to listbox2 and so as its valueid in textbox. but when i click on remove button the item will get removed from listbox2 but valuid for that item is removed from textbox. This is because listbox2 is not databound and valueid is generated from listbox1.
|
|
|
|
|
scottichrosaviakosmos wrote: and valueid is generated from listbox1.
At what time? Easiest solution would be to call that generate-routine again, otherwise you'd have to manually cut it from the string, before deleting the item.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Ok, let me explain in details.
I have a form which has 2 listboxs, textbox and 2 buttons.
lst1 and lst2. Also has 2 buttons "add" and "Remove".
lst1 is populated from a database table which has 2 fields : "Name" ad "emailid".
lst1 will show items "name" from table column "name". eg: ronny, danial...
when i select an item(name) in lst1 and click Add button then the name will be added in lst2(lst2 is not connected to datasource). Also the displayvalue member or emailid with respect to the name selected in lst1 will be added to the textbox.(this is working fine).
Now, when i select an item in lst2 which was added from lst1 and then click on Remove button then the item(name) should be removed from lst2(this is also working fine) and also the emailid corresponding to the value(name) selected in lst2 should be removed from textbox.
emailid on selectitem of lst2 is not getting removes since the lst2 is connected to database. lst is adding its item from lst1.
I hope now the scenario is clear.!
Cheers
|
|
|
|
|
scottichrosaviakosmos wrote: Now, when i select an item in lst2 which was added from lst1 and then click on Remove button then the item(name) should be removed from lst2(this is also working fine) and also the emailid corresponding to the value(name) selected in lst2 should be removed from textbox.
So, everything is working fine, except for the removal of the email-address in the textbox?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
..and the email-address needs to be removed from the textbox, if the "remove" button is clicked?
Emailaddresses are unique, so you could try and replace that part of the textbox with an empty string, like so;
textBox1.Text = textBox1.Text.Replace("et@home.nl", "");
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hello guys. I am using C# code to download a webpage, namely the image searching page of google with this URL: http://images.google.com/[^]
But the problem is the code is not saving the whole elements of the webpage. I tried to save the page by file->save but I am still not able to see some elements like the camera picture in the search box.
the code that I am using to save the page is:
string pageURL = txbURL.Text;
string pageContent = DownloadPage(pageURL);
System.IO.File.WriteAllText("WebPage.html", pageContent);
does anyone know what is happening for the hidden elements of webpage?
thanks and regards
|
|
|
|
|
Just to be clear - you understand that a image file will not be in the string right? So at best your html file can only have a link to the image?
Other than that I suggest you actually look at the html using a browser, save it, and then compare it to what you saved in your file.
|
|
|
|
|
Thanks for your answer. I know this but the problem is the webpage that I want to download. It is the image search of google. www.image.google.com
As it can be seen, there is a small camera icon beside the search button. When I save the page, this icon will not apear in the saved page.
|
|
|
|
|
Did you are did you not use your browser (not your code) to save the source of that link to a file?
Once you did that, did the icon show up or not?
|
|
|
|
|
Hi and thanks for your reply. I saved the page with IE but the button is not there. I just tried to save the page with mozila firefox. It downloads all of the icons and also the icon for the camera that I need, but still when I open the saved page using dreamweaver I am not able to see the icon. I need to find it because I want to change it by the code.
|
|
|
|
|
hosseinDolat wrote: It downloads all of the icons and also the icon for the camera that I need
Again...that is NOT possible in the context of your original question.
You CANNOT put an icon into a string.
So either it stored the text (string) of html, with the links or it saved a tree (one or more files some of which are icons.)
So your steps are
1. FIRST identify exactly what is that you think that you need to download
2. Fix DownloadPage() do to that.
|
|
|
|
|
hi guys , i'm wondering if we have an event for a clicking on the space of the datagridview . i mean , let guess we have 5 rows in the datagridview then after the last row there is still a space from the bottom of the datagridview to the last row .
i want to know if we have an event for that empty place(space) , noticed(i dont want to click the cells ) i just wanna a click events for the empty place .so if i clicked the empty space on the datagridview sth w'll happend.
&
i have used the click and mouse click events but they do double thing , that mean if you click on the row they'll work and also on the empty space .
i hope you get what i mean ?
|
|
|
|
|
You'll have to use the HitTest method to get a HitTestInfo object containing information about the DataGridView element existing at the clicked mouse coordinates.
There are two ways to tell if the blank area beneath the rows was clicked. Both are shown in the code fragment.
private void dgv_MouseClick(object sender, MouseEventArgs e) {
Debug.Print("{0}", dgv.HitTest(e.X, e.Y).Type);
Debug.Print("MouseClick was Nowhere {0}", dgv.HitTest(e.X, e.Y) == DataGridView.HitTestInfo.Nowhere);
}
Alan.
|
|
|
|
|
Hello
In Windows 7, files explorer tree, we have default locations:
- Favorites
- Libraries
- Computer
- Network
Question:
I need create my new location in explorer tree
Target effect:
- Favorites
- My_Folder ( loctaion: D:\My_Folder - with my icon )
- Libraries
- Computer
- Network
This is possible in C# ?
What I need to start ?
Thank You
Mark
|
|
|
|
|
mt1024 wrote: In Windows 7, files explorer tree, we have default locations:
- Favorites
- Libraries
- Computer
- Network
If you're referring to the default save location in a save-dialog, check this[^] out. If not, please post a screenshot to clarify
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
Ah, those are called "Shell namespace extensions". There's an example here[^], along with this warning:Editor's Update - 6/23/2006: Because shell extensions are loaded into arbitrary processes and because managed code built against one version of the runtime may not run in a process running an earlier version of the runtime, Microsoft recommends against writing managed shell extensions and does not consider them a supported scenario. A commercial alternative would be EzNamespaceExtensions[^], but the recommended way is still to use a non-managed language.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks You for Your help. 
|
|
|
|
|
As you know, in Entity Framework Repository Pattern we have new DbContext(or object context) in each entity's instance.
Is it OK to implement Repository Pattern with Singleton to have the same DbContext in each entity's instance? If so, could you please post some references ?
Thanks
Read more about Repository Pattern :
http://www.remondo.net/repository-pattern-example-csharp/[^]
|
|
|
|