Community Member
Member Avatar
Featured xrj 139 Gave Reputation to tinstaafl in LINQ GroupBy - VB.NET
Topic by KM499 in Software Development
According to your description it looks to me that your collection will contain objects that may have more than one name associated with each specific id. If this is the case then something along these lines might be closer to what you're looking for:

Dim dict = (From a In … Reply by tinstaafl
Member Avatar
Featured xrj 139 Replied To a Post in LINQ GroupBy - VB.NET
Topic by KM499 in Software Development
I'm not gonna give a neg. rep. point, not even discuss what does lambda syntax look like in any specific language. Just that if this is a vb.net thread it's not a c# or not even asp.net. Isn't it? Reply by xrj
Member Avatar
Featured xrj 139 Replied To a Post in LINQ GroupBy - VB.NET
Topic by KM499 in Software Development
Six thousand rows doesn't seem so much, unless having constant calls to the function.

Imports System.Linq

Public Class Properties
Private Sub Properties_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim A1() As A = {New A(1, "name1", "address1", "email1@email.com", "1234", "NY"),
New A(2, "name2", "address2", "email2@email.com", "5678", "LA"),
New … Reply by xrj
Member Avatar
Featured xrj 139 Replied To a Post in LINQ GroupBy - VB.NET
Topic by KM499 in Software Development
@ddanbe why don't express lambda expressions in VB.NET instead of c#? Reply by xrj
Member Avatar
Featured xrj 139 Replied To a Post in LINQ GroupBy - VB.NET
Topic by KM499 in Software Development

Do you mean somewhat like this?:

Imports System.Linq

Public Class Properties
Private Sub Properties_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim A1() As A = {New A(1, "name1", "address1"),
New A(2, "name2", "address2"),
New A(3, "name3", "address3")}
Dim q = (From p In A1 Select p.ID, p.Address).ToDictionary(Function(x) x.ID, … Reply by xrj
Member Avatar
Featured xrj 139 Began Watching LINQ GroupBy - VB.NET
Hi All,

I have a collection of huge records (6000+) wherein the object in the collections has got 50+ properties, so ideally it is not a good idea to run a "For-Each" loop here.
What I want is a "GroupBy" clause which would get me a Dictionary (Of String, String) … Topic by KM499 in Software Development
Member Avatar
Topic by jailani_1 in Software Development
Sorry, the original file was not attached. Reply by xrj
Member Avatar
Topic by jailani_1 in Software Development
Perhaps you'd like to emply 'mates8.dll' (in the attached file there is an example). There needs to be a reference to the dll and the imports statement. Then, you may parse simple expressions calling the Expression.parseExpression method.

![mates8daniweb.PNG](/attachments/small/3/236937961bc07f7fb0ebfdb5ddb07005.PNG "center")



Imports m8 = mates8

Public Class Form1

Private Sub Button1_Click(sender As … Reply by xrj
Member Avatar
i have started system calculater in vb.net using process.start() method but i want to retrive it s value in textbox , how can i do that Topic by jailani_1 in Software Development
Member Avatar
Topic by Jayanta_1 in Software Development
@Shark `purinvid` seems to be the table's key, so if it does not exist `result`will be 0 out from `executeScalar`and the row will be added. In the other case the row will be updated. Reply by xrj
Member Avatar
xrj 139 Replied To a Post in User Login Codes using VB and Access..
Topic by tomexlfc in Software Development
Of course I suppose the student data has been entered correctly, but I can't see the need for entering a third field: status. If you want to assure the password you may constrain passwords to those containing both capital and lower letters and special characters like !,$,%, and so on. … Reply by xrj
Member Avatar
Hello,

I wrote some codes for student login. the codes checks for the "username", "password" as well as their type of "status", from the database. once this input are met, the student logs in successful, otherwise a message pops up.

The problem i encountered is this, i have 11 student … Topic by tomexlfc in Software Development
Member Avatar
Featured xrj 139 Replied To a Post in Is it possible to get the source path
Topic by Mr.M in Software Development
More specifically you need a [File System MiniFilter](https://docs.microsoft.com/es-es/windows-hardware/drivers/ifs/file-system-minifilter-drivers) which is far less complicated -although still complicated. It has a function or routine [FltGetFileNameInformation](https://msdn.microsoft.com/en-us/library/windows/hardware/ff543032(v=vs.85).aspx) (also [FltGetFileNameInformationUnsafe](https://msdn.microsoft.com/en-us/library/windows/hardware/ff543035(v=vs.85).aspx) to retrieve the file name. Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
The code had severall errors. Maybe this other way you can make it work:

Dim sql = "select Count(*) from pur_invdet where purinvid=@purinvid"
Dim cmd = New OleDb.OleDbCommand(sql, cn)
cmd.Parameters.AddWithValue("@purinvid", TextBox1.Text)
Dim result As Integer = Convert.ToInt32(cmd.ExecuteScalar())
cmd.Parameters.Clear()

Try
If result > 0 Then

For Each x As ListViewItem In … Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
You are setting just one parameter in the Update statement while adding later 3 parameters. Can't you include the execute `cmd.executeNonQuery`s inside a try - catch to see if there is any error message? Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
Change lines #21 and 22 into the following to see how many registers are really updated:

dim n as int32 = cmd.ExecuteNonQuery() 'n=The number of rows affected'
MsgBox("Updated "+n.tostring+" rows")

Change lines #30 and 31 into the following and see how many registers are really saved:

dim n as int32= … Reply by xrj
Member Avatar
I use the this code. showing "Update" msg but not update and if i add an item then show "Update" not "save"
Please help me.....


Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
Dim sql = "select Count(*) from pur_invdet where purinvid= txtpurinvid.text"
Dim cmd = … Topic by Jayanta_1 in Software Development
Member Avatar
xrj 139 Replied To a Post in Cant print using PrinttoPrinter command
Topic by Programmer_2 in Software Development
Searching seems as there is an issue in CrystalReports. Can't you divide, as a workaround, the report in two or three so each one has less than 2^15=32768 pages? Reply by xrj
Member Avatar
Cant print crystal report viewers records after 32767 page ... im using crystalreportviewer.printtoprinter command Topic by Programmer_2 in Software Development
Member Avatar
Topic by Jayanta_1 in Software Development
Thanks to you again for your confidence. Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
Well, both tables must be read. You may code something like:

Public Sub Displayitem()

Dim cmd As New OleDb.OleDbCommand("SELECT * FROM pur_inv,inv_type WHERE pur_inv.invtypid=inv_type.invtypid ORDER BY purinvdt", cn)
Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader()

ListView1.Items.Clear()
Do While dr.Read()
Dim new_item As New _
ListViewItem(dr.Item("purinvdt").ToString)
new_item.SubItems.Add(dr.Item("purinvid").ToString)
new_item.SubItems.Add(dr.Item("prtid").ToString)

new_item.SubItems.Add(dr.Item("pur_inv.invtypid").ToString)
new_item.SubItems.Add(dr.Item("taxamt").ToString)
new_item.SubItems.Add(dr.Item("tottaxblamt").ToString)
new_item.SubItems.Add(dr.Item("invamt").ToString) … Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
Then change invtypid by invtyp:

Public Sub Displayitem()
ListView1.Items.Clear()
Dim cmd As New OleDb.OleDbCommand("SELECT * FROM pur_inv ORDER BY purinvdt", cn)
Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader()

Do While dr.Read()
Dim new_item As New _
ListViewItem(dr.Item("purinvdt").ToString)
new_item.SubItems.Add(dr.Item("purinvid").ToString)
new_item.SubItems.Add(dr.Item("prtid").ToString)

new_item.SubItems.Add(dr.Item("invtyp").ToString)
new_item.SubItems.Add(dr.Item("taxamt").ToString)
new_item.SubItems.Add(dr.Item("tottaxblamt").ToString)
new_item.SubItems.Add(dr.Item("invamt").ToString)
ListView1.Items.Add(new_item)
Loop
End Sub Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
Of course, if not present, you should add a reference to `System.Linq`. Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
If you mean to select a concrete id, you could do the following. When `invtypid` is -1, all the ids will be shown (on load event); when > -1 that only id will be shown (when button is clicked):

Public Sub Displayitem(Optional invtypid As Int32 = -1)

Dim da As … Reply by xrj
Member Avatar
Topic by Jayanta_1 in Software Development
I can't see anything wrong with the code you are sharing. So, what's the problem? Can you explain a bit further? Reply by xrj
Member Avatar
Hello
Teachers
I create a project in vb.net 2010 with access database. I want to show data in listview. It Is show in listview but a problem I entry **Id wise**. So, when I click on the show data button I see the **Id** . How to show the id … Topic by Jayanta_1 in Software Development
Member Avatar
Featured xrj 139 Replied To a Post in Is it possible to get the source path
Topic by Mr.M in Software Development
Just a file system filter driver [Here](https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/file-system-filter-drivers) would do the job. Reply by xrj
Member Avatar
Featured xrj 139 Began Watching Is it possible to get the source path
Hi DW.

I would like to know if its possible to get the source path of a file copied/moved to a folder I set a FileSystemWatcher? What I mean is that get the location as to where this file is coming from if its was copied/moved into this folder.

Thank … Topic by Mr.M in Software Development
Member Avatar
xrj 139 Replied To a Post in VB.NET - TCP IMAGE TRANSFER
Topic by Luke_7 in Software Development
You may send the image as plain text [Click Here](https://social.msdn.microsoft.com/Forums/vstudio/en-US/b0da124b-976b-4502-b38d-e33ad845be6b/how-to-save-images-to-text-file-as-charactersbinary-or-whatever-and-retrieve-them-back-to-picture?forum=vbgeneral) Reply by xrj
Member Avatar
xrj 139 Began Watching VB.NET - TCP IMAGE TRANSFER
hi im having some trouble transfering images over tcp. i currently have a function set up to transfer text but would like to know how i would do this for images.
thanks in advance. Topic by Luke_7 in Software Development