ss_blog_claim=4037e1ab37562895784b0e2f995a5eec ss_blog_claim=4037e1ab37562895784b0e2f995a5eec
Showing posts with label microsoft. Show all posts
Showing posts with label microsoft. Show all posts

7.17.2008

Making your Gridview sort in Ascending and Descending Order

Two days ago, our QA tester posted an improvement request for our project on the issue log tracking tool. She wanted a more flexible sorting feature on the gridview.

I initially didn't bother to do it at first coz it was just an improvement and i was still focusing on fixing my bugs. Also, i thought it was easily and can be done in an hour. But when i started doing progress on this issue i realized that it was not as easy as i though i would be.

I'm almost done but i'm encountering a slight problem on one of my classes..

Here's the code:

//Here's the code on my Data Access Layer class:

//********************************

public cls_SqlDataSource(CommandType _CmdType, string _CmdText)
{
this.connectionString = EMS.Configuration.EMSConfiguration.Instance.ConnectionString;
cmd.CommandType = _CmdType;
cmd.CommandText = _CmdText;
}

public SqlDataReader ExecuteReader()
{
SqlConnection Conn = new SqlConnection(this.connectionString);
cmd.Connection = Conn;
SqlDataReader objReader;

try
{
Conn.Open();

objReader = cmd.ExecuteReader();
return objReader;
}
catch (SqlException ex)
{
throw new Exception(ex.Message);
}
finally
{
Conn.Close();
Conn = null;
cmd = null;
objReader = null;
}

}

//********************************************


//And here's the calling class on the Business Layer side of the application

//********************************************

public static ArrayList arListGetEpmMain(int userID, int groupID)
{
SqlDataReader reader = null;

try
{
EMS.DataAccess.cls_SqlDataSource cmd = new cls_SqlDataSource(CommandType.StoredProcedure, "usp_myStoredProcedure");
cmd.AddParameter("@param1", SqlDbType.Int, 8, ParameterDirection.Input, param1);
cmd.AddParameter("@param2", SqlDbType.Int, 8, ParameterDirection.Input, param2);

reader = cmd.ExecuteReader();

if (reader.Read())
{
ArrayList aList = new ArrayList();

while (reader.Read())
{
EPMMain objEPMMain = new EPMMain();

// assign the database values to the object's properties

objEPMMain.IsRead = reader.GetBoolean(23);
objEPMMain.TimeStamp = reader.GetString(1);
objEPMMain.MyID = reader.GetString(0);
objEPMMain.Version = Convert.ToInt32(reader.GetDecimal(33));
objEPMMain.Project = reader.GetString(16);
objEPMMain.SDateTime = Convert.ToDateTime(reader.GetString(17));
objEPMMain.DateDue = Convert.ToDateTime(reader.GetString(28));
objEPMMain.CatName = reader.GetString(19);
objEPMMain.CusName = reader.GetString(20);
objEPMMain.UName = reader.GetString(21);
objEPMMain.IndName = reader.GetString(22);
objEPMMain.IsAlrt = Convert.ToInt32(reader.GetBoolean(12));
aList.Add(objEPMMain);
}

return aList;
}

return null;

}

catch (Exception ex)
{
throw ex;
}

finally
{
reader.Close();
}
}

//****************************************************



I'm using .Net Framework 2.0 and Windows XP OS. Any help will greatly be appreciated!

**THIS ISSUE IS ALSO POSTED ON THE MICROSOFT FORUMS.

7.15.2008

About Me ..(Part 2)

After almost 2 years of stay with my first loved IT firm, i decided to move on. My reason that time was that i needed a change in my working environment and wanted training. Thru the help of jobstreet I was blessed to have found the right company.

From this company(where i still am presently working), I was able to enjoy the following Microsoft training for free:
1. Course 2071 Querying a Microsoft SQL Server 2000 with Transact - SQL
2. Course 2072 Administering a MS SQL Server 2000 Database
3. Course 2073 Programming SQL Server 2000 Database
4. Course 2541 Core Data Access with Microsoft Visual Studio 2005

I was also able to take a Microsoft Certification Exam for free for which i earned my Microsoft Certified Professional title. Ofcourse, there's nothing to boast about that. I do want to take other certification exams but i noticed that there are a lot of cheats online. So it doesn't really make sense earning a Microsoft title since you can easily cheat..

By the way, I have also learned and am focusing on these following technologies:
- .Net Framework 1.x and 2.0 still using both C# and VB for my PL,
- AJAX, and
- Microsoft SQL 2005 for the database