|
I have an application that uses a datagrid and links a dataview to this datagrid.
I have some 284,000 rows in the datagrid and a sort takes 3.5 seconds (which I consider to be a decent response time). I'm not sure what sort of speed you are looking for.
As a DBA I would suggest not sorting the data but rather building an index object and link this to your collection.
You can then sort the index instead of your collection.
You could build an arraylist that links to your collection.
Sort the arraylist(index) instead of the collection et voila...
Let me know if this is helpful or totally goofy...
You always pass failure on the way to success.
|
|
|
|
|
Thank you both for you input.
I had a bit of a play around with the datagrid and it does work well but this part of the program doesn't need to have a UI. I'm working with the index idea right now, seems to be working fine for what I need, still slow compared to the datagrid but no big deal. I have threaded it to so that the program dosn't lock up.
Thanks
|
|
|
|
|
Can i possibly put two tables on one gridview?how to navigate it? how can i connect it on SQL?tnx for the replies;)
-- modified at 3:00 Friday 7th September, 2007
|
|
|
|
|
|
how can i attach the powerpoint file .ppsx in vb.net
i want a path to show that file
plz send me accurate code
lucky
|
|
|
|
|
Lucky Sheikh wrote: how can i attach the powerpoint file .ppsx in vb.net
Attach it to what?
Lucky Sheikh wrote: i want a path to show that file
Show it where?
Lucky Sheikh wrote: plz send me accurate code
Please write accurate questions.
|
|
|
|
|
'its urgent' is a subject that is not asking for help from the codeproject community, users have a tendency to just ignore messages that say urgent. In the subject just use a general subject question.
Please clarify the question that you are asking.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi all,
I am using this code to redirect the console output continiuly
[code]
Dim clsProcess As New System.Diagnostics.Process()
clsProcess.StartInfo.UseShellExecute = False
clsProcess.StartInfo.RedirectStandardOutput = True
clsProcess.StartInfo.FileName = "ping"
clsProcess.StartInfo.Arguments = "127.0.0.1 -t"
clsProcess.Start()
While (clsProcess.HasExited = False)
Dim sLine As String = clsProcess.StandardOutput.ReadLine()
If (Not String.IsNullOrEmpty(sLine)) Then
Me.TextBox1.Text &= sLine & vbCrLf
End If
Dim sErrorLine As String = clsProcess.StandardError.ReadLine()
If (Not String.IsNullOrEmpty(sErrorLine)) Then
Me.TextBox1.Text &= sErrorLine & vbCrLf
End If
Application.DoEvents()
End While
[code]
This Code Not working Propertly.It some time omits the error output.
How can I solve this issue
Or Is there any other method avaliable to redirect the console output in realtime and close the window when the console closes
Thanks in Advance
Dana
|
|
|
|
|
danasegaranea wrote: Or Is there any other method avaliable to redirect the console output in realtime
In realtime?? Yes, but yor're code is nowhere close to being able to do that.
You'd have to setup asynchronous callbacks and use the BeginRead method for each stream you wanted to read.
First, if all you're doing is pinging a machine and reading the output, why don't you use the built in Ping command in VB.NET 2005?? Or are you looking to do this with some other command line app?
|
|
|
|
|
Hello,
I have some text that is manipulated in RichTextBox. I want to add the contents of RTB in a Word document. I have written the code, but, it doesn't insert any text. The code just adds 2 pages in the document, and asks for Save Dialog(is expected). Can anyone help me, where am i going wrong.
<br />
Dim wApp As New Word.Application<br />
Dim wDoc As Word.Document<br />
Dim wdPgBrk As Word.WdBreakType = Word.WdBreakType.wdPageBreak<br />
<br />
wApp.Visible = True<br />
Dim rtb As RichTextBox = New RichTextBox()<br />
<br />
' Create a new document<br />
wDoc = wApp.Documents.Add()<br />
<br />
Dim i As Integer<br />
For i = 0 To 2<br />
<br />
' Load file in RTB<br />
rtb.LoadFile("D:\ORG Coded DE\DEA 2\DEA 2\Templates\Sample1.rtf")<br />
<br />
' Make Changes in rtb text - Replacing some text<br />
<br />
' Assign rtb text to wDoc<br />
wDoc.Content.Text = rtb.Text<br />
<br />
' Insert a page break in the word document<br />
wDoc.Content.InsertBreak(wdPgBrk)<br />
Next<br />
wDoc.Save()<br />
<br />
wdPgBrk = Nothing<br />
rtb = Nothing<br />
wDoc = Nothing<br />
wApp = Nothing<br />
<br />
I want to copy the rtb contents with its format.
I would be glad if anyone can assist me.
Thanks
Terry
|
|
|
|
|
try this
<br />
Public Target As Object = temppath & "\temp.rtf"<br />
<br />
Dim format As Object = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF<br />
<br />
'Changing the format of the document<br />
newApp.ActiveDocument.SaveAs(Target, format, Unknown, Unknown, Unknown, Unknown, _<br />
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, _<br />
Unknown, Unknown, Unknown, Unknown)<br />
<br />
' for closing the application<br />
newApp.Quit(Unknown, Unknown, Unknown)
if it works please let me know
help everyone
|
|
|
|
|
eyes, thanks for giving the info to save as an rtf file. I am looking for something more:
Insert contents of an RichTextBox into current page of the Document
Insert a Page Break
Loop up this procedure till required. I got the way to insert a page break, but not to insert contents.
Can you throw light on it, please! For more reference, please refer the code.
Thanks
Terry
|
|
|
|
|
have you tried the
newApp.ActiveDocument.merge()
help everyone
|
|
|
|
|
For doing merge, I will have to save the contents of RichTextBox in a file, & then merge that file in Document. Can't the other way out be worked. As this merge will increase 2 steps of my procedure. Additionally, I tried but, the following code gives me error
<br />
For i = 0 To 2<br />
<br />
' Load file in RTB<br />
rtb.LoadFile("\Sample1.rtf")<br />
<br />
' Make Changes in rtb text - Replacing some text<br />
rtb.AppendText("DOCUMENT " + i.ToString())<br />
rtb.SaveFile("\Sample1Temp.rtf") '*********** Error<br />
rtb.Clear()<br />
' Assign rtb text to wDoc<br />
wDoc.Content.Text = rtb.Text<br />
<br />
' Insert a page break in the word document<br />
wDoc.Content.InsertBreak(wdPgBrk)<br />
wDoc.Merge("\Sample1Temp.rtf")<br />
Next<br />
Once the For loop is executed, first time Sample1temp.rtf is merged in the WDoc object. Second time, on saving Sample1Temp.rtf, gives error "saying it is already in use with other process."
Thanks
Terry
|
|
|
|
|
Dear everyone...
i have problem that i have 10 listboxes onto my form.
i want to display a command button but it should be displayed along with the same listbox where i am present or where i am recently clicking.
so i need to store the active control name in a variable.
please tell me that how i can get current control name.
thanks
|
|
|
|
|
sorry to say that but i just can't understand your problem, can you please describe it more.
as much i think, you need a button when you select a listbox out of your 11 list boxes(am i right). make a button on runtime and make it show hide or set its visible property to true or false as per your need on given position. you have to add a handler to handle its events and don't forget to dispose the handler when you don't need it.
hope this help
help everyone
|
|
|
|
|
Try This:
Have a variable accessible to all subs.
Dim LastControl as Control
Then on each of the listboxes click event put this.
LastControl = sender
Then on the command button click:
LastControl should equal the listbox last clicked.
|
|
|
|
|
Why is that property AutoCompleteCustomSource of a TextBox wont work when you set its property as multiline?? and once you bring it back as non-multiline textbox then it works and show the AutoCompleteSource?
what if i want to use a textbox as multiline and to show autoCompleteSource once it TextChanged occur?
Please anybody there who can explain it to me briefly...
and if anyone have the idea how to do that???
Thanks... I appreciate to anyone who reply with me..
Thanks again...
|
|
|
|
|
please remove the double entry of your question.
help everyone
|
|
|
|
|
Not supported. I wouldn't expect a multiline TextBox to use AutoComplete.
Here's the problem with trying to do it: Are you trying to use AutoComplete on the entire contents of the multiline TextBox, or are you tryin to use it on each line of a multiLine TextBox??
|
|
|
|
|
In a previous program I was able to add the reference Microsoft.Office.Core
This enabled me to open Excel in the background using my VB.Net Program.
With the new program however when I go looking for the same reference I can only add...
Interop.Microsoft.Office.Core
I think this is the reason for my error
"'New' cannot be used on an interface."
My code looks like this
xlsApp = New Excel.Application<br />
xlsApp.Visible = False
If I try to bring the "Microsoft.Office.Core" across by adding a reference, it sees the "Microsoft.Office.Core" but imports it as "Interop.Microsoft.Office.Core".
Grateful for any helpful suggestions.
|
|
|
|
|
frankiebaby2 wrote: If I try to bring the "Microsoft.Office.Core" across by adding a reference, it sees the "Microsoft.Office.Core" but imports it as "Interop.Microsoft.Office.Core".
I don't do Office Interop at all, so this may be wrong.
But, did you add the reference to the Excel Object Library under the COM tab, or did you use the Office Primary Interop Assemblies under the .NET tab??
|
|
|
|
|
Thanks Dave, I did add it in under COM, and have it running. Thanks for answering.
|
|
|
|
|
The files I read and write must be compatible with legacy programs (VB6, C++).
The file is header information followed by a data array. For example;
'This is the current file header.
Private Structure CvsImageStructure
Friend FileID As Byte
Friend Rows As Short
Friend Columns As Short
Friend Images As Short
Friend StoredDataType As Byte
Friend CompressionSlope As Single
Friend CompressionIntercept As Single
Friend SerialNumber As String
Friend DefectDescriptions As String
End Structure
The next part of the file is a data array. It may be Byte, Int16 or Single. The StoredDataType element in the header tells me what the data type is.
I can read the data one element at a time in a for next loop (i.e. BR.ReadSingle). However, this is painfully slow. In some cases there will be more than 1,000,000 elements in the array. Is there a way to quickly read the entire data array into a Single precision array (or Byte or Int16)?
Some of these files were created in VB6 using the Put command
i.e.
Put #1, header
Put #1, sImageData()
The legacy program uses the VB6 Get command to read the files. It has to be able to read the files I create in VB.Net 2005.
-----
When the DefectDescriptions element of the structure in the file is blank, the binaryreader returns 73 characters (BR.ReadString), reading into the data array. I have a work around for this, but would appreciate some help correcting this problem.
|
|
|
|
|
Dave_6 wrote: Is there a way to quickly read the entire data array into a Single precision array (or Byte or Int16)?
Use ReadBytes to get the data into a Byte array, then use the BitConverter class to convert each set of bytes in the array to an Int16 or Single element in your array.
A quick and dirty example... Read a file containing 1,000,000 Singles and convert it to an array:
Using fs As New FileStream("C:\test.dat", FileMode.Open)
Using br As New BinaryReader(fs)
Dim buffer() As Byte
buffer = br.ReadBytes(fs.Length)
' A Single is 4 bytes long...
Dim singles(1000000) As Single
For x As Integer = 0 to 1000000 Step 4
sa(x \ 4) = BitConverter.ToSingle(buffer, x)
Next
End Using
End Using
The nice part about this method is that you can modify it to conver the Byte array into any size values you've read by simply changing the Step value and using a different conversion method on the BitConverter class.
|
|
|
|