|
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
|
|
|
|
|
hi,
how can i add progress bar to the vb application.
thanx
raj
|
|
|
|
|
Drag and drop a ProgressBar control, out of the ToolBox, onto your form. Set it's properties to what you need and wite up some code to update it once in a while.
Anything else, and you'll have to get much more specific about the problem you're having.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Place a progressbar onto form and then in coding you will be able to control its value including minimum and maximum
This sample will count from 1 to 100 and the current counter value will be assigned to progressbar1
Progressbar1.minimum = 1
Progressbar1.maximum = 100
Progressbar1.visible = true
Dim I as Int32 = 0
For I = 1 to 100
Progressbar1.value = I
next
|
|
|
|
|
Actually, that won't do anything. Since your code is blocked by the loop, no updates to the UI portion of the control will be possible!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It was a sample code about how to use progressbar1. Actually there won't be any problem with it but just only the loop will run faster so user won't able to recognize it... My aim was to show how to use it!
|
|
|
|
|
How do I call a file from the folder the .exe is in, so of course it only has to be in the same folder and not specify the C:/etc?
The .exe root folder.
|
|
|
|
|
Dim strPath As String = Application.StartupPath & "\YourFileName.xyz"
|
|
|
|
|
Imports System.Io
.
.
.
Dim myFilePath As String = Path.Combine(Application.StartupPath, "myFileName.txt")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have create the bookmark in the middle of a sentence named "a"
How can I define a range(word.range) that marked start at the begin of "a",
and the end at 5 charaters after(right hand side) the bookmark?
What I want to do is like this, but I don't want the user see what is highlighted.
<br />
oWord.activeDocument.range.GoTo(Word.WdGoToItem.wdGoToBookmark, Word.WdGoToDirection.wdGoToAbsolute, 1, "a")<br />
oWord.Selection.MoveRight(Word.WdUnits.wdCharacter, 5, Word.WdMovementType.wdExtend)<br />
MyData = oWord.selection.text<br />
Thank You!
|
|
|
|
|
Oh, I found my code is wrong,
anyway, please advise for the text description.
Thank you !
|
|
|
|
|
I am trying to receive xml files on my server which are posted from another server using http post. I need help in designing a receiver which will accept this xml file and send back a success message back to the sender. Can someone give me some code examples on how to design this piece? I am having difficulty proceeding with the design here. Any help will be appreciated. You can also email me code samples at jacktundra@removethis-hotmail.com
|
|
|
|
|
Hi all,
I am trying to do a simple database display ( 1 combo box 3 or 4 textboxs in readonly) and then have a it all controled by a class.
i can get this done already if i dont use a class and just bind the combo / textboxes to the database but im really stumped on how to do it in a class
can anyone help me out?
|
|
|
|
|
I think you have set connectivity to database out of class what is preventing you in creating the tiers. My suggestion for easiet solution would be try to connect to database inside the class so you can easily pass the values from db to combo or text boxes with SET Values... You could easily populate those withing the class...
Just another perspective!
|
|
|
|
|
Hi All,
Ok I've been at this for a week now and obviously I don't get it. I've got some of the code right cause it does work but as soon as I try to save a url it tells me that URI's cannot be put into a richtext box. ?? I have a button that opens a SaveFileDialog box and the way it is now works just fine but when I try to save the url that's in my AxWebBrowser it doesn't work. What I am doing wrong here? What am I just not getting? (Yes Newbbie )
This is my code for the button so far:
Private Sub Faves_b_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Faves_b.Click<br />
<br />
' Find the directory of the user's Favorites.<br />
<br />
Dim objRegKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser<br />
<br />
Dim objFav As Microsoft.Win32.RegistryKey = objRegKey.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")<br />
<br />
Dim strFavoritesPath As String = objFav.GetValue("Favorites")<br />
<br />
' Set properties of Dialog-box.<br />
<br />
Dim myStream As Stream<br />
<br />
Dim SaveFileDialog As New SaveFileDialog<br />
<br />
Dim URLName = AxWebBrowser.LocationName<br />
<br />
Dim URLAddress = AxWebBrowser.LocationURL<br />
<br />
SaveFileDialog.Title = "Add To Your Favorites"<br />
<br />
SaveFileDialog.InitialDirectory = strFavoritesPath<br />
<br />
SaveFileDialog.FileName = URLName<br />
<br />
SaveFileDialog.Filter = "URL Files (*.url)|*.url"<br />
<br />
SaveFileDialog.FilterIndex = 1<br />
<br />
SaveFileDialog.DefaultExt = "*.url"<br />
<br />
SaveFileDialog.RestoreDirectory = True<br />
<br />
' Now display the SaveFileDialog so the user can save the url.<br />
<br />
SaveFileDialog.ShowDialog()<br />
<br />
' If the file name is not an empty string save it .<br />
<br />
If SaveFileDialog.FileName <> "" Then<br />
<br />
Dim RichTextBox As New RichTextBox<br />
<br />
RichTextBox1.LoadFile(URLAddress)<br />
<br />
RichTextBox.SaveFile(URLAddress, RichTextBoxStreamType.RichText)
End If
End Sub
Thanx to anyone that can contribute to the "Help the Newbbie Program"
|
|
|
|
|
All youre'trying to do is save a URL as a shortcut somewhere, right?
Deceptively easy! Have you ever just opened one in Notepad? All you have to do is create a normal text file, with the filename ending in .URL and write this to it:
[InternetShortcut]
URL=urlPath
For example, Yahoo.URL:
[InternetShortcut]
URL=http:
I have no idea what you're trying to do with a RichTextBox. It doesn't support loading HTML files...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:19 Thursday 9th February, 2006
|
|
|
|
|
Hey someone answered. lol I posted this in a couple of different forums and this is the only one that's answered me. Yes all I'm trying to do is save a url link from my browser. That's it! I've tried just saving a text file with the url extension but again I must be doing something wrong cause I can't seem to get it to write on the file. Can you help me out with this too?
|
|
|
|
|
Well, in the code that you posted, you didn't open any file and write anything to it. The RichTextBox won't do anything for you and you're using it's methods incorrectly.
You're looking for something most like this:
If SaveFileDialog.ShowDialog = DialogResult.OK Then
Dim fs As Stream = SaveFileDialog.OpenFile()
If Not (fs Is Nothing) Then
fs.WriteLine("[InternetShortcut]")
fs.WriteLine(String.Format("URL={0}", URLAddress))
fs.Close()
End If
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
When I put the code in there it tells me that "WriteLine" is not part of System.IO.Stream???
|
|
|
|
|
Too damn sleepy last night. A little simpler:
If SaveFileDialog.ShowDialog = DialogResult.OK Then
Dim sw As New StreamWriter(SaveFileDialog.FileName)
sw.WriteLine("[InternetShortcut]")
sw.WriteLine(String.Format("URL={0}", URLAddress))
sw.Close()
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thank you very much, it works just fine now. Now that I can add to favorites, the next step is to open them in my WebBrowser.
Thanks for your help
|
|
|
|
|
Start it in a browser on your form or just launch the thing like someone double-clicked the shortcut on the desktop?
If it's to launch the shortcut like double-clicking it, then all you have to use is use the Process class.
Dim newProcess As New Process("filename.url")
newProcess.Start()
If it's a browser on your form, then all you have to do is call the browser's .Navigate() method, passing in the full path to the *.URL file.
WebBrowser1.Navigate("filename.url")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI Dave,
Yeah I want to open the url link in my browser on my form. The Code you wrote is what I was thinking of putting. Glad to see I'm thinking in the right direction.
One thing though that I noticed as I was testing the first code you helped me on was that the names of some pages have these "<, >, *, |, :, \, /, &, %, ", ., #, ?" type characters and therefore the expected error comes up that the page name is not valid for saving. Now if you remember I'm taking the Variable URLName = WebBrowser.LocationURL string and using that as the SaveFileDialog.FileName. Could you dirrect me in the right track in order to check if the URLName variable has any of those characters and change them to a usable character like maybe the "-" or "_" characters before it is used in the SAveFileDialog box as the FileName?
-- modified at 23:39 Friday 10th February, 2006
|
|
|
|
|
|
Perhaps if you write the question in the text instead of in the subject, you will have room enough to describe the problem so that anyone can help you.
---
b { font-weight: normal; }
|
|
|
|