Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

searcing table in  Visul Studio

Posted on 2011-09-14
3
Medium Priority
?
296 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

609 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