|
Using a data set means that the results of the query are loaded in their entirity into the dataset first before you can do anything with it. This can take a long time (as you've seen) and take a lot of memory.
There isn't an easy solution for this.
Could you consider using a DataReader instead and processing the data one row at a time? Do you need all 10,000 row in the dataset? Could it just be that the query is very complex and the database needs the time in order to find the relevant rows?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Did you try executing the query by itself (like in Query Analyzer) to see if it is the query that takes a long time to execute?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
For this kind of situation, I usally divide the rows in Pages driven by Combo Box Items and for every Combo Item, I use a FillBy Method of Table Adapter and I set the query of start up fill method to load data for only first page. Now, you can programmatically load the combobox with page numbers so that on Selected Row changes of the Page Combo Box, the appropriate FillBy Method of the table adapter will be triggerred.
EMRAN
-- modified at 16:27 Thursday 9th February, 2006
|
|
|
|
|
Hi all,
I am using a Wizard with a number of WizardSteps.
One of these steps should only be visible if an option on the previous page has been selected.
I thought that should be an easy task:
if (cbxOption.Checked)
{
wizOrderProduct.WizardSteps[1].Visible = false;
}
I have tried to make this check in both the page_load but also in the checkbox click event.
But when using that code I get a;
'The Visible property of a View control can only be set by setting the active View of a MultiView.'
And that message I'm not able to digest.
Can anyone out there help me on this one?
ZeedijkWhore
|
|
|
|
|
i made a webbrowser using axwebbrowser...
1-how can i handle history events on it..
2- how can i retrive the position of mouse on that control
3- how can make
file--->workoffline,
file-->import,and export,
file-->create shortcut on desktop,
edit-->find
view--->fullscreen
view--->encoding
in statusbar, how to access security ,being offline,zone,connection
|
|
|
|
|
i made a text_box & "GO" button.
button code is:
[code]
private void browserGoButton_Click(object sender, EventArgs e)
{
Navigate();
}
private void Navigate()
{
if (!browserUrl.StartsWith("http://"))
{
browserUrl = "http://" + browserUrl;
}
try
{
webBrowser1.Navigate(new Uri(browserUrl));
}
catch
{
MessageBox.Show("Invalid Url.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
[/code]
on button click open my URL.
How can i do this simple?
& second question: how made progress bar for indicate load of internet page?
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
To your first question, that code looks like it would work. Is there something wrong with it?
You can add a progress bar using the System.Windows.Forms.ProgressBar control, or optionally, add a StatusStrip with a ToolStripStatusBar on it. You can adjust the progress using events from the System.Windows.Forms.WebBrowser control, such as WebBrowser.ProgressChanged event.
|
|
|
|
|
Judah Himango wrote: To your first question, that code looks like it would work. Is there something wrong with it?
no its ok, its work, but seems to me it can be simpler
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
YYYYYYYYYYYYYYYYEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS i did it
this a BIG code may be replaced by this^
[code]
{
this.webBrowser1.Navigate(this.toolStripTextBox1.Text);
}
[/code]
maybe its be useful for someone
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
-- modified at 14:15 Thursday 9th February, 2006
|
|
|
|
|
hi
hi
I am trying one of your codes in reflection Chapter10 and getting error as
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name VectorClass, or one of its dependencies, was not found.
File name: "VectorClass"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence as
semblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(String assemblyString)
at Wrox.ProCSharp.LookUpWhatsNew.WhatsNewChecker.Main() in c:\my documents\visual studio projects\whatsnewattributes\lookupwh
atsnew.cs:line 17
=== Pre-bind state information ===
LOG: DisplayName = VectorClass
(Partial)
LOG: Appbase = C:\My Documents\Visual Studio Pro
jects\WhatsNewAttributes\bin\DebugLOG: Initial PrivatePath = NULL
Calling assembly : WhatsNewAttributes, Version=0.0.0.0, Culture=neutral, PublicK
eyToken=null.
===
LOG: Policy not being applied to reference at this time (private, custom, partia
l, or location-based assembly bind).
LOG: Post-policy reference: VectorClass
LOG: Attempting download of new URL file:y Documents/Visual Studio Projects/WhatsNewAttributes/bin/Debug/VectorClass.DLL.
LOG: Attempting download of new URL file:y Documents/Visual Studio Projects/WhatsNewAttributes/bin/Debug/VectorClass/Vect
orClass.DLL.
LOG: Attempting download of new URL file:y Documents/Visual Studio Projects/WhatsNewAttributes/bin/Debug/VectorClass.EXE.
LOG: Attempting download of new URL file:y Documents/Visual Studio Projects/WhatsNewAttributes/bin/Debug/VectorClass/Vect
orClass.EXE.
I am not able to rectify it comes near "Assembly theAssembly = Assembly.Load("VectorClass");" in the lookupwhatsnew class .
Can anyone tell me what went wrong and how to rectify it
thanks in advance
sasi
|
|
|
|
|
Hello, I have a WebBrowser Control in Windows Form and The following code is generating an error
for (; webBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE; )
{
// Tasks
}
Error :
Operator '!=' cannot be applied to operands of type 'System.Windows.Forms.WebBrowserReadyState' and 'SHDocVw.tagREADYSTATE'
Can you help me by giving me the clue please.
Thanks
Emran
|
|
|
|
|
Because they are of different types. Try this instead:
for (; webBrowser1.ReadyState != WebBrowserReadyState.Complete; )
{
// Tasks
}
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Thanks a loot. your code is working..
|
|
|
|
|
You are welcome
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi all,
I have created a resource file using a Resource Editor
this file consists of images for my fomrs,then
have added this resource file in my project and now i want to
insert the images from this resource file to the picturebox on the main MDI
form. but this gives me problem.
The code that i have written is as follows.
System.Reflection.Assembly assembly;
assembly = this.GetType().Assembly;
System.Resources.ResourceManager rm = new System.Resources.ResourceManager
("WebBlogGenerator.manage", assembly);
here WebBlogGenerator is the name of my project and manage is the resource file name.
now i get the image from the resource file
Image managedomainmouseover = (System.Drawing.Image)rm.GetObject
("managedomain");
and i get the error on this line saying that
An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "WebBlogGenerator.manage.resources" was correctly embedded or linked into assembly "Web Blog Generator".
baseName: WebBlogGenerator.manage locationInfo: <null> resource file name: WebBlogGenerator.manage.resources assembly: Web Blog Generator, Version=1.0.2231.31335, Culture=neutral, PublicKeyToken=null
i had used the same code for a project earlier
but this is giving me an error
Can anyone help me out
or suggest me another way to create a resource file of the images that
i am using in my project.
Thanks and Regards,
Pramod
|
|
|
|
|
Hi,
I can show you the way I am using and it is working fine with me.
I added image files from "Add existing Items" Under Project Name of Solution Explorer.
then, I am using a method to poplulate a picture box from Resource.
fillPicBoxFromResource(ref picBoxGoHome, "Images.home1.gif"); // Images was the name of the Folder where I kept images under Project.
you can use this way too,
fillPicBoxFromResource(ref picBoxGoHome, "home1.gif"); // Images was the name of the
private void fillPicBoxFromResource(ref PictureBox pB, string resourcePath)
{
Stream imgStream = null;
// get a reference to the current assembly
Assembly a = Assembly.GetExecutingAssembly();
// get a list of resource names from the manifest
string[] resNames = a.GetManifestResourceNames();
foreach (string s in resNames)
{
if (s.EndsWith(resourcePath))
{
imgStream = a.GetManifestResourceStream(s);
if (!(null == imgStream))
{
pB.Image = Bitmap.FromStream(imgStream) as Bitmap;
imgStream.Close();
imgStream = null;
}
}
}
}
Another Alternative :
Select the picture box and Choose Picture you want to add to resource. Click Project Resource , ( not local resource). Then change the picture and keep on adding pictures in Project resource.
Now, this one liner will load the picture from resource to Picture box.
this.pictureBoxName.Image = global::ProjectName.Properties.Resources.pictureName;
pictureName will be easily found from Intellisense.
Hope this solution will help you.
EMRAN
-- modified at 7:16 Thursday 9th February, 2006
|
|
|
|
|
But will that work if i create a exe and execute it on another machine
without any problems.
Pramod
|
|
|
|
|
I dont see any reason why it wont work. The images you add in your project, you must choose the build option embedded resource ( for the first method I have shown ).
for the second method, you dont have to choose build option, as you will choose those images from picture box's "choose image" .
Let me know if you dont get those working..
|
|
|
|
|
i tried the first method but that is not working
the image is not displayed.
i did not get the second method
can u give any other way..
Thanks,
Pramod
|
|
|
|
|
Ok,
I am explaining the second method.
=>When you select the picture box in design mode, you see an black arrow on top of the control, right ? click that, you see the following options,
- Choose Image
- Size Mode
- Dock in parent Container.
=> Ok, so Choose Image.
=> Now you have 2 options,
- Local Resource,
- Project Resource File.
Click on Project Resource File Radio Button,
then Click Import,
Choose a picture and then click Ok.
Now, note that, the picture you added has been added in Project Resource file. Now if you click that black arrow again and choose another picture for the same picturebox, the previous image is not deleted from the project resource, it is still there.
Now, you do the same process again and again for all the pictures you want to add in your project resource.
When you are ready with all the pictures you wanted to add, you can use the code I gave you to load any picture from project resource. I am giving you the code again,
this.pictureBoxName.Image = global::projectName.Properties.Resources.original_picture_name; (without extension...) you dont need to type the name of the picture. When you follow the intellisence of the Visual C# Editor, you will see the picture name after typing
this.pictureBoxName.Image = global::projectName.Properties.Resources.
Ok, The picturebox you used to import all these picture in Project Resource is not the only picturebox who can load these resource images. Any other picture box will be able to load these images with the code I mentioned.
May be it is very inefficient way, but it is working for me very nice.
Let me know if still this method not working..
Emran
-- modified at 9:33 Thursday 9th February, 2006
|
|
|
|
|
sorry but i cant see any arrow on the picturebox
i am using VS.2003
Thanks,
Pramod
|
|
|
|
|
Oh I see.... I did not use VS 2003 and I am sorry about that. I thought you were using VS 2005. I am using VS 2005 Express which is free to download and way more rich. Anyway, if you use VS 2005, i hope my code will be helpful for you.
|
|
|
|
|
|
Hi everyone,
I used the sample bars project which in turn uses BandObjects to be used as an IE toolbar. The problem is that on some machines bandobjects library does nto work. The damned toolbar simply does nto get selected for display. I thought it was an IE problem until I installed Motley Fool toolbar (which is written in VC++) and it (Motley fool toolbar) worked. It actually showed up. However my toolbar using band objects still refuses to work on that machine.
Can anyone please help me? I would be very greatful.
- Aslam
|
|
|
|
|
Can i pass command line arguments to a running instance of my application??
|
|
|
|
|