Click here to Skip to main content
15,896,520 members
Everything / Dataview

Dataview

Dataview

Great Reads

by yuvalsol
Print DataTable, DataView, DataSet, DataRow[] to Console, StringBuilder or Stream

Latest Articles

by yuvalsol
Print DataTable, DataView, DataSet, DataRow[] to Console, StringBuilder or Stream

All Articles

Sort by Score

Dataview 

10 Nov 2014 by DamithSL
try with LINQdt_Barcode = dt_Barcode.AsEnumerable() .GroupBy(r => new { Itemid = r.Field("Itemid"), PacktypeId = r.Field("PacktypeId")}) .Select(g => g.First()) .CopyToDataTable();Sample Test Code:void Main(){ DataTable dt_Barcode...
10 Nov 2014 by Rajesh Buddaraju
Example code for your problem.List arritems = new List(); items item = new items(); items item1 = new items(); items item2 = new items(); items item3 = new items(); items item4 = new items(); item.barcode = 1; ...
10 Jun 2019 by Chilly YahYah
When attempting to work with a dataview, its easy to filter on something = something. But what I want to do is filter on something contains this_string. I have a data table with about 5000 items in it. Where in PowerShell I can filter using something like the following: ...
10 Jun 2019 by Gerry Schmitz
"Probably" the whole table is getting downloaded due to the ".Contains" extension. You need a stored proc or pass-thru SQL so the query "runs on the server" Quote: Now, I mentioned earlier about the Invoke-SQLCMD cmdlet. This is by far the easiest way to get data in and out of SQL Server in...
7 Jan 2020 by OriginalGriff
It works for me: string strConnect = SMDBSupport.SMInstanceStorage.GetInstanceConnectionString("VideoMaster"); using (SqlConnection con = new SqlConnection(strConnect)) { try { con.Open(); ...
4 Aug 2020 by pradeepbliss
I have data table which contains many duplicate rows i need to filter those rows from data table based upon multiple columns to get distinct rows in resultant data table....Barcode Itemid PacktypeId1 100 11 100 21 100 31 100 11 ...
17 Nov 2014 by ehabaziz2001
I got an error with the below statements :Can not fine column [name]DataView DV = new DataView(dbdataset);MessageBox.Show(textBox1.Text);DV.RowFilter = string.Format("name LIKE '%{0}%'", textBox1.Text);this.dataGridView1.DataSource = DV;
17 Nov 2014 by Kornfeld Eliyahu Peter
You build a filter where you compare name column to the content of textBox1.Text. Obviously there is no such column name!!!Check you DataView at runtime and correct the problem...
18 Feb 2015 by Member 10918596
Filter expression '1' does not evaluate to a Boolean term. how to solve this error .when i click button only this error camepublic DataSet Fill_Dataset() { DataSet ds = new DataSet(); con = new SqlConnection(str); con.Open(); cmd = new...
18 Feb 2015 by Wendelius
Most like the error is on row dv.RowFilter=dr["country_id"].ToString();If country_id column contains a value of 1 then the filter would be just "1".For the filter you need to have a proper boolean evaluation so that the dataview can decide if the row is to be included or not. For...
18 Feb 2015 by Member 10918596
DataSet ds = new DataSet(); DataSet dstemp = new DataSet(); con = new SqlConnection(str); con.Open(); cmd = new SqlCommand("sp_new", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); ...
9 Dec 2015 by bjay tiamsic
Hi. I have a DataSet which I convert to DataView in order to do filtering, distinct and sorting, however lowercase and uppercase (though same value) is not being distinct.Here is sample value that does not make DISTINCTAdjustmentCode | AdjustmentFLEXI-HOUSING | flexi-...
9 Dec 2015 by Anjali0904
Set the CaseSensitive property of DataTable to TruedT.CaseSensitive=true;
25 Dec 2016 by Tobias Wälde
Hey there,I have a dataview which is filled by an object using string lists. I want pick the suitable entries by typing search words in a textbox.my object:class my_object{ List column1 = new List(); List column2 = new List(); List...
25 Dec 2016 by P_Z
Hi, I think result List should contain matches from each column?If you're using C#, probably should have no problems using Linq//Source in this case refers to each column//SearchWords list of strings to searchpublic List SearchList(List Source, List...
10 Jun 2019 by Chilly YahYah
I actually do not have permissions to an SQL server, so I am unsure if that is even possible for me to run "Invoke-SQLCMD". What I am doing is querying a SharePoint site using invoke-restmethod in PowerShell, as I only have Full control permissions on a site that I manage. I was successful in...
7 Jan 2020 by Paramu1973
Hi, I have head hunting problem with the below codes...Really it tooks my holeday, but still not clear... Any superiors can help me to clear? Thanks My Codes MyDtb1 = MyOriginalDtb; DataView MyDtbView = MyDtb1.DefaultView; MyDtbView.Sort = "prn_no,sheet_no,prn_date,pty_name";...
2 Aug 2021 by GovindSankar
Hi I created a sql server database and is using a dataset in visual studio to connect to the sql server database and I am using wpf application with a datagrid. Now in one section i need to use dataview.rowfilter. But i need to use multiple...
2 Aug 2021 by PIEBALDconsult
This is where you might find what you seek: DataColumn.Expression Property (System.Data) | Microsoft Docs[^]
9 Nov 2017 by yuvalsol
Print DataTable, DataView, DataSet, DataRow[] to Console, StringBuilder or Stream
10 Nov 2014 by Manas Bhardwaj
This has been discussed so many times on other forums and CodeProject itself.Look at the links...
4 Aug 2020 by subho100
public void RemoveDuplicatesFromDataTable(ref DataTable table, List keyColumns) { Dictionary uniquenessDict = new Dictionary(table.Rows.Count); StringBuilder stringBuilder =...