Below is the example of calling declared variables in script task editor.
string userName = (string)Dts.Variables["User::UserName"].Value;
string password = (string)Dts.Variables["User::Password"].Value;
Sometimes when we call the datetime variable, we need to convert it to the required format like 'dd-MM-yyyy' or with time, etc. Below is the example:
string s = FromDate.ToString("yyyy-MM-dd");
DateTime ToDate = (DateTime)Dts.Variables["User::ToDate"].Value;
string s1 = ToDate.ToString("yyyy-MM-dd");
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.