473,657 Members | 2,585 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataView Columns

Hi NG,

how to make a DataView show only selected COLUMNS?

E.g:
DataTable table // is already in memory and has two columns: "id" and
"value"
DataView view // should only show all rows from "value"
TIA,
KN

x-post & f'up to .adonet
Nov 17 '05 #1
2 1610
Hi Karl,

Please try this:
MyDataView.Tabl e.Columns.Remov e("ColumnName ")

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: "Karl Napp" <ka**********@g mxSPAM.li>
Subject: DataView Columns
Date: Fri, 31 Oct 2003 18:40:33 +0100
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <Oh************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.adonet,micr osoft.public.do tnet.framework. a
spnet NNTP-Posting-Host: pd95301f9.dip.t-dialin.net 217.83.1.249
Path: cpmsftngxa06.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
..phx.gbl!TK2MS FTNGP09.phx.gbl Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1878 37
microsoft.publi c.dotnet.framew ork.adonet:6501 2 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi NG,

how to make a DataView show only selected COLUMNS?

E.g:
DataTable table // is already in memory and has two columns: "id" and
"value"
DataView view // should only show all rows from "value"
TIA,
KN

x-post & f'up to .adonet


Nov 17 '05 #2
Thank you Mike,
how to make a DataView show only selected COLUMNS?
Please try this:
MyDataView.Tabl e.Columns.Remov e("ColumnName ")


but this really removes the column from the underlying table!
KN
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1180
by: Phil Townsend | last post by:
I have a dataview that is generated from a dataset which gets its data from an xml file. I would like to use the dataview to include only certain columns in the result set. The xml file contains 7 seven columns and I need my dataview to contain only five of them. Is the dataview the right control to do this? Thanks... *** Sent via Developersdex http://www.developersdex.com ***
8
3889
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter = "'Record ID' = '0'"; theView.RowStateFilter = DataViewRowState.ModifiedCurrent; Debug.WriteLine(string.Format("RowFilter = {0}", theView.RowFilter)); RecordDataGrid.DataSource = theView; RecordDataGrid.DataBind();
5
8824
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it happen. Dim objKeys(2) as Object objKeys(0) = "CL" objKeys(2) = 4000 Dim posView As DataView = New DataView(posDS.Tables("Positions"), _
8
4776
by: KC | last post by:
For a DataView.Rowfilter can I use more than one expression? I want to filter out two different things. For example can I take: dv.RowFilter = "MTX <> 'Customer Forcast'" and dv.RowFilter = "MTX <> 'Actual vs. Forcast'"
3
1770
by: Catullus | last post by:
Hi everyone, I'm a n00b on VB.net programming and now I stumbled upon a problem I can't solve, even after browsing the net for hours.. I have a dataview witg 4 columns; 2 string columns and 2 integer columns I want to use the RowFilter to get the 'records' where one of the integer columns holds a certain integer and use that dataview as datasource for my listbox This gives all sorts of error...
0
1835
by: Nathan Franklin | last post by:
Hello Guys, I have been trying to work this our for so long, but I just can't seem to find the answer. I am loading a datatable from a an access database using an oledbdataadapter. I then assign the datatable.dataview to my datagrid.datasource member so it will display my results.. I need to give the user an option to change the order of this data, I have a
7
5615
by: Rich | last post by:
Hello, I am pulling master data from one master table and detail data from two detail tables. The rows from the master data are displayed in textboxes on my form which are bound to the data with databinding. The data from the 2 detail tables are displayed in 2 datagridviews. I filter each datagridview with a Dataview object using the dataview.Rowfilter property. This is sort of working except that I am getting an except on one of my...
1
1463
by: Richard Jonker | last post by:
Hi, I'm developing a webpage with a dataview. The data is retrieved from a database view. The columns in the dataview are created dynamically via a dataset. How can I add special columns like buttons and hyperlinks dynamically to the columns? When using MS Studio Developer you can add these columns via the property builder. In that case the first colums contains the buttons, I want them in the last columns.
2
2454
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I need to locate a row (or see if it exists) in a table contained in a dataset. The DataView.Find method seems to work OK for one criteria but I need to use 2 criterias. Is there anything in VB2005 that does was DLookUpd does in Access - but for a table contained in a Dataset? I realize that DLookUp works on Physical tables (not in-memory dataset tables), and I could use a sqlDataReader to find my row from the physical...
0
1655
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as XML source. Now to display data i hv use dataset to fetch data.so i m displaying data in datagrid/dataview. Now here comes a problem: Using Datagrid :
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.