Hello
@Hosathota Vishwanatha, i have read your blog on how to connect to DB2 from an Azure function app, everything is clear but i am getting an error " Length cannot be less than zero. (Parameter 'length')." can you please help me on this.
i am trying to develop a time triggered function app , here is the code wrote, but i am getting that error while "connection.Open();"
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer, ILogger log)
{
try
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
string responseMessage = "This Time triggered function executed successfully. Welcome ";
responseMessage += " DB open will be tried ";
DB2Connection connection = new DB2Connection("Server = ************** :***; Database = ********** ; UID = ****** ; PWD = *********; ");
// string version = connection.ServerVersion;
connection.Open();
responseMessage += " DB opened" + connection.ServerVersion;
Console.WriteLine(responseMessage);
connection.Close();
}
catch (Exception ex)
{
string responseMessage = null;
responseMessage += " Db error " + ex.Message;
// return new Microsoft.AspNetCore.Mvc.OkObjectResult(responseMessage);
}
}
}
Can you please help me on this?
thanks.
------------------------------
Vamshider Dasari
------------------------------
#DataManagementGlobal#DataServerDrivers