Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert c to vb 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi all,

i found this script from the adobe website and is it possible for some1 to convert this to vb....am not having much luck?

Code:
<script runat="server">
protected void dg_employees_SortCommand(Object sender, DataGridSortCommandEventArgs e)
{
 // This function allows us to sort on the headers in the datagrid.
 // Need these two attributes in the Datagrid:
 // 	AllowSorting="true" 
 // 	OnSortCommand="dg_employees_SortCommand"
 // Each BoundColumn (or TemplateColumn) that allows sorting needs this attribute:
 // 	SortExpression="<column_name>" where <column_name> is the name of the column in the database
 // The value of the SortExpression is used in the query string "sortOn".
 // The query string is used in the ternary expression in the 
 // dataset (ds_employees) for the ORDER BY clause in the CommandText.

 string sortDir = "";
 if (Request.QueryString["sortOn"] == e.SortExpression)
 {
	     // The sort expression matches what was sorted on last time 
   	  if (Request.QueryString["sortDir"] == "")
	     {
		     sortDir = "ASC";
	     }
	     else if (Request.QueryString["sortDir"] == "ASC")
	     {
		     sortDir = "DESC"; 
	     }
	     else if (Request.QueryString["sortDir"] == "DESC")
	     {
		     sortDir = "ASC"; 
	     }
 }
 else
 {
	// Have a new sort expression so always start out ASC
	sortDir = "ASC";
 }
     
 // Redirect back to this page with the appropriate sort expression and direction.
 Response.Redirect(Request.ServerVariables["SCRIPT_NAME"] + "?sortOn=" + e.SortExpression + "&sortDir=" + sortDir);
}
</script>

many thanks
 
If you do a simple google search, you will find many hits on this topic exactly. Many "developers"/groups have made these available to you for free. There is even a couple you can download and setup as a VB project and not have to be online to do the conversion.

One of my favorites is here:


=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
I wonder what you have so far in VB, since I don't see any difficult code there.

Christiaan Baes
Belgium

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top