DarkWorlds
Technical User
--If this post several times im unsure why. It kept erroring on me.
Well I am finishing a small part of a project, but ive never seen something written up this way. After researching its done really well, but this leave me clueless on how to sort it, mainly because im used to messing with datagrids on load.
This is the beginning of it really.
So a button is hit, and this is called, it sets up the datagrid.
Well I am finishing a small part of a project, but I’ve never seen something written up this way. After researching it’s done really well, but this leave me clueless on how to sort it, mainly because I’m used to messing with datagrid’s on load.
This is the beginning of it really.
Now the build query is called. No need to show you what it is, as I’m sure you can guess. Its a select statement that is built. So when this happens the table is ready to go.
Now I need to sort it, I am unsure how ill do this. Normally I’m used to the normal setup of a dataview, and having it load the grid on pageload event. I’m so confused on how to sort this, and how to display it. I mean it’s honestly that simple (well not really that simple, the building of the select statement is the most complex)
Please if ya got any tips, articles or anything let me know I will be looking forward to it.
Well I am finishing a small part of a project, but ive never seen something written up this way. After researching its done really well, but this leave me clueless on how to sort it, mainly because im used to messing with datagrids on load.
Code:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if(!IsPostBack)
{
hklCopyRight.Text += DateTime.Now.Year.ToString();
pContentPic.Visible=true;
objUser.Get_User();
}
}
Code:
private void btnGetResult_Click(object sender, System.Web.UI.ImageClickEventArgs e)
LoadSearchResult();
So a button is hit, and this is called, it sets up the datagrid.
Code:
public void LoadSearchResult()
{
string SQL= BuildQuery();
SqlConnection myConn = new SqlConnection();
myConn.ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings.Get("connString");
SqlCommand myCmd = new SqlCommand(SQL,myConn);
myConn.Open();
dgResult.DataSource = myCmd.ExecuteReader(CommandBehavior.CloseConnection);
dgResult.DataBind();
lblRecords.Text = dgResult.Items.Count.ToString()+ " records found.";
myConn.Close();
}
Well I am finishing a small part of a project, but I’ve never seen something written up this way. After researching it’s done really well, but this leave me clueless on how to sort it, mainly because I’m used to messing with datagrid’s on load.
This is the beginning of it really.
Now the build query is called. No need to show you what it is, as I’m sure you can guess. Its a select statement that is built. So when this happens the table is ready to go.
Now I need to sort it, I am unsure how ill do this. Normally I’m used to the normal setup of a dataview, and having it load the grid on pageload event. I’m so confused on how to sort this, and how to display it. I mean it’s honestly that simple (well not really that simple, the building of the select statement is the most complex)
Please if ya got any tips, articles or anything let me know I will be looking forward to it.