The refreshCallBack function has three parameters:
dpc.refreshCallBack = function(date, days, data)
The third parameter is a string that can hold any custom value. In version 5.1 it will accept any object (that will be accessible as JsonData object on the server side).
In the server-side Refresh event handler, you can load the dataset using custom SQL without problems. It can look like this (a simplified example):
SqlDataAdapter da = new SqlDataAdapter("SELECT id, name, start, end FROM events WHERE filter = @filter", "connection string");
da.SelectCommand.Parameters.Add("filter", e.Data);
// ... add other parameters
DataTable dt = new DataTable();
da.Fill(dt);
DayPilotCalendar1.DataSource = dt;
DayPilotCalendar1.DataBid();
If it's still not clear, please contact me at support@daypilot.org.