datatable

making chart from datagridview

懵懂的女人 提交于 2020-02-07 07:15:28
问题 I have a datagridview which user fill it. the result is calculated and return to read only columns of datagridview. I want to make a chart for two columns of my datagridview. but I don't save datagridview in a table because there is previous results in the table! somebody told me for creating chart you should save your datagridview to a table but in this case you should convert datagridview to datatable and then clear it! please tell me what should I do! :( this is my code for creating chart

making chart from datagridview

天大地大妈咪最大 提交于 2020-02-07 07:15:21
问题 I have a datagridview which user fill it. the result is calculated and return to read only columns of datagridview. I want to make a chart for two columns of my datagridview. but I don't save datagridview in a table because there is previous results in the table! somebody told me for creating chart you should save your datagridview to a table but in this case you should convert datagridview to datatable and then clear it! please tell me what should I do! :( this is my code for creating chart

h:dataTable header facet does not display value from row

有些话、适合烂在心里 提交于 2020-02-07 05:22:25
问题 I'm trying to understand why the second column facet, with #{entry.value} doesn't display anything, just an empty header? <h:dataTable value="#{bean.entries}" var="entry"> <h:column> <f:facet name="header"> <h:outputText value="UserId" /> </f:facet> <h:outputText value="#{entry.key}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="#{entry.value}" /> </f:facet> <h:outputText value="#{entry.value}" /> </h:column> I've understand that maybe I'm doing it wrong, because

Bulk Insert DataSet with multiple related tables into SQL Server C#

穿精又带淫゛_ 提交于 2020-02-06 07:40:08
问题 I have a DataSet with multiple tables the source document is an XML file. mydataset.ReadXML(filename); There are multiple tables with multiple relations. I have the database in the SQL created via code - tables, columns and relations. Now I would like to insert the data . (Yes I want everything). EDIT: The SQL tables use Identity Columns autogenerate - because I am not sure the incoming data will never duplicate one of the parameters that I would like to assume is unique. So what methods

Bulk Insert DataSet with multiple related tables into SQL Server C#

不打扰是莪最后的温柔 提交于 2020-02-06 07:39:10
问题 I have a DataSet with multiple tables the source document is an XML file. mydataset.ReadXML(filename); There are multiple tables with multiple relations. I have the database in the SQL created via code - tables, columns and relations. Now I would like to insert the data . (Yes I want everything). EDIT: The SQL tables use Identity Columns autogenerate - because I am not sure the incoming data will never duplicate one of the parameters that I would like to assume is unique. So what methods

Export data from SQL Server to Text file in C# (Saving to a specific folder)

空扰寡人 提交于 2020-02-06 05:07:11
问题 The data will be first fetched into a DataTable and then the DataTable will be exported to a Text file which can be viewed in Notepad. But, i dont know how to make the code work for save the work to a specific folder P.S.I want to give to the file a dynamic name too (YEARmonthDAYhour.txt) this is my code so far: protected void ExportTextFile(object sender, EventArgs e) { string constr = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString; using (SqlConnection con =

Retrieve distinct values from datatable using linq vb.net

蓝咒 提交于 2020-02-05 19:00:36
问题 I am trying to retrieve all of the distinct values from a particular column in a datatable. The column name in the datatable is "Count". I have 2240 rows and I have 6 distinct values in the "Count" column. The problem is, when I execute the following code, it is giving me the number of rows rather than the 6 distinct values. Dim counts = (From row In loadedData Select row.Item("Count")).Distinct() For Each i In counts MsgBox(i) Next How can I modify this to retrieve the 6 distinct values,

Retrieve distinct values from datatable using linq vb.net

邮差的信 提交于 2020-02-05 18:55:12
问题 I am trying to retrieve all of the distinct values from a particular column in a datatable. The column name in the datatable is "Count". I have 2240 rows and I have 6 distinct values in the "Count" column. The problem is, when I execute the following code, it is giving me the number of rows rather than the 6 distinct values. Dim counts = (From row In loadedData Select row.Item("Count")).Distinct() For Each i In counts MsgBox(i) Next How can I modify this to retrieve the 6 distinct values,

Checkbox click event not working in datatable row when buttons: [ 'colvis' ] activeted

本小妞迷上赌 提交于 2020-02-05 04:11:05
问题 I have 1 question here: How to get a Checkbox Value in JavaScript. With the help it worked very well. However, when I added buttons: ['colvis'] to DataTable, the click checkbox events did not seem to work correctly. I have looked for help on the DataTable forum, but to no avail. Code: <input id="listvalue" name="selectedCB"> <table id="datatest" class="table table-striped table-bordered nowrap" style="width:100%"> <thead> <tr> <th class="no-sort checkboxor"> <input type="checkbox" onclick=

Datatable的Select()方法简介

£可爱£侵袭症+ 提交于 2020-02-04 05:45:36
DataTable是我们在进行开发时经常用到的一个类,并且经常需要对DataTable中的数据进行筛选等操作,下面就介绍一下Datatable中经常用到的一个方法——Select,微软提供了四个函数的重载,分别是 Select() Select(string filterExpression) Select(string filterExpression, string sort) Select(string filterExpression,string sort, DataViewRowState record States)。 1) Select()——获取所有 System.Data.DataRow 对象的数组。 2) Select(string filterExpression)——按照主键顺序(如果没有主键,则按照添加顺序)获取与筛选条件相匹配的所有 System.Data.DataRow 对象的数组。 3) Select(string filterExpression, string sort)——获取按照指定的排序顺序且与筛选条件相匹配的所有 System.Data.DataRow 对象的数组。 4) Select(string filterExpression, string sort, DataViewRowState recordStates)—