Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have to run a SSIS package multiple times and have to view the progress.
I have prepared the package and have created log which will capture the starttime , end time.
For example, below is my table output

Select * from packagelog

ID PackageName Starttime Endtime Status
1 A 4:17 PM 4:18PM Completed
2 B 4:18 PM 4:24PM Completed
3 C 4:24 PM 4:32PM Inprogress
4 D 0 0 Not Started
5 E 0 0 Not Started


I need to show this output to the users on a frontend using .net or C#.
Is there any reference article for creating this.
Posted
Comments
virusstorm 14-May-15 12:05pm    
I'm not sure what exactly you are looking for here. It sounds like you simply need to create a web page that shows the data in the table. There are many examples on the web to bind a page to table in a database.
abhishek6555 14-May-15 13:56pm    
No i don't want it on web page. When i click an exe it should open a window which should show the progess from packagelog
virusstorm 14-May-15 14:05pm    
Forms or console application?

All you need to do is write an application that connects to the database, queries the table, and displays the result. This is rather straight forward, is there something specific you are having a problem with?
abhishek6555 15-May-15 6:02am    
console application

1 solution

This is a very basic solution, but it should give you a good starting point.

C#
var commandText = "SELECT * FROM dbo.PackageLog";
var connectionString = ConfigurationManager.ConnectionStrings["localDatabse"].ConnectionString;

DataTable dataTable = new DataTable();

using (SqlConnection sqlConnection = new SqlConnection(connectionString))
{
    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(commandText, sqlConnection))
    {
        sqlDataAdapter.Fill(dataTable);
    }
}

Console.WriteLine("ID   Package Name     Start Time              End Time                Status");
Console.WriteLine("---  ---------------  ----------------------  ----------------------  --------");

foreach (DataRow dataRow in dataTable.Rows)
{
    Console.WriteLine(
        "{0}  {1}  {2}  {3}  {4}",
        ((int)dataRow[0]).ToString().PadRight(3),
        ((string)dataRow[1]).PadRight(15),
        ((DateTime)dataRow[2]).ToString().PadRight(22),
        (dataRow[3] is DBNull) ? String.Empty.PadRight(22) : ((DateTime)dataRow[3]).ToString().PadRight(22),
        (string)dataRow[4]);
}

Console.ReadKey();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900