
mrdutchie
Avatar/Signature-
Posts
80 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mrdutchie
-
When I select a cell, then the whole row will be highlighted, and that's fine. But the cell that I clicked on, will show the cursor behind the word, and the color of it changes. I want disabled, BUT still I want be able to select/deselect my Checkbox in that row. How to do that?
-
Hmm... maybe a source to peek at? :)
-
I am looking into Paging for a Datagrid/Listview, but I don't have that option DataGrid.AllowPaging Property [Visual Basic] (MSDN Helpfile) Cause it seems like this is a way to make the Datagrid better with huge amount of rows. and how to get Paging in a Listview (if possible) since loading 40.000 takes way to long What do I need to do, to make it work?
-
Ok, tried it, and is working too now, but it takes about 10 seconds for all the items to show up.. it's still way too long, since when I see other programs, it only takes 2-3 seconds..
-
No I didn't.. since I wanted the checkboxes also.. Let me check right now to see if that's faster or not
-
Is there a way to load 40.000+ items in a "Checkedlistbox" in just 2-3 seconds? (like other news programs do) I am able to put it in a Datagrid with that speed, but would like the checked listbox for it. With the datagrid it looks like this line is making it so fast myDataSet.Tables(ImportFileName).Rows.Add(CurrentLine.Split(" ")) I tried this in a listbox but then again... it's very slow and the data is not right. I am using VB.NET and it's a Windows application. Any thoughts on this?
-
Well... I'm back for some reason I don't have those command available for my datagrid. I'm totally puzzled with this line (this is a modified source I found for a datagrid) myDataSet.Tables(ImportFileName).Rows.Add(aa) aa is some kind of array a(0)="a.b.test" a(1)="34" a(2)="345" Still unable to add a checkbox because of that line. So I have in my textfile "False a.b.test 34 345" So the first value will fill the checkbox for me, and that works.. (I am sure there is a better way) But I want to change the columnwidth from 1 of the columns, but I don't have the right command showing up when I type.
-
Thanks.. My project is Windows, let's see if I can get smarter with that one..
-
Yeah I tried something like that, and even your code. but doesn't work.
-
Hehe... you have Experience with that I see... I'll keep it in mind for next time.... hmm... any Idea how to put a checkbox in a column easy? playing with that now...but no luck so far
-
lol.. Yep and I was looking at it for over a week... :o
-
It's working now.. duh had 2 lines in the wrong order PREV 'myColumn.DataType = System.Type.GetType("System.Int32") myColumn.DataType = System.Type.GetType("System.String") myColumn = New DataColumn("Start") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) 'myColumn.DataType = System.Type.GetType("System.Int32") myColumn.DataType = System.Type.GetType("System.String") myColumn = New DataColumn("End") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) NOW myColumn = New DataColumn("Start") myColumn.DataType = System.Type.GetType("System.Int32") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) myColumn = New DataColumn("End") myColumn.DataType = System.Type.GetType("System.Int32") myDataSet.Tables(ImportFileName).Columns.Add(myColumn)
-
Hi there, if someone could help me with this, I would really appriciate that. When I import a testfile into a datagrid I am able to sort the columns but column 2 and 3 are numbers, so those are not sorting right since it is a String. I tried to make it as a Int32, Int16 but then it's failing on this line "myDataSet.Tables(ImportFileName).Columns.Add(myColumn)" I only can import it as a string. I can't figure out how to do it as a number or Int. What do I need to do to make it work?? Thanks so much Public Sub ExecutImport() Dim myReader As New System.IO.StreamReader(clsFileAndPath) Dim CurrentLine As String Dim IsFirstLine As Boolean Dim myTable As New DataTable Dim SqlTable As New DataTable Dim ColumnName As String Dim tmpCount As Integer Dim ColumnCount As Integer Dim myColumn As DataColumn Dim myRowSql As DataRow Dim myRowTable As DataRow Dim RowCount As Integer Dim ImportFileName As String Dim aa() As String Dim bb As Long Dim cc As Long Dim dd() As String clsTotalRows = GetTotalRows() If clsCrossRefTableName <> "" Then Dim myConnection As New SqlClient.SqlConnection(clsCrossRefTableConString) Dim myCommand As New SqlClient.SqlCommand(clsCrossRefTableFillCmd) Dim daCRT As New SqlClient.SqlDataAdapter(myCommand) myCommand.Connection = myConnection SqlTable = New DataTable(clsCrossRefTableName) myDataSet.Tables.Add(clsCrossRefTableName) daCRT.Fill(myDataSet.Tables(clsCrossRefTableName)) End If ImportFileName = FileName myTable = New DataTable(ImportFileName) myDataSet.Tables.Add(ImportFileName) While myReader.Peek <> -1 CurrentLine = myReader.ReadLine If IsFirstLine = False Then myColumn = New DataColumn("Group") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) 'myColumn.DataType = System.Type.GetType("System.Int32") myColumn.DataType = System.Type.GetType("System.String") myColumn = New DataColumn("Start") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) 'myColumn.DataType = System.Type.GetType("System.Int32") myColumn.DataType = System.Type.GetType("System.String") myColumn = New DataColumn("End") myDataSet.Tables(ImportFileName).Columns.Add(myColumn) aa = CurrentLine.Split(" ") bb = CInt(aa(1)) cc = CInt(aa(2)) myDataSet.Tables(ImportFileName).Rows.Add(aa) myRowTable = myDataSet.Tables(ImportFileName).Rows(RowCount) RowCount += 1 End If If IsFirstLine = False Then IsFirstLine = True tmpCount = 0 Else myDataSet.Tables(ImportFileName).Rows.Add(CurrentLine.Split(" ")) myRowTable = myDataSet.Tables(ImportFileName).Rows(RowCount) RowCount += 1 End If End While clsImportedDataSet = myDataSet End Sub
-
nm.. figured it out
-
for several days I can't figure out how to make a new connection after I disposed it. So I want to connect, disconnect, connect etc..... What am I missing here? This is what I have Public mysocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Public theend As Boolean Public server As String = "news.ultrafeed.com" Public serverport As Long = 119 Public ipsolve As IPHostEntry = Dns.Resolve(server) Public ipend As New IPEndPoint(ipsolve.AddressList(0), serverport) Public bb(1024) As Byte Public Sub login() If mysocket.Connected = True Then MsgBox("Allready connected") Exit Sub Else Dim server As String = "news.ultrafeed.com" Dim serverport As Long = 119 Dim ipsolve As IPHostEntry = Dns.Resolve(server) Dim ipend As New IPEndPoint(ipsolve.AddressList(0), serverport) Dim mysocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) End If Dim msg1 As Byte() = Encoding.ASCII.GetBytes("AUTHINFO user xxxx" & vbCrLf) Dim msg2 As Byte() = Encoding.ASCII.GetBytes("AUTHINFO pass xxxx" & vbCrLf) mysocket.Connect(ipend) bb.Clear(bb, 0, 1024) bytes = mysocket.Receive(bb, bb.Length, 0) txtinfo.Text = Encoding.ASCII.GetString(bb) loginfo.Text = Encoding.ASCII.GetString(bb) mysocket.Send(msg1, 0, msg1.Length, 0) bb.Clear(bb, 0, 1024) bytes = mysocket.Receive(bb, bb.Length, 0) txtinfo.Text = Encoding.ASCII.GetString(bb) loginfo.Text = Encoding.ASCII.GetString(bb) mysocket.Send(msg2, 0, msg2.Length, 0) bb.Clear(bb, 0, 1024) bytes = mysocket.Receive(bb, bb.Length, 0) txtinfo.Text = txtinfo.Text + Encoding.ASCII.GetString(bb) loginfo.Text = loginfo.Text + Encoding.ASCII.GetString(bb) End Sub Private Sub Disconnect() Dim msg2 As Byte() = Encoding.ASCII.GetBytes("QUIT" & vbCrLf) bb.Clear(bb, 0, 1024) mysocket.Send(msg2, 0, msg2.Length, 0) bytes = mysocket.Receive(bb, bb.Length, 0) txtinfo.Text = txtinfo.Text + Encoding.ASCII.GetString(bb) mysocket.Shutdown(SocketShutdown.Both) mysocket.Close() End Sub
-
Hmm... can't figure out the addrange method.. Looked at some examples, but still clueless
-
Ok, I have a testfile with 40.000 lines I want to add all of these in a control. I tried Listview and it's very slow.. takes about 50 seconds to load I did use the event listview1.beginupdate and .endupdate so that speeds it up a little bit to 14 seconds , but still to slow.. Here is the source, and I hope someone can help me.. cause I see the newsreaders doing it within 1-2 seconds Dim s As Array Dim w As String Dim f As String = "C:\newsgroups.txt" Dim stream_reader As New IO.StreamReader(f) Dim he As Long Dim tmpImportProgress As Double Dim splitlist(2) As String Dim aas As String Dim z As Long Dim zz As Long z = GetTotalRows() he = z z = z - 1 s = (Split(stream_reader.ReadToEnd, vbCrLf)) stream_reader.Close() Dim c1, c2, c3 As String Dim a() As String = s(0).Split(Chr(10)) ListView1.BeginUpdate() Application.DoEvents() For x = 1 To a.Length - 2 splitlist = a(x).Split("<PKA>") c1 = splitlist(0) c2 = Mid(splitlist(1), 5, Len(splitlist(1)) - 4) c3 = Mid(splitlist(2), 5, Len(splitlist(2)) - 4) If x > 20 Then Application.DoEvents() Dim listItem1 As New ListViewItem(splitlist(0)) listItem1.SubItems.Add(c3) listItem1.SubItems.Add(c2) listItem1.SubItems.Add(c2 - c3) fakeListView.Items.Add(listItem1) ListView1.Items.Add(listItem1) tmpImportProgress += (100 / he) clsImportProgress = CInt(tmpImportProgress) RaiseEvent ImportProgress() Next Application.DoEvents() For zz = 0 To he - 1 '9 Dim listItem As New ListViewItem(fakeListView.Items(zz).SubItems(0).Text) listItem.SubItems.Add(fakeListView.Items(zz).SubItems(1).Text) listItem.SubItems.Add(fakeListView.Items(zz).SubItems(2).Text) listItem.SubItems.Add(fakeListView.Items(zz).SubItems(2).Text - fakeListView.Items(zz).SubItems(1).Text) ListView1.Items.Add(listItem) Next ListView1.EndUpdate() and here is a part from the newsgroups.txt basicly <PKA> is for seperating to different columns. So Newsgroup Endnumber Startnumber 24hoursupport.helpdesk<PKA>922050<PKA>739010 3b<PKA>5174<PKA>4224 3b.config<PKA>29105<PKA>27724 3b.misc<PKA>28002<PKA>26610 3b.tech<PKA>12728<PKA>11546 3b.test<PKA>95298<PKA>88012 Thanks so much
-
OK, I have this now and it reads it very fast into s(0) but still adding to the listviewer takes forever. Dim s As Array Dim w As String Dim f As String = "C:\newsgroups.txt" Dim stream_reader As New IO.StreamReader(f) s = (Split(stream_reader.ReadToEnd, vbCrLf)) stream_reader.Close() ' MsgBox("done") This takes only 1 second and ' all the data is in s(0) Dim a() As String = s(0).Split(Chr(10)) For x = 1 To a.Length - 1 ListView1.Items.Add(a(x)) Next What am I missing here?
-
Thanks, I will look into that again. I remember trying that once before and never got it to work :(
-
Hi, I am trying to read a Textfile with 40.000 lines into a listbox so I am reading each line and add it to the listbox, but that takes about 15-20 seconds... way to slow :( Isn't there a faster way to do it? Cause I found a routine that only takes 4-8 seconds but that reads it into a Datagrid and that's not what I want.
-
Well, If I do a LIST command for all the newsgroups, I guess I can do a Bytes(9999999) as byte I guess But then I still can't figure out how to continue when it stops. I know it ends with a '.' Then need to figure out how to break the whole thing into 55000 lines. (amount of newsgroups)
-
I am stuck with the following I am asking for the LIST command on the newsserver so I will receive all the newsgroups. I am doing this Do bytes = mysocket.Receive(bb, bb.Length, 0) ListBox1.Items.Add(Encoding.ASCII.GetString(bb)) Loop While bytes > 0 but at the end it lockes up, cause it's getting stuck in that loop how can I tell it to continue with something else as soon as I don't receive data anymore? Thanks
-
I am trying to create a Binaries reader, and a little confused with how to get a complete list from a news server. This is what I have txtinfo = my Textbox where I want to show it. This is the connect to server part Dim mysocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Dim server As String = "news.usenetserver.com" Dim serverport As Long = 119 Dim ipsolve As IPHostEntry = Dns.Resolve(server) Dim ipend As New IPEndPoint(ipsolve.AddressList(0), serverport) Dim b(1024) As Byte Dim mytext As Byte Dim msg1 As Byte() = Encoding.ASCII.GetBytes("AUTHINFO user myname" & vbCrLf) Dim msg2 As Byte() = Encoding.ASCII.GetBytes("AUTHINFO pass mypassword" & vbCrLf) mysocket.Connect(ipend) mysocket.Receive(b, 1024, SocketFlags.Partial) txtinfo.Text = Encoding.ASCII.GetString(b) mysocket.Send(msg1, 0, msg1.Length, SocketFlags.None) mysocket.Receive(b, 1024, SocketFlags.Partial) txtinfo.Text = Encoding.ASCII.GetString(b) mysocket.Send(msg2, 0, msg2.Length, SocketFlags.None) mysocket.Receive(b, 1024, SocketFlags.Partial) txtinfo.Text = Encoding.ASCII.GetString(b) ------------------------------------------------------------------------ This is the command I am trying to do, but don't know how to get the whole list with repeating the last part of the code the whole time. There must be someway to do it, but I can't figure it out. Anyone knows?? Thanks so much.. test="LIST" Dim msg3 As Byte() = Encoding.ASCII.GetBytes(test & vbCrLf) mysocket.Send(msg3, 0, msg3.Length, SocketFlags.None) mysocket.Receive(b, 1024, SocketFlags.None) txtinfo.Text = Encoding.ASCII.GetString(b)
-
I did some research in RSS but this is all for ASP ? Am i missing something, cause all I want is to create a program like : Newsbin / Binnews / Newsleecher
-
Thank you. I will try that :)