hi, I have a Gridview like below: ![Gv3](/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8zL0d2My5KUEc%3D/283 "align-left") What I want is: 1) User can click at **LINE** column, for example user click at **M23** and it will redirect to other page. 2) At the other page, it will display something like this: **Please insert countermeasure for M23** where M23 is get from what user click. How can I do that? Here is my code: Dim DBConn As New SqlConnection("server=xxxx;uid=xxxx;pwd=xxxx;database=xxxx") Dim DBCmd As New SqlCommand Dim da As New SqlDataAdapter Dim ds As New DataSet() Dim strtTime As String Dim endTime As String strtTime = DateTime.Today.ToString("yyyy/MM/dd") & " " …

Member Avatar
Member Avatar
+0 forum 6

I have datatable looks like below: ![table2](/attachments/large/3/table2.JPG "table2") I want to create a stack chart that will produce something like this: ![stack2](/attachments/large/3/stack2.JPG "stack2") I don't know where to start. I have google about how to create stack column but still can't get it. So far I have a chart but mcname not include (only have LINENAME at X-Axis, DURATION at Y-Axis and Count (As Frequency) at Secondary Y-Axis) ![chart12](/attachments/large/3/chart12.JPG "chart12") This is my chart code: ' Setup the chart With Chart1 .DataSource = grpTot ''Datatable name .Legends.Clear() .ChartAreas.Clear() .BackColor = Drawing.Color.Linen .ChartAreas.Add(New ChartArea("Fred")) With .ChartAreas("Fred") .AxisY.LabelStyle.Format = "HH:mm:ss" .AxisY.Minimum = …

Member Avatar
Member Avatar
+0 forum 4

I have a LINQ function to get 3 things :: Line, Average of Duration and Count I have a problem to sort it based on Average Of Duration column. Here is my code: Dim group2 As IEnumerable(Of DataRow) = _ From row In Ds.Tables(0).AsEnumerable() _ Group row By LINENAME = row.Field(Of String)("LINENAME") Into grp = Group _ Order By (LINENAME >= Convert.ToString(LINENAME)) _ Select DTRow(grpTot, _ New Object() {LINENAME, _ New TimeSpan(CType( _ grp.Average(Function(r2 As DataRow) TimeSpan.Parse(r2.Field(Of String)("EVENTTM")).Ticks), _ Int64 _ ) _ ), _ grp.Count() _ } _ ) How can I sort my LINQ based on the Average, …

Member Avatar
Member Avatar
+0 forum 12

Hi, How can i draw a horizontal line in my chart? Currently my chart look like below: ![chart11](/attachments/large/3/chart11.JPG "chart11") Before this i use below code to draw it but when i try to draw with this application (Y axis in datetime), it give me error like 'make sure not dividing by zero' Private Sub Chart1_PostPaint(ByVal sender As Object, ByVal e As ChartPaintEventArgs) Handles Chart1.PostPaint If TypeOf e.ChartElement Is ChartArea Then Dim area As ChartArea = CType(e.ChartElement, ChartArea) Dim x1 As Single = CSng(area.AxisX.ValueToPixelPosition(area.AxisX.Minimum)) Dim x2 As Single = CSng(area.AxisX.ValueToPixelPosition(area.AxisX.Maximum)) Dim y As Single = CSng(area.AxisY.ValueToPixelPosition(20)) e.ChartGraphics.Graphics.DrawLine(New Pen(Color.Blue, width:=5), x1, y, …

Member Avatar
+0 forum 0

I have two datatables that generate a datagridview like below: 1) datatable name : grpDT ![119](/attachments/large/3/119.JPG "119") 2) datatable name : grpTot ![211](/attachments/small/3/211.JPG "211") I want to merge both datatable so that I the datagridview will be like this: ![34](/attachments/large/3/34.JPG "34") what is the best way to do this? do i need to create new datatable and merge it?

Member Avatar
Member Avatar
+0 forum 3

Hi, I have 2 datagridview. 1 to show TANTOU, TOTAL SUM of DURATION and COUNT of event happened. Another 1 is to show TANTOU, AVERAGE of DURATION and COUNT of event happened. I have use LINQ function to get the result. But how can i combine it so that i can show both result in the same datagrid? (means, I just use 1 LINQ function that can display TANTOU, SUM, AVERAGE, and COUNT) here is the code of sum: Dim group As IEnumerable(Of DataRow) = _ From row In Ds.Tables(0).AsEnumerable() _ Group row By TANTOU = row.Field(Of String)("TANTOU") Into grp …

Member Avatar
+0 forum 0

I want to display datatable result in a label. I have something like this : PLEASE TAKE ACTION FOR LINE **LABEL** But i want the result to be like this: PLEASE TAKE ACTION FOR LINE **Z3, Z5, Z8** I try to use loop but still cant get the result that I want. Here is my loop: If ds.Tables(0).Rows.Count <> 0 Then For i As Integer = 0 To dt.Rows.Count - 1 line += dt.Rows(i)("LINE").ToString() lblLine.Text = line Next End If Can someone help me please..

