Member Avatar

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
0
19
Member Avatar

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
0
18
Member Avatar

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
0
7
Member Avatar

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
0
6
Member Avatar

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
0
12
Member Avatar

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
0
5
Member Avatar

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
0
5
Member Avatar

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
0
10
Member Avatar

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
0
30
Member Avatar

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
0
10

The End.