|
One table contains the Master Ids like: CategoryId, SubCategoryId, RegionId, LocationId, DepartmentId, ItemId ... etc. which is having relation with different master tables.
and there is no chance of avoiding joins.
Regarding Index - All the above mentioned fields are primary key in the respective table.
Having the "Paging" option and the "Master" tables are joined only to the page size resultset.
|
|
|
|
|
You might want to take this over to the SQL forum (probably wouldn't have been a bad place to start), and see if the big brains over there can help...
|
|
|
|
|
I appreciate your idea. I posted the same in SQL side as well and got some better ways of doing it. But I am looking out any better ways through dot net application.
|
|
|
|
|
Verify that you have indexes on the fields that you use to identify records in the query.
If you for example join in a table using:
inner join SomeTable s on s.SomeUniqueId = x.SomeExternalKey
Check that you have an index on the SomeUniqueId field. (If the field is primary key in the table, it automatically has an index.)
Run the query in Management Studio and view the execution plan. That will show you what is really done when the query runs.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If your data is not updating frequently the use datacaching to store data, that it will not hit your database server every time. data will be read from cache itself.
You can update the cache on a particular time interval.
|
|
|
|
|
Hi, All
I just start a new program i asp.net and it confuse me in some basic concept. as you can see i just create a public class named connection then i want to initialize it on page load.
but when ever i click on any of the button, it give me the error null reference error whats wrong in ASP.NET, because same work with the windows application with C#.
plz do reply
regards
Yogesh Agarwal
public partial class Admin_Default : System.Web.UI.Page
{
Connection con;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
con = new Connection();
}
protected void Button1_Click(object sender, EventArgs e)
{
con.skysconnection();
}
protected void Button2_Click(object sender, EventArgs e)
{
con.skysconnection();
}
}
|
|
|
|
|
Hi,
Why do you make your connection int he Page_Load? I cannot see the reason for doing this. Why not in the skysconnection() method?
Kind regards
simsen
|
|
|
|
|
Thanks for the reply.
Acctually it is just a doubt in the mind, i could do it in sevral manners, i just want to know what is the problem in doing the same in this manner.
Regards
Yogesh Agarwal
|
|
|
|
|
ASP.NET is stateless ... which means it doesnt maintain the state of its objects ... on each request and response cycle the page is treated as something new and for the first time ... thats why state management in ASP.NET is a challenge ...
The code you provided should work on Windows Application because it maintains the state of its object ... but here each time you click the button the page is reinitialized with its variables you declared ..to solve such a problem read about maintaining objects states using Sessions and ViewStates in ASP.NET
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Thanks for the answer,
Means in every pageload or postback the objects were destroyed we defined in ASP.NET,
And does it works fine if i use ajax.
Regards
Yogesh Agarwal
|
|
|
|
|
Actually AJAX has nothing to do with the main life cycle of a page ... for the scope you are talking about its only the server side .. and there where you are concerned about the life cycle of page.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
I've got some labels in Gridview2 that I allow the user to drop into text boxes in Gridview1 and it would change the textbox information to label information.
Initially i drag a label onto the text box and the value of textbox changes to label info, if i drag different label onto the same text box it will just append to the existing text and i am not able to override the text in textbox.
i am using VS2005 with Ajax extensions.
Plz help to override the value in textbox
Thanks in Advance.
modified on Thursday, November 20, 2008 6:19 AM
|
|
|
|
|
Hi everyone can anybody tell me how compatible asp.net project with apache 2.2....we r planning to host website using asp.net with Apache webserver...does this works? if yes can u tell me hw can i implement it...? if no please tell me the reason and in which way it can be implemented....
Thanks in advance..
|
|
|
|
|
|
wht abt mod_aspdotnet.so....i saw in website they used mod_aspdotnet.so n its working fine but am nt sure abt the security level...so can anyone tell me is it safe? and Abt mono i don have any idea...i have to try...
|
|
|
|
|
Sorry ! I don not have idea. But These all stuff you can ask in Mono Forum. That would be better.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
oh thank you very much...
|
|
|
|
|
hi,
I am facing a problem with authentication in IIS.I have to use a COM componet that internally takes the logged in users information and if that user is valid then we can make calls to COM.I developed a windows application and its takes logged in user information and works fine.Later we decided to make it as a webservice there the problem started.If we run the webservice in Visual studio's webserver its works fine after moving to IIS the COM component is not able to get the logged in user information and stops working.
Hosted in IIS with anonymous disabled and enabled windows authentication even i tried with Impersonation but no luck.
if all works fine finally i have to make it as a WCF service.
Please helpe me on this issue..
Regards
Rajeev G
|
|
|
|
|
It appears that the print button does not show in a report viewer with the processing mode set to local. How would I process the report viewer to either print or to open a new window with the contents in a printable page? Would it be ReportViewer1.Render? I am learning this new control and am not familiar with that method or if that would even work.
Thanks
Revolutionary: Disk drives go round and round.
|
|
|
|
|
I can answer you regardin the render method ... you probably meant the ReportViewer.LocalReport.Render method ... well its the main method in the ReportViewer Control ... this method uses the report definition (which is an xml format stored in rdlc file referring to the report) to render the report defintion with its data to the ASP.NET page ... the LocalReport will have the definition and its integrated with the stored procedure or the datasource ... then using some parameters to the render method you get an array of bytes which is the output you want ...
Take a look at the code below:
string format="PDF";
Warning[] warnings;
string[] streamIDs;
string mimeType;
string encoding;
string extension;
string deviceInfo = "<deviceinfo><simplepageheaders></simplepageheaders></deviceinfo>";
byte[] buffer = viewer.LocalReport.Render(format, deviceInfo, out mimeType, out encoding, out extension, out streamIDs, out warnings);
this.Response.Clear();
this.Response.AddHeader("Content-Type", mimeType);
this.Response.AddHeader("Content-Disposition", "attachment; filename=" + reportName + "." + extension);
this.Response.BinaryWrite(buffer);
this.Response.End();
The above code will render the specified local report as PDF and return the result as an array of bytes ... then you write this array of bytes to back to the response as a dialog of Open or Save ...
I needed this trick in a project and it worked fine with me ... I could render the report to PDF Excel or whatever I can to be as the user can just download easly.
Hope this could help ...
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
I will definitely give it a shot. Thank you!
Revolutionary: Disk drives go round and round.
|
|
|
|
|
Ok, here is what I really what to do. How to I hide the DistributorID when loaded but display it when the excel file is exported.
You might be thinking why don't I delete it form the page_load then, well I can't do that cause then my cells will not match up to the database
to the LinkButton1_Click event
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class manager_view_distributors : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AlternaDB.MarketingDataContext db = new AlternaDB.MarketingDataContext();
var products = from p in db.Distributors
select new { p.DistributorID, Company_Name = p.CompanyName, Address = p.AddressLine1, p.City, Zip_Code = p.ZipCode, p.State, First_Name = p.Contact1FirstName, Last_Name = p.Contact1LastName, Area_Code = p.Contact1WorkAreaCode, Phone = p.Contact1WorkNumber, Num_Stores = p.NumStores, Num_DSC = p.NumDsc };
GridView1.DataSource = products;
GridView1.DataBind();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.PageSize = Int32.Parse(DropDownList1.SelectedValue); this.GetData();
}
private void GetData()
{
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
this.GetData();
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (this.rdoBtnListExportOptions.SelectedIndex == 1)
{
// the user wants all rows exported, turn off paging
// and rebing the grid before sending it to the export
// utility
ExportExcelColumns();
this.GridView1.PageSize = 1000000;
GridView1.DataBind();
}
else if (this.rdoBtnListExportOptions.SelectedIndex == 2)
{
// the user wants just the first 100,
// adjust the PageSize and rebind
ExportExcelColumns();
this.GridView1.PageSize = 100;
GridView1.DataBind();
}
//Current Page export
else if (this.rdoBtnListExportOptions.SelectedIndex == 0)
{
ExportExcelColumns();
GridView1.DataBind();
}
GridViewExportUtil.Export("Customers.xls", this.GridView1);
}
private void ExportExcelColumns()
{
// pass the grid that for exporting ...
AlternaDB.MarketingDataContext db = new AlternaDB.MarketingDataContext();
var dist = from d in db.Distributors
select new
{
d.DistributorID,
AccountType = SalonForm.DistAccountType.GetDistAccountTypeByValue((int)d.AccountType),
AccountStatus = SalonForm.AccountStatus.GetAccountStatusByValue((int)d.AccountStatus),
d.CompanyName,
d.AddressLine1,
d.AddressLine2,
d.City,
d.State,
d.Country,
d.ZipCode,
d.Territory,
d.NumDsc,
d.NumStores,
d.Website,
Contact1Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact1Type),
d.Contact1FirstName,
d.Contact1LastName,
d.Contact1Email,
d.Contact1WorkIntlPrefix,
d.Contact1WorkAreaCode,
d.Contact1WorkNumber,
d.Contact1WorkExtension,
d.Contact1CellIntlPrefix,
d.Contact1CellAreaCode,
d.Contact1CellNumber,
d.Contact1CellExtension,
d.Contact1ReceiveEnews,
Contact2Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact2Type),
d.Contact2FirstName,
d.Contact2LastName,
d.Contact2Email,
d.Contact2WorkIntlPrefix,
d.Contact2WorkAreaCode,
d.Contact2WorkNumber,
d.Contact2WorkExtension,
d.Contact2CellIntlPrefix,
d.Contact2CellAreaCode,
d.Contact2CellNumber,
d.Contact2CellExtension,
d.Contact2ReceiveEnews,
Contact3Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact3Type),
d.Contact3FirstName,
d.Contact3LastName,
d.Contact3Email,
d.Contact3WorkIntlPrefix,
d.Contact3WorkAreaCode,
d.Contact3WorkNumber,
d.Contact3WorkExtension,
d.Contact3CellIntlPrefix,
d.Contact3CellAreaCode,
d.Contact3CellNumber,
d.Contact3CellExtension,
d.Contact3ReceiveEnews,
Contact4Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact4Type),
d.Contact4Firstname,
d.Contact4LastName,
d.Contact4Email,
d.Contact4WorkIntlPrefix,
d.Contact4WorkIntlAreaCode,
d.Contact4WorkNumber,
d.Contact4WorkExtension,
d.Contact4CellIntlPrefix,
d.Contact4CellAreaCode,
d.Contact4CellNumber,
d.Contact4CellExtension,
d.Contact4ReceiveEnews,
Contact5Type = SalonForm.DistCustomerType.GetDistCustomerTypeByValue((int?)d.Contact5Type),
d.Contact5FirstName,
d.Contact5LastName,
d.Contact5Email,
d.Contact5WorkIntlPrefix,
d.Contact5WorkAreaCode,
d.Contact5WorkNumber,
d.Contact5WorkExtension,
d.Contact5CellIntlPrefix,
d.Contact5CellAreaCode,
d.Contact5CellNumber,
d.Contact5CellExtenstion,
d.Contact5ReceiveEnews,
d.DateCreated,
d.Username,
d.Password
};
GridView1.DataSource = dist;
}
protected void BrowseDistGrid_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void rdoBtnListExportOptions_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void LinkButton1_Click1(object sender, EventArgs e)
{
GridViewRow gvr = (GridViewRow)((LinkButton)sender).Parent.Parent; //get that selected row
//string AccountType = gvr.Cells[16].Text;
string CompanyName = gvr.Cells[2].Text;
string Address1 = gvr.Cells[3].Text;
Response.Redirect("Distributor.aspx?CompanyName=" + CompanyName
+ "&Address1=" + Address1
); //redirect to next page with selected values
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header | e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Controls[1].Visible = false;
}
}
}
|
|
|
|
|
Hi there...
I have couple of comments on your question:
First of all ... Haven't you notice that you have posted a newspaper here !!! This is not a good thing ... how many members do you think will read or read your post?! None !! because no one will have the time to read all this to figure out the problem you are posting and find a solution for you !!
Second of all ... When posting code in your question put it in code tags .. its easier for the readers to distinguish the question body from the code in the post.
We could help if you post a problem ... not a project to be rewritten all over again or something like that ... try to rewrite your problem so others could try to help you out.
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
Screw off no one what's to hear your compliants, get a life.
|
|
|
|
|
We're using ASP.NET 2.0 FormView control wrapped by a web user control to handle CRUD UI operations. It works well except for confirmation PRIOR to insert or update. All the links I find on "confirmation" are the response.redirect type after the insert has been made to database. I need to display the data to user one last time prior to insert.
Formview does not appear to have a mechanism for displaying a readonly template of insert/update data PRIOR to insert/update.
Tried Me.fvAccountCC.ChangeMode(FormViewMode.ReadOnly) but user input from viewstate doesn't appear in this mode
Any ideas before I start messy marshalling of user input to duplicate controls in <EmptyDataTemplate> using .FindControl across two instances of usercontrol/formview
ie.
Public Sub SetConfirmTemplate(ByVal Src As ctlAccountCC)
Me.fvAccountCC.DataSourceID = Nothing
CType(Me.fvAccountCC.FindControl("lblAccountName"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
CType(Me.fvAccountCC.FindControl("lblAccountNo"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
CType(Me.fvAccountCC.FindControl("imgCardType"), Image).ImageUrl = CType(Src.FormView.FindControl("imgCardType"), Image).ImageUrl
etc...
Thanks.
|
|
|
|
|