Click here to Skip to main content
15,896,557 members

Comments by Member 12694392 (Top 16 by date)

Member 12694392 16-Jan-23 10:56am View    
This is duplicating time column, which is not not required.
Member 12694392 16-Jan-23 10:52am View    
I have created function in PostgreSQL which returns me data as below, function is called in loop w.r.t.number of columns i.e Value from user input.

string cmd = @"select time_stamp,value from data(arguments)
var oda = new NpgsqlDataAdapter(cmd, DBConnection.Pconn);
oda.Fill(datatable);
datatable.Columns["value"].ColumnName = StringUniqueColumnNamefilledatRunTime;

The Above result is as below
Time 	Col1	Col2
10:00	1	
11:00	2	
10:00		3
11:00		4


required output is

Time Col1 Col2
10:00 1 3
11:00 2 4
Member 12694392 16-Jan-23 10:46am View    
I am using single DataTable only, the challenge is only with data not merged. hence timestamp get duplicated everytime
Member 12694392 16-Jan-23 10:19am View    
No, will be passing it to RDLC report.
Member 12694392 21-Oct-22 5:38am View    
Thanks for the response, had already checked and also build logic accordingly but did not help. Referral code below

int max_row = Convert.ToInt32(FinalDT.Rows.Count);


foreach (DataRow row in FinalDT.Rows)
{
string tagName = Convert.ToString(row["tag_name"]);
string[] parts = tagName.Split('.');
TreeNodeCollection nodes = TV_TagList.Nodes;
for (int i = 0; i < parts.Length; i++)
{
string valuePath = string.Join(".", parts, 0, i);
TreeNode node = TV_TagList.FindNode(valuePath);
if (node == null)
{
node = new TreeNode(parts[i]);
nodes.Add(node);
}

nodes = node.ChildNodes;
}
}

I not getting unique data in mention logic above. stuck at this place.