Dear All,
I would like to create a condition in vb.net.
by default, the code is the following:
"using System;
public class Test
{
// a VisualCron Condition must return a boolean which is the result of the Condition
public static bool MyCustomCondition(int valueX, int valueY)
{
return (valueX == valueY);
}
}"
I would like to do something like this in vb.net:
launch a sql statement on a sql server and bring the result: ok or nothing.
"using System;
public class Test
{
public static bool MyCustomCondition()
{
Server s;
Client c = new Client();
Connection conn = new Connection();
conn.Connectiontype = Connection.ConnectionT.Remote;
conn.Address = "GOSQL05\DWHPROD";
conn.UserName = "admininstrator";
conn.PassWord = "xxxx";
s = c.Connect(conn, true);
Dim comm As New SqlCommand("select 'OK' as statut from [ADMIN].[dbo].[Calendrier] where CalFirstWorkedDayOfMonth = 1 and CONVERT(char
(10), [CalDate],126) = CONVERT(char(10), GetDate(),126)", conn)
Dim reader As SqlDataReader = comm.ExecuteReader,
Dim dt As New DataTable,
dt.Load(reader);
Label1.Text = dr.Item("statut");
If Label1.Text = "OK"
Then return = 0;
Else
return= 1
End If
s.Disconnect();
}
}"
Does someone to help me?
BR