Click here to Skip to main content
15,884,099 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionpublish Pin
Shriya Kapoor15-Feb-07 22:30
Shriya Kapoor15-Feb-07 22:30 
AnswerRe: publish Pin
rama charan15-Feb-07 22:45
rama charan15-Feb-07 22:45 
GeneralRe: publish Pin
Shriya Kapoor15-Feb-07 23:20
Shriya Kapoor15-Feb-07 23:20 
GeneralRe: publish Pin
rama charan16-Feb-07 0:28
rama charan16-Feb-07 0:28 
Questionhow to send secure data Pin
rama charan15-Feb-07 21:27
rama charan15-Feb-07 21:27 
AnswerRe: how to send secure data Pin
Sylvester george16-Feb-07 2:16
Sylvester george16-Feb-07 2:16 
Generalthanks .... can we have something about it at local msdn Pin
rama charan16-Feb-07 5:49
rama charan16-Feb-07 5:49 
Questionhow to use SLL to send secure data Pin
rama charan15-Feb-07 21:23
rama charan15-Feb-07 21:23 
AnswerRe: how to use SLL to send secure data Pin
Michael Sync15-Feb-07 23:21
Michael Sync15-Feb-07 23:21 
Generalthanks .... can we have something about it at local msdn Pin
rama charan16-Feb-07 0:15
rama charan16-Feb-07 0:15 
GeneralRe: thanks .... can we have something about it at local msdn Pin
Michael Sync16-Feb-07 0:48
Michael Sync16-Feb-07 0:48 
Questionerror messages Pin
TheEagle15-Feb-07 21:20
TheEagle15-Feb-07 21:20 
AnswerRe: error messages Pin
DavidNohejl16-Feb-07 16:24
DavidNohejl16-Feb-07 16:24 
GeneralRe: error messages Pin
TheEagle18-Feb-07 19:23
TheEagle18-Feb-07 19:23 
QuestionSORTING DATAGRID COLUMNS Pin
Member 372511515-Feb-07 21:12
Member 372511515-Feb-07 21:12 
hi my dear friends,
i have written code for sorting a datagrid column as given below.but its not working perfectly.please check the code and help me to over come this problem.
thanks
sumith
****************************************************************
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApplication1.images
{
public class sort : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;

private void Page_Load(object sender, System.EventArgs e)
{

if (!Page.IsPostBack )

{

BindGrid();

}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

public void DataGrid_Page(object sender, DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex = e.NewPageIndex;
BindGrid();
}

public void DataGrid_Sort(object sender, DataGridSortCommandEventArgs e)
{
DataGrid1.CurrentPageIndex = 0;
SortField = e.SortExpression;
BindGrid();



}

protected String SortField
{
get
{
object o = ViewState["SortField"];
return (o == null) ? String.Empty : (String)o;
}
set
{
ViewState["SortField"] = value;
}
}
void BindGrid()
{
SqlConnection con3=new SqlConnection("server=localhost;Persist Security Info=False;User ID=sa;password=sa;Initial Catalog=vms_database;Data Source=server0");
string CommandText;
if(SortField == String.Empty)
CommandText = "select * from Admin_ringtone order by songname";
else
CommandText = "select * from Admin_ringtone order by" + SortField;
SqlDataAdapter ad = new SqlDataAdapter("select * from Admin_ringtone ",con3);
DataSet ds = new DataSet();
ad.Fill(ds,"Admin_ringtone");
DataGrid1.DataSource = ds;
DataGrid1.DataBind();

}
}
}
AnswerRe: SORTING DATAGRID COLUMNS Pin
Sylvester george15-Feb-07 21:33
Sylvester george15-Feb-07 21:33 
AnswerRe: SORTING DATAGRID COLUMNS Pin
www.suniltvl.in18-Feb-07 20:18
www.suniltvl.in18-Feb-07 20:18 
Questionstring to DateTime Pin
Blue_Boy15-Feb-07 20:57
Blue_Boy15-Feb-07 20:57 
AnswerRe: string to DateTime Pin
Sylvester george15-Feb-07 22:21
Sylvester george15-Feb-07 22:21 
GeneralRe: string to DateTime Pin
Blue_Boy15-Feb-07 22:43
Blue_Boy15-Feb-07 22:43 
GeneralRe: string to DateTime Pin
Sylvester george15-Feb-07 23:01
Sylvester george15-Feb-07 23:01 
GeneralRe: string to DateTime Pin
Blue_Boy15-Feb-07 23:11
Blue_Boy15-Feb-07 23:11 
GeneralRe: string to DateTime Pin
Sylvester george15-Feb-07 23:16
Sylvester george15-Feb-07 23:16 
GeneralRe: string to DateTime Pin
Marcus J. Smith16-Feb-07 6:29
professionalMarcus J. Smith16-Feb-07 6:29 
QuestionXML writing access denied Pin
sandipan.neogi@gmail.com15-Feb-07 20:54
sandipan.neogi@gmail.com15-Feb-07 20:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.