google

Newest Post

Showing posts with label AJAX. Show all posts
Showing posts with label AJAX. Show all posts

Code to export the Grid View/Data Grid data into Excel File.

| Friday, February 13, 2015
Read more »
 protected void btnExportToExcel_Click(object sender, EventArgs e)  
   {  
     try  
     {  
       DataTable dt = student.GetDetails("B.Tech").Tables[0];  
       DataGrid GridView1 = new DataGrid();  
       GridView1.DataSource = dt;  
       GridView1.DataBind();  
       Response.Clear();  
       Response.Buffer = true;  
       Response.AddHeader("content-disposition", string.Format("attachment; filename=StudentsBTech.xls"));  
       Response.Charset = "";  
       Response.ContentType = "application/vnd.ms-excel";  
       StringWriter sw = new StringWriter();  
       HtmlTextWriter htw = new HtmlTextWriter(sw);  
       GridView1.GridLines = GridLines.Both;  
       GridView1.AllowPaging = false;  
       GridView1.RenderControl(htw);  
       Response.Output.Write(sw.ToString());  
       GridView1.DataBind();  
       Response.Flush();  
     }  
     catch (Exception ex)  
     {  
     }  
     finally { Response.End(); }  
   }  
   public override void VerifyRenderingInServerForm(Control control)  
   { }  

Code to export the Grid View/Data Grid data into Excel File.

Posted by : Stranger
Date :Friday, February 13, 2015
With 0comments

Could not add reference to "System.Net.Http.Formatting" namespace in WPF web api client project

| Friday, December 12, 2014
Read more »
For adding the reference in your web api client

1. Right click on "References" in the solution.
2. Following window will open.


3. Select location "Extension" as shown above and check "System.Net.Http.Formatting" namespace
4. and DONE!!!

Update the .edmx file when the database changes

| Saturday, May 17, 2014
Read more »
To update the .edmx file when the database changes

  1. In the Model Browser, right-click the .edmx file and select Update Model from Database.
  2. The Update Model Wizard starts. If there is no database connection specified, the Choose Your Database Connection dialog box appears. Otherwise, the Choose Your Database Objects dialog box appears. 
  3. If the Choose Your Database Connection dialog box appears, specify a database connection. Otherwise, go to the next step.
  4. For details about specifying a connection, see Choose Your Data Connection Dialog Box (Entity Data Model Wizard). When you have specified the connection, click Next to display the Choose Your Database Objects dialog box.
  5. Click the Add tab.
    Nodes for tables, views, and stored procedures are displayed. If any objects have been added to the database (or were not included in the previous storage model), you can expand the corresponding node to view the objects that are available to add to the conceptual model.
  6.  If an object has been deleted from the conceptual model but has not also been deleted from the storage model, the object will not be available to add to the conceptual model.
  7. Expand the Tables, Views, and Stored Procedures nodes, and check the objects you want to add to the .edmx file.
  8. Click the Refresh tab.
    Nodes for tables, views, and stored procedures that are included in the existing storage model are displayed. Any changes that have been made to these database objects will be reflected in the updated storage model. Changes to the conceptual model are made when columns are added to a table or view.
  9. Click the Delete tab.
    Nodes for tables, views, and stored procedures are displayed. If an object has been deleted from the database and was included in the previous storage model, you can expand the corresponding node. The objects in these nodes will be deleted from the updated model.
    Click Finish to update the .edmx file with the database changes.

Reference - MSDN

Update the .edmx file when the database changes

Posted by : Stranger
Date :Saturday, May 17, 2014
With 0comments
Prev
▲Top▲