?
Solved

searcing table in  Visul Studio

Posted on 2011-09-14
3
Medium Priority
?
294 Views
Last Modified: 2013-11-27
Hi Experts
 I used the following code to get data from sql database
    DA.Fill(DS, "Codes")
        Grid1.DataSource = DS.Tables("Codes")
       when displaying the data in the grid it has so many records with the same CallID.
e.g   callId   Desc
       p001     pads
       p001     pads new
       p001     pads old
       p002   shoes
       p002  shoes l
what I like to see is only 1 line per callID and Desc can be any
e.g  p001     pads
       p002     shoes l
please help
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Crashman
ID: 36537991
dim dtv as new dataview
Dim dtc As New DataTable

dtv = ds.DefaultView
dtv.Sort = "callId ASC"
dtc = dtv.ToTable("Table", True, "callID")

look
http://msdn.microsoft.com/en-us/library/h2b6ehaa.aspx
0
 

Author Comment

by:b001
ID: 36538205
Hi Crashman
It is giveing me an error
'DefaultView' is not a member of 'system.data.dataset'

on line   dtv = DS.DefaultView
Thanks
0
 
LVL 8

Accepted Solution

by:
Crashman earned 2000 total points
ID: 36538340
oh, thats right you must use
ds.table(0).defaultview
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question