15,922,015 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by acing wei (Top 110 by date)
acing wei
28-Jan-14 23:13pm
View
Thanks Jocodes for your help in this few weeks, I did it.. I use take() and skip() to read from my datatable and bind it to chart.
Have a nice day :)
acing wei
28-Jan-14 19:43pm
View
X is string output ,contains timing like : 0730,0830,0930,1030
which is read from the first row of my datatable.
acing wei
28-Jan-14 5:06am
View
Jocodes, can help me see and give me some suggestion in the bottom code. i got idea splitting my y into 2 chart. but i don know how my x value split..?
acing wei
28-Jan-14 5:05am
View
string[] x = new string[dtoutput.Rows.Count];
int[] y1 = new int [dtoutput.Rows.Count];
int[] y2 = new int[dtoutput.Rows.Count];
int[] y3 = new int[dtoutput.Rows.Count];
for (int i = 0; i < dtoutput.Rows.Count; i++)
{
if (i == 0)
{
//fetching the row values and assigning to stringarray
x = Array.ConvertAll(dtoutput.Rows[i].ItemArray, item => item.ToString()).ToArray();
}
else if (i == 1)
{
y1 = Array.ConvertAll(dtoutput.Rows[i].ItemArray, item => Convert.ToInt32(item)).ToArray();
}
else if (i == 2)
{
y2 = Array.ConvertAll(dtoutput.Rows[i].ItemArray, item => Convert.ToInt32(item)).ToArray(); ;
}
else if (i == 3)
{
y3 = Array.ConvertAll(dtoutput.Rows[i].ItemArray, item => Convert.ToInt32(item)).ToArray(); ;
}
Chart1.Series[0].Points.DataBindXY(x, y1);
Chart1.Series[1].Points.DataBindY(y2);
Chart1.Series[2].Points.DataBindY(y3);
i got an idea when button pressed go to another chart.
if i want to put my y3 in different chart how can i split my x value into 2 chart.
acing wei
28-Jan-14 4:39am
View
alright,Thanks and have a nice day...
acing wei
28-Jan-14 2:56am
View
I can't find any sample in google. do you have any sample to share?
acing wei
28-Jan-14 1:58am
View
JOCodes, i need your suggestion.. for my charting that i read from array previously. is it possible to do a paging charting like there is a next chart and previous chart button. is it possible? can suggest me?
acing wei
16-Jan-14 22:48pm
View
Hi have you check for me?
acing wei
16-Jan-14 18:43pm
View
But there is a problem here everytime when the page is being refresh , the previous row values in temptable will disappear, what should I do to retain the old row values in temptable ?
acing wei
15-Jan-14 9:26am
View
if you are not busy later..please help me see mine, thanks :)
acing wei
15-Jan-14 3:05am
View
Thank you :)
acing wei
15-Jan-14 1:09am
View
I'm still trying but it doesn't work..it will skip what is in the for loop...
acing wei
14-Jan-14 20:13pm
View
i want to achieve a new row of newrowpasscount everytime it loops..because a newrowpasscount will giving me different value everytime it loops..i need new row to put my newrowpasscount ..
acing wei
14-Jan-14 20:09pm
View
I sent
acing wei
14-Jan-14 7:28am
View
DataTable dtoutput = new DataTable();
var columnNames = lstData.Select(k => k.FileName).Distinct();
foreach (string columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof(string));
for (int i = dtoutput.Rows.Count - 1; i >= 0; i--)
{
DataRow newrowPassCount = dtoutput.NewRow();
foreach (string columnName in columnNames) {
int count = lstData.Where(k=> k.FileName == columnName).Count(k => k.status == "Pass");
newrowPassCount[columnName] = count;
}
dtoutput.NewRow();
dtoutput.Rows.Add(newrowPassCount);
}
the whole table disappear...it will escape my
foreach (string columnName in columnNames) {
it will not go inside here..hence the table disappear
acing wei
14-Jan-14 6:53am
View
sorry but I can't because is a school project..and im not allowed to do installation in the machine..can just help me here?
acing wei
14-Jan-14 6:51am
View
for (int i = dtoutput.Rows.Count - 1; i >= 0; i--)
{
dtoutput.NewRow();
dtoutput.Rows.Add(newrowPassCount);
}
so what you mean is i can just simply us this code above to try?
acing wei
14-Jan-14 6:33am
View
No , I really need your help to guide me...because my teacher not good in c#.net
acing wei
14-Jan-14 6:30am
View
Do I even need a new data table to bind a new datarow from newrowpasscount, .I actually have a select command on top, select from dropdownlist.. and everytime selected change it will refresh the page before datatable bind... I don't know if I still can use for loop...
acing wei
14-Jan-14 6:18am
View
This is what I tried just now.. it will get the new rowpasscount value but second row and third row will follow the value of first row... What I want is not a same value as first row..I need the newrowpasscount to save once create row, save twice Crete row..
dtoutput.Rows.Add(newrowPassCount);
int j = 1;
var tempRow = dtoutput.Rows[j];
for (int i = 1; i <dtoutput.Rows.Count; i++)
{
tempdatatable.NewRow();
if (i == 1)
{
dtoutput.Rows.Add(tempRow[0], tempRow[1]);
}
if (i == 2)
{
dtoutput.Rows.Add(tempRow[0], tempRow[1]);
}
}
acing wei
14-Jan-14 5:57am
View
Can you help me with the code.. just now the code that you asked me try what should I put in the loop.I have tried but cannot work... I'm just a student , still learning, I really appreciate all your help.....
acing wei
14-Jan-14 4:18am
View
I need to save my newrowpasscount when the first loop is done bind in a row of table, then in a second loop save the newrowpasscount again and bine to the following row...
acing wei
14-Jan-14 4:15am
View
It can't work the way i want..
dtoutput.Rows.Add(newrowPassCount);
int j = 1;
var tempRow = dtoutput.Rows[j];
for (int i = 1; i < dtoutput.Rows.Count; i++)
{
tempdatatable.NewRow();
if (i == 1)
{
dtoutput.Rows.Add(tempRow[0], tempRow[1]);
}
if (i == 2)
{
dtoutput.Rows.Add(tempRow[0], tempRow[1]);
}
}
this code giving me a second row and third row same row value as my newrowPassCount ..but i got problems is for second and third time loop the newrowpasscount value should't be the same as first row..because the idea is the newrowpasscount keep changing..
acing wei
14-Jan-14 4:09am
View
It cannot work the way i want, i still stick with this
foreach (DataRow row in dtoutput.Rows)
{
dtoutput.NewRow();
dtoutput.Rows.Add(newrowPassCount);
}
but I keep receive error gives me this error"Collection was modified; enumeration operation might not execute". the idea is something like this create row put in the newrowpasscount, create another row put in another newrowpasscount..
acing wei
14-Jan-14 3:07am
View
i also try to use for loop like this
for (int i = 1; i < dtoutput.Rows.Count; i++)
{
var tempRow = dtoutput.Rows[i];
if (i == 1)
{
dtoutput.NewRow();
dtoutput.Rows.Add(tempRow);
}
}
but doesn't seems work...
acing wei
14-Jan-14 1:58am
View
ehm beside that i also try this to create a new datatable..
for (int i = 1; i < dtoutput.Rows.Count; i++)
{
var tempRow = dtoutput.Rows[i];
var temp = dtoutput.Rows[i][0];
for (int j = 1; j < dtoutput.Rows.Count; j++)
{
DataRow rows = dtoutput.Rows[j];
if (temp == rows[0].ToString())
{
dtoutput.NewRow();
dtoutput.Rows.Add(tempRow[0], tempRow[1]);
}
}
}
but it endless looping ...i use for loop to keep my first loop first value in var then create a table for that row.. but i still stuck
acing wei
14-Jan-14 1:21am
View
i think should be my foreach loop problem.. what should I use i want this (newrowpasscount) "row Value" first looping store in first new row , second looping store in another row.. any other way?
acing wei
14-Jan-14 1:13am
View
foreach (DataRow row in dtoutput.Rows)
{
DataRow newrowPassCount = dtoutput.NewRow();
dtoutput.Rows.Add(newrowPassCount);
}
it doesnt work.. the newrowpasscount in redline cannot be declared in the scope..
acing wei
14-Jan-14 1:10am
View
gives me this error"Collection was modified; enumeration operation might not execute".
foreach (DataRow row in dtoutput.Rows)
{
dtoutput.NewRow();
dtoutput.Rows.Add(newrowPassCount);
}
it doesn't work..
acing wei
13-Jan-14 22:51pm
View
Thank you so much JoCodes..it works...THANK You..
acing wei
13-Jan-14 22:11pm
View
yes is fine creating a new row with (newrowpasscount) value..but now i need more row each time it loops it will give me (newrowpasscount) to show in another new row.. i use this but cannot work..
foreach (DataRow row in dtoutput.Rows)
{
dtoutput.Rows.Add(newrowPassCount);
}
acing wei
13-Jan-14 21:26pm
View
foreach (DataRow row in dt.Rows)
{
lstData.Add(new Tablelist() { FileName=csv, process = row["process"] + "", Event = row["Event"] + "", status = row["status"] + "" });
}
}
DataTable dtoutput = new DataTable();
var columnNames = lstData.Select(k => k.FileName).Distinct();
foreach (string columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof(string));
DataRow newrowPassCount = dtoutput.NewRow();
foreach (string columnName in columnNames) {
int count = lstData.Where(k=> k.FileName == columnName).Count(k => k.status == "Pass");
newrowPassCount[columnName] = count;
}
dtoutput.Rows.Add(newrowPassCount);
acing wei
13-Jan-14 8:53am
View
dt.Rows[i-1].ItemArray,item=>item.ToString());
it gives error.. i try use dt.Rows[i+1].ItemArray,item=>item.ToString());
it skip away first row.. what i want is to skip my last column.. can guide?
acing wei
13-Jan-14 8:09am
View
Deleted
sorry can i ask something ..
foreach (DataRow row in dt.Rows)
{
lstData.Add(new Tablelist() { FileName=csv, process = row["process"] + "", Event = row["Event"] + "", status = row["status"] + "" });
}
}
DataTable dtoutput = new DataTable();
var columnNames = lstData.Select(k => k.FileName).Distinct();
foreach (string columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof(string));
DataRow newrowPassCount = dtoutput.NewRow();
foreach (string columnName in columnNames) {
int count = lstData.Where(k=> k.FileName == columnName).Count(k => k.status == "Pass");
newrowPassCount[columnName] = count;
}
dtoutput.Rows.Add(newrowPassCount);
this current code will give a new row with the newrowpasscount value inside.. in the second looping the new value will be overwrite that row... is there any idea i can create another row when looping second , third time ....keep creating row.. so far i did this
foreach (DataRow row in dtoutput.Rows)
{
dtoutput.Rows.Add(newrowPassCount);
}
but it doesnt work... can you guide me?
acing wei
13-Jan-14 6:23am
View
The value of newrowpasscount and newrow failcount will be different value in every row that created..
acing wei
13-Jan-14 6:22am
View
The code is the solution above that you teach me... I want it to create a new row after every looping..the value of the newrowpasscount and newrowfailcount will be created in a new row ..keep adding new row..
acing wei
13-Jan-14 5:52am
View
I try couple of times using loop but I can't get the idea hw to do the looping ..
acing wei
13-Jan-14 4:11am
View
yes correct,for example i got another file , in a second looping can i create another row of pass and fail count, instead of just overwrite...now become 4 rows, then after third loop it become 6 rows..i try using
foreach (DataRow row in dtoutput.Rows)
but it can't work...please?
acing wei
13-Jan-14 3:23am
View
mr karthik thanks for your suggestion , i did it for my chart, i got another question..
dtoutput.Rows.Add(newrowPassCount);
this code that time you suggest me created a new row...i don't want the value inside the row to be overwrite everytime it loops,after second time of looping i want the value to appear in a new row, can you suggest me?
acing wei
13-Jan-14 2:00am
View
it goes to the catch exception when i use [i-1] in array..
acing wei
13-Jan-14 1:38am
View
i debug it will always count me my last column after this code
x = Array.ConvertAll( dt.Rows[i].ItemArray,item=>item.ToString());
acing wei
12-Jan-14 23:20pm
View
if (i == 0)
it will count the first row, then what you mean by count-1..i don't get you? sorry, i a bit slow
acing wei
12-Jan-14 20:28pm
View
yes i added column, but how to ask the array to exclude the last column?
acing wei
10-Jan-14 9:39am
View
Hay, I want to add another column beside the test 4 column, like this
Testing|
Pass. |
Fail. |
By using your array code above I can get my x and y value by rows.. but my problem now I actually don't want to my last column this read by the array ... Because this last column don't need to show in my x and y chart.. is it possible to do that?...
acing wei
9-Jan-14 21:39pm
View
test1|test2|test3|test4| >> testing
125 |143 |144 |123 >>pass
123 |123 |154 |134 >>fail
hay jocodes i need your help..if i want to add another column on the right side with a string..and i use this
System.Data.DataColumn newColumn = new System.Data.DataColumn("Hours", typeof(System.String));
newColumn.DefaultValue = 5;
dtoutput.Columns.Add(newColumn);
Im using this but i don want to count the last column in with the array code x and y above... can you help me with some suggestion?
acing wei
8-Jan-14 2:51am
View
thanks it works...
acing wei
7-Jan-14 23:39pm
View
y = Array.ConvertAll(dtoutput.Rows[i].ItemArray, item => int.Parse(item));
is this how to convert to integer?? i got this error
"Y values cannot be data bound to the string object"
acing wei
7-Jan-14 23:10pm
View
have on top of var rownames..
acing wei
7-Jan-14 7:31am
View
Can help me sir?
acing wei
7-Jan-14 2:44am
View
my chart datasource is using dtoutput.. and the output of above code looks like this
test1|test2|test3|test4|
125 |143 |144 |123 >>> pass value
123 |123 |154 |134 >>>rework value
I need to show the row values in chart..
acing wei
7-Jan-14 2:41am
View
yes.... i need to show by row values....
acing wei
7-Jan-14 2:30am
View
Deleted
}
var columnNames = lstData.Select(k => k.FileName).Distinct();
foreach (string columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof(string));
DataRow newrowPassCount = dtoutput.NewRow();
DataRow newrowReworkCount = dtoutput.NewRow();
int pprevcount = 0;
int rprevcount = 0;
foreach (string columnName in columnNames)
{
int pcount = lstData.Where(k => k.FileName == columnName).Count(k => k.status.Trim() == "PASS");
int rcount = lstData.Where(k => k.FileName == columnName).Count(k => k.status.Trim() == "REWORK");
newrowPassCount[columnName] = "Pass: " + (Convert.ToString(pcount - pprevcount));
newrowReworkCount[columnName] = "Rework: " + (Convert.ToString(rcount - rprevcount));
pprevcount = pcount;
rprevcount = rcount;
}
dtoutput.Rows.Add(newrowPassCount);
dtoutput.Rows.Add(newrowReworkCount);
acing wei
7-Jan-14 1:55am
View
Chart1.DataSource = lstData;
Chart1.Series["pass"].XValueMember = "";
Chart1.Series["pass"].YValueMembers = "";
Chart1.DataBind();
which one? i dont get it
acing wei
7-Jan-14 1:24am
View
table is my new datatable... yes first row is x axis , second and third row is y axis..how to do that?
acing wei
7-Jan-14 1:01am
View
test1|test2|test3|test4|
125 |143 |144 |123
123 |123 |154 |134
i want my chart to show x value as test1, test 2, test 3 ,test 4 and my y value is the number in the table..
name |value|
test1|125
test2|143
test3|144
most of the example they take x value from name and y value from value..then it will plot he chart..but what i want is from row..
acing wei
6-Jan-14 23:08pm
View
all of the binding is bind using column...can i read it from row??
acing wei
6-Jan-14 23:06pm
View
microsoft charting display in column chart...
acing wei
6-Jan-14 8:28am
View
Column with name '125' was not found.
i think because yvaluemembers is read from column..where my 125 is in my row..
anyway to get value from row?
acing wei
6-Jan-14 3:15am
View
I post before but nobody help me....i research google but i can't find what i need..a column chart using chart binding.
acing wei
6-Jan-14 1:53am
View
mr karthik, can explain me how to get a simple chart from my new tablelist? i have solved my table problem yesterday..
acing wei
3-Jan-14 4:26am
View
column chart...I'm using csv with ,my code above
// Set chart data source
chart1.DataSource = dtoutput;
// Set series members names for the X and Y values
chart1.Series["Series 1"].XValueMember = "";
chart1.Series["Series 1"].YValueMembers = "";
// Data bind to the selected data source
chart1.DataBind();
I'm using something like this but can't work..
acing wei
3-Jan-14 4:25am
View
Deleted
column chart...I'm using csv with ,my code above
// Set chart data source
chart1.DataSource = dtoutput;
// Set series members names for the X and Y values
chart1.Series["Series 1"].XValueMember = "";
chart1.Series["Series 1"].YValueMembers = "";
// Data bind to the selected data source
chart1.DataBind();
I'm using something like this but can't work..
acing wei
3-Jan-14 1:58am
View
so what should i do now? it keep taking previous file pass/fail count.
acing wei
3-Jan-14 1:48am
View
oh, thats the row count that read from table list...but my row i count it manually between 0730 & 0830 total 262.. the lstdata. count counted it 368
acing wei
3-Jan-14 1:41am
View
i debug and put break point..
int count = lstData.Where(k => k.FileName == columnName).Count(k => k.status == "PASS");
the lstdata.count=368 how they get 368?
acing wei
3-Jan-14 1:18am
View
3 rows.. i know why the 2nd and 3rd file when i read the pass and fail count become wrong..they actually sum up the previous file pass/fail eg: i read 0730.csv,o830.csv,and 0930.csv ..pass and fail in o830.csv,and 0930.csv will be wrong because o830.csv sum up the count of 0730.csv..and 0930.csv sum up both 0730.csv,o830.csv ass /fail....it never clear the value..
acing wei
3-Jan-14 1:02am
View
tried.. still same..only first csv pass/fail count correct..
acing wei
2-Jan-14 23:38pm
View
i found something for eg: I read 0730.csv,o830.csv,and 0930.csv the first 0730.csv pass and rework count is correct, 0830 and 0930 will be wrong...
when i read eg:o830.csv, 0930.csv and 1030.csv , the 0830.csv will be correct..only first looping count is correct...i use break point to check only first loop count is correct after 2nd and 3rd loop the total count will become wrong.
acing wei
2-Jan-14 23:03pm
View
Deleted
foreach (DataRow row in dt.Rows)
{
lstData.Add(new Tablelist() { FileName = csv.Replace(".csv", "").Replace(".CSV", ""), process = row["process"] + "", Event = row["Event"] + "", status = row["status"] + "" });
}
}
var columnNames = lstData.Select(k => k.FileName).Distinct();
foreach (string columnName in columnNames)
dtoutput.Columns.Add(columnName, typeof(string));
DataRow newrowPassCount = dtoutput.NewRow();
foreach (string columnName in columnNames)
{
int count = lstData.Where(k => k.FileName == columnName).Count(k => k.status == "PASS");
newrowPassCount[columnName] = "Pass: " + (Convert.ToString(count));
}
dtoutput.Rows.Add(newrowPassCount);
DataRow newrowReworkCount = dtoutput.NewRow();
foreach (string columnName in columnNames)
{
int count = lstData.Where(k => k.FileName == columnName).Count(k => k.status == "REWORK");
newrowReworkCount[columnName] = "Rework: " + (Convert.ToString(count));
}
dtoutput.Rows.Add(newrowReworkCount);
i got a lot of csv when reading first csv the pass & rework count is correct, the second , third and fourth csv the count value of pass and rework is wrong
acing wei
2-Jan-14 22:14pm
View
oh no..after i checked with my table the pass and the fail count is wrong...help..
acing wei
2-Jan-14 21:59pm
View
Deleted
mr karthik , why the value second time load different as first time when everytime i clicked...first count the value correct , second and third load the value will change..do i need to return something to the table..
acing wei
2-Jan-14 5:28am
View
Alright.its okay...thank you... :)
acing wei
2-Jan-14 5:04am
View
ohya... if want to change to "chart" what should i put as x and y VAlue? i try but mine cannot work
acing wei
2-Jan-14 4:16am
View
yes it works...thank you .....
acing wei
2-Jan-14 3:58am
View
all column...i debug and see the value from list data didn't go into the int count
acing wei
2-Jan-14 3:51am
View
it display 0 in the column..
acing wei
2-Jan-14 2:06am
View
yes counting pass and fail
acing wei
2-Jan-14 1:42am
View
and also the fail count...
acing wei
2-Jan-14 1:10am
View
sorry, i will wait...
because i can understand your code and you really help me a lot.
thanks again mr karthik..
acing wei
2-Jan-14 1:03am
View
Loop for one DataTable and count that column store in a Variable.
Then go for next, count the same column and store in another variable and so on for other DataTables.
Then sum all the variable counts. You now have the total count.
Create a DataTable and make columns as you need and show these data under appropriate columns.
so this is what i suppose to do right? can help me one more round with example mr karthik?
acing wei
1-Jan-14 23:31pm
View
yes, when everytime looping i need to store it, how to store a variable.. how to use count and sum in a datatable?
acing wei
1-Jan-14 22:03pm
View
my code above which is read from 3 csv files :0730.csv, 0830.csv,0930.csv..merge in one table giving me this table
process|event|status|
abcdef|1234556|pass/fail|
what i want the output ,read from the "status column" above ,count the total pass and fail, give this table according to csv that read.
0730|0830|0930|
pass|pass|pass|
pass = how many pass..
acing wei
31-Dec-13 23:43pm
View
0730|0830|0930|
| | |
| | |
| | |
this is the sample output gridview...
1)inside the table is the count of "how many pass"..
2)how many pass is counted from the "status" column from the file.
3)the header is the "time' of different file that read from the for loop...
acing wei
31-Dec-13 7:12am
View
mr karthik, can guide me with my problem?..
acing wei
31-Dec-13 2:39am
View
instead of showing the whole table , i want to show it in column of 0730 ,how many pass...0830 how many pass? it will count and show it in different column ...
acing wei
31-Dec-13 2:34am
View
yes its in grid....like above... is it possible to do that?
acing wei
30-Dec-13 23:34pm
View
yes...something like that but its better if can show according to the time line ..
0730 |0830|0930|1030
pass |pass|pass|pass
| | |
something like this where pass is count from status of each files
acing wei
30-Dec-13 21:48pm
View
Yes it works...all the data is in one datatable...how bout if my 'status column' inside got pass and fail...can i get another table to list out how many pass and fail?
acing wei
30-Dec-13 5:03am
View
you mean the one in 0730 csv file....or the column that i want to create??... process, product family, status,
acing wei
30-Dec-13 5:00am
View
can you guide me with a link?... im stuck...
acing wei
30-Dec-13 4:47am
View
DataTable dt = new DataTable();
DataTable1 dt = new DataTable();
DataTable2 dt = new DataTable();
// Load Data into the datatable
dt.Load(cmd.ExecuteReader());
dt1.Load(cmd.ExecuteReader());
dt2.Load(cmd.ExecuteReader());
is it like this ?
acing wei
30-Dec-13 4:44am
View
it will be 4 columns , for 0730 to 1030...but it depends if 0730 to 0930 it will be 3 columns..
acing wei
30-Dec-13 4:35am
View
if i using dataset...how to actually read it per 0730,0830...isnt it will bind it only in one table?... can guide me a little bit? thank you...
acing wei
30-Dec-13 4:19am
View
can it be looping first time then store the value, looping second time store the value and in the end got 4 value ... yes...my grid/mychart need to show like: at0730 how many pass, 0830 how many pass...something like that ... can it be done?
acing wei
30-Dec-13 4:05am
View
okay.. the 'for each' loop it works well in reading that 4 csv files in one time which is 0730.csv,0830.csv,0930csv,and 1030.csv..in the cmd.command i count the pass value .however the gridview will only show the last csv "pass value" table which is 1030.csv...can it show four different table of "pass value" instead of the last one only..can i store the value each time it loops.....
acing wei
30-Dec-13 3:32am
View
Deleted
foreach (string datestring in lstDateString)
{
string csv = datestring + ".csv";
con.ConnectionString = constr;
//create instance for command object
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
// set your file name in the below query
cmd.CommandText = "SELECT COUNT(Status) AS Total_Pass FROM " + csv +" WHERE Status='PASS' ";
//Open Oledb Connection to read CSV file
con.Open();
//Create one datatable to store data from CSV file
DataTable dt = new DataTable();
// Load Data into the datatable
dt.Load(cmd.ExecuteReader());
//Bind data in the Gridview
GridViewShow.DataSource = dt;
GridViewShow.DataBind();
con.Close();
}
i put my command in and it works perfectly..thank you so much ...but i got another question currently i count the pass and it only show me the 1030 result...how to actually show 4 tables of 0730,0830,0930 and 1030 pass result.
acing wei
28-Dec-13 1:59am
View
my project is to read more than one csv files and plot a chart from the csv files..
okay, thank you very much...
acing wei
28-Dec-13 1:44am
View
Do you have any small sample regarding csv .... if not then never mind...i appreciate it, thank you
acing wei
28-Dec-13 1:38am
View
i actually suggest my teacher to use database but he refused to... and he forced me to use csv file to read... and i stuck ..i have no idea how to continue but he keep saying this is an easy programme... anyway thank you....
acing wei
28-Dec-13 1:19am
View
oops i should take the mmddyy out ...is my mistake... wht i mean is if i use the "select from [fpyield 12162013 0930.csv]" it will read n show me the table in the csv file...instead of doing that what i want is "select from [fpyield fromdate fromtime.csv]" fromdate where i can select different date and fromtime i can select different time. because i got a lot of csv file with different date and time. im doing my final year project and i really need help. thank you ...
acing wei
27-Dec-13 3:45am
View
still the same , it will skip the cmd.text and jump to next else if statement.. it wont read the command in it.
acing wei
27-Dec-13 3:27am
View
it goes into the if else , just that it will skip the cmd.text
the value in dropdownlist is 1 ,correct....i can't find on google any sample of using if else in OLEDB.
acing wei
27-Dec-13 3:16am
View
i put a break point ..it doesnt go into cmd1.CommandText
showing this error :>>>
Error while readingSystem.Data.OleDb.OleDbException (0x80040E0C): Command text was not set for the command object.
acing wei
27-Dec-13 2:54am
View
if (DropDownList2.SelectedValue == "1")
{
// set your file name in the below query
cmd1.CommandText = "select * from [fpyield 12162013 1030.csv] UNION select * from [fpyield 12162013 0930.csv] ORDER BY Product_family ";
}
else if (DropDownList2.SelectedValue == "2")
{
cmd2.CommandText = "select * from [fpyield 12162013 1030.csv]";
}
i put it this way but it cannot work. what is the right way to put if else in my oledb connection....thanks once again...
acing wei
26-Dec-13 20:13pm
View
Thank you, it works... but i don't know how to write a code to make it dynamically drop in according to the time slot. please guide me...
acing wei
19-Dec-13 4:16am
View
okay... so do you know how to filter out the data from different datatables.... as in do i need to link the datatables in my database. if yes how ? thank you
acing wei
19-Dec-13 3:22am
View
Hi...I'm stuck again on the same project. I'm doing my final year project ,my project is about web-based data management system... I have many datatables in one database. i need to calculate it and show some data from those database , in the end plot another table in gridview to show the sum from all the datatables. do you have any suggestion what is the next move for this kind of project ? what im doing now is I filter out some data from a lot of datatables, is that the right way? i have been searching web for past 4 weeks...thanks in advanced....
acing wei
16-Dec-13 3:36am
View
Thank you its work, can I ask you more question next time??
acing wei
13-Dec-13 1:21am
View
hi creepz, but im not only select from one column , I need to look up to database in different column like I have productfamily,process and ID so that in the web whenI select from dropdownlist n I click search it will give me the correct data that im looking for..
thank you...I appreciate.
acing wei
13-Dec-13 0:57am
View
only one database but I need to select from multiple dropdown list like product family, process, ID... and when I click search button it will lookup to my database according to what I have selected from dropdownlist...
thank you so much
Show More