Click here to Skip to main content
15,909,518 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: adding a panel to a form. Pin
Luc Pattyn25-Sep-10 6:08
sitebuilderLuc Pattyn25-Sep-10 6:08 
GeneralRe: adding a panel to a form. [modified] Pin
bimbambumbum25-Sep-10 11:20
bimbambumbum25-Sep-10 11:20 
GeneralRe: adding a panel to a form. Pin
Luc Pattyn25-Sep-10 12:02
sitebuilderLuc Pattyn25-Sep-10 12:02 
QuestionsqlDataAdapter doest not refresh the query Pin
akosidandan22-Sep-10 5:20
akosidandan22-Sep-10 5:20 
AnswerRe: sqlDataAdapter doest not refresh the query Pin
Not Active22-Sep-10 7:42
mentorNot Active22-Sep-10 7:42 
GeneralRe: sqlDataAdapter doest not refresh the query Pin
akosidandan22-Sep-10 22:40
akosidandan22-Sep-10 22:40 
GeneralRe: sqlDataAdapter doest not refresh the query Pin
Not Active23-Sep-10 1:08
mentorNot Active23-Sep-10 1:08 
QuestionHow to Show Specific Records in listview Pin
akosidandan22-Sep-10 1:38
akosidandan22-Sep-10 1:38 
Hello experts,

I would like to ask if how can I show some specific records only in my listview coming from my database
table.My Database is Sql Server 2005 and I am using vb 2008 as the programming language.

Scenerio:

BorrowTable
ID | Last Name |
1 | mrDan
1 | mrDan
2 | mrsDan
2 | mrsDan

I have a table in my database with name BorrowTable as shown above for example, my problem is I would
like to show the transaction records of people in table.To be more precise bec I cant so much
explain my problem I want to display it like this way in my listview

ID | Last Name |
1 | mrDan
2 | mrsDan

Below here is the code, its working but it just show all the records I have tried "group by" as select query to my sqlDataAdapter but it's not working.

Public Sub LoadListViewReturn(ByVal lvReturnList As ListView, ByVal con As SqlConnection)
      Try
          If con.State = ConnectionState.Open Then
              con.Close()
          End If

          Dim dt As New DataTable
          Dim ds As New DataSet
          ds.Tables.Add(dt)
          Dim da As New SqlDataAdapter

          con.Open()
          da = New SqlDataAdapter("Select * from BorrowTransactionTable ", con)
          da.Fill(dt)

          For Each r As DataRow In dt.Rows
              lvReturnList.Items.Add(r("txtTransactionID"))
              lvReturnList.Items(lvReturnList.Items.Count - 1).SubItems.Add(r("txtLastName"))
              lvReturnList.Items(lvReturnList.Items.Count - 1).SubItems.Add(r("txtFirstName"))
              lvReturnList.Items(lvReturnList.Items.Count - 1).SubItems.Add(r("txtMI"))
              lvReturnList.Items(lvReturnList.Items.Count - 1).SubItems.Add(r("txtPosition"))

          Next



          con.Close()

      Catch ex As Exception
          MsgBox(ex.ToString)
          con.Close()
      End Try
  End Sub


Any comments and suggestions are so much appreciated. Smile | :)

Thanks,
Dan
AnswerRe: How to Show Specific Records in listview Pin
Luc Pattyn22-Sep-10 2:23
sitebuilderLuc Pattyn22-Sep-10 2:23 
GeneralRe: How to Show Specific Records in listview Pin
akosidandan22-Sep-10 2:29
akosidandan22-Sep-10 2:29 
GeneralRe: How to Show Specific Records in listview Pin
Luc Pattyn22-Sep-10 2:47
sitebuilderLuc Pattyn22-Sep-10 2:47 
QuestionFile recovery Pin
hammerstein0522-Sep-10 0:57
hammerstein0522-Sep-10 0:57 
AnswerRe: File recovery Pin
Pete O'Hanlon22-Sep-10 1:37
mvePete O'Hanlon22-Sep-10 1:37 
GeneralMessage Removed Pin
22-Sep-10 4:23
molesworth22-Sep-10 4:23 
GeneralRe: File recovery Pin
Pete O'Hanlon22-Sep-10 4:35
mvePete O'Hanlon22-Sep-10 4:35 
GeneralRe: File recovery [modified] Pin
molesworth22-Sep-10 4:38
molesworth22-Sep-10 4:38 
AnswerRe: File recovery Pin
molesworth22-Sep-10 4:48
molesworth22-Sep-10 4:48 
GeneralRe: File recovery Pin
hammerstein0522-Sep-10 5:39
hammerstein0522-Sep-10 5:39 
Question.NET code protection Pin
cherrymotion21-Sep-10 23:09
cherrymotion21-Sep-10 23:09 
AnswerRe: .NET code protection Pin
Kubajzz22-Sep-10 3:44
Kubajzz22-Sep-10 3:44 
GeneralRe: .NET code protection Pin
harold aptroot22-Sep-10 4:41
harold aptroot22-Sep-10 4:41 
GeneralRe: .NET code protection Pin
Luc Pattyn22-Sep-10 5:17
sitebuilderLuc Pattyn22-Sep-10 5:17 
AnswerRe: .NET code protection Pin
Eddy Vluggen22-Sep-10 9:37
professionalEddy Vluggen22-Sep-10 9:37 
QuestionIf I had run CasPol.exe under .NET 1.1, do I need to run it again for an application that is .NET 2.0 ? Pin
David Mujica21-Sep-10 9:08
David Mujica21-Sep-10 9:08 
AnswerThe Answer is YES Pin
David Mujica29-Sep-10 15:10
David Mujica29-Sep-10 15:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.