Member Avatar
Member Avatar
+0 forum 1

I want to perform an UPDATE query but i'm getting this error: ![errorHAVING](/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8zL2Vycm9ySEFWSU5HLkpQRw%3D%3D/500 "errorHAVING") This is my Sub in vb.net: Public Sub changeStatus() Dim Sqlstr As String Dim connectionString As String = "server=xxxx;uid=xxxx;pwd=xxxx;database=xxxx" Dim strtTime As String Dim endTime As String strtTime = DateTime.Today.ToString("yyyy/MM/dd") & " " & "06:15:00" endTime = DateTime.Today.ToString("yyyy/MM/dd") & " " & "18:15:00" Sqlstr = " UPDATE dbo.VAC_LineStatus " Sqlstr = " SET SET Status = @Status " Sqlstr = " WHERE (Line IN " Sqlstr = " (SELECT VAC_JSINFO.LINE " Sqlstr = " FROM dbo.VAC_LineStatus INNER JOIN " Sqlstr = " VAC_JSINFO ON dbo.VAC_LineStatus.Line = …

Member Avatar
Member Avatar
+0 forum 3

Hi, How can i change the bar chart color after I click a button? Here is the senario. I have a bar chart to show line progress. Here is the 3 condition for the bar chart: 1) Before the bar chart reach maximum limit, the color will set to blue. 2) When the bar chart reach maximum limit, the color will set to red. 3) When someone fill in countermeasure form in another page and click button submit, the bar chart will change to green. For the first one, i just set the color in the server-side code : .Color …

Member Avatar
Member Avatar
+0 forum 2

How can I change the color of bar chart based on value in database column? For example, in table "STATUS" in my database, I have 3 type of value. What I want is: 1) If the value = 0, then color will change to blue. 2) If the value = 1, then color will change to red. 3) If the value = 2, then color will change to green. I use MSChart to create the chart. I set the default color as blue. I tried to store STATUS value in dataset and do for loop to retrieve the value. If …

Member Avatar
Member Avatar
+0 forum 2

Hi, Is it possible to send an email from SMTP server, for example from do_not_reply@xxxx.xxx.com, without have the server credential (username and password) inside my code? I tried one code, it works, but it send from my email account. Not from SMTP server. I also tested several code but I cant proceed to send the email since it need server credential. And my Symantec popup error like ***Symantec email policy: Your email message was unable to be sent because your mail server rejected the message. 550 5.7.1 Client does not have permissions to send as this sender*** can someone help …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a bar chart to display information. I also have a vertical line indicate the limit of Y-value. For example, I set the limit to 25. So now I want the color of column bar to change to red color if the column exceed the limit. I tried this but the result, i get all column color changed, not only column that exceed the limit. Dim maxAlert = GetMax() \\ get maximum column value. If maxAlert > 25 Then .Color = Color.Crimson \\if max value exceed 25, the color changed Else .Color = Color.LightCoral End If This is …

Member Avatar
Member Avatar
+0 forum 1

Hi, I want to get last working day data from database(SQL database). For example, if today is Tuesday, I want to get Monday data. I can get the data directly using strtTime = Date.Now.AddDays(-1).ToString("yyyy/MM/dd") & " " & "06:15:00" But the problem is if today day is Monday. Since the last working day is not fixed, for example for week32, if today is monday, the last working day before monday is last saturday. but for week33, if today is monday, the last working day is last Friday. Sometimes the last working day can be last Thursday or Wednesday also. My …

Member Avatar
Member Avatar
+0 forum 9

Hi, i have a dataset with 2 columns. 1 column is in String datatype and another one is in Timespan. Now i want to generate a chart from the dataset. While i'm trying to generate the chart, it has error: *"Series data points do not support values of type System.TimeSpan only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort. "* Do I need to convert my timespan column to another type first? Can someone help me how to solve this error?

Member Avatar
Member Avatar
+0 forum 20

Hi, How can i convert my column with timespan dataType (Eg: 04:04:45 ) to DateTime in HH:mm:ss format (Eg: 04:04:45)? Currently I can convert the column to datetime (Eg: 10/2/2012 4:04:45 AM) but I only want the time (Eg: 04:04:45 ). Can someone help me please...

Member Avatar
Member Avatar
+0 forum 8

Hi, i'm a newbie and get stuck with this problem for a few days. I have datatable with two column, line and duration. I want to sum the duration based on the line group. For example: LINE DURATION A1 00:05:20 A1 00:07:00 A1 00:02:10 A1 00:01:50 A2 00:02:01 A2 00:03:45 I want the output to be like this: LINE DURATION A1 00:14:30 A2 00:05:46 I cant do this straight from Oracle query because column duration is stored as Char in the database. So i hava to convert the column to timespan and store in another column in the datatable. Here …

Member Avatar
Member Avatar
+0 forum 2

The End.