ADO.NET :: Direct Qurry Or Lamda With Extension ?

Mar 13, 2011

IEnumerable<Product> selectedProducts = (from p in products where p.Category == 1select p);
selectedProducts = products.Where(p=>p.Category==1) ;

The above 2 statements seems to produce same result .TheN what is the diffrence? which one is efficicent more?

View 1 Replies


Similar Messages:

How To Test A Lamda Expression Variabe Query Result Is Null?.

Mar 13, 2011

var query = from emp in dbEmp.Employees join dept in dbEmp.Departments on emp.DeptID equals dept.DeptID where dept.DepartmentName.Contains(this.TextBox1.Text) select new { EmpID = emp.EmpID, EmpName = emp.EmpName, Age = emp.Age, Address = emp.Address, DeptName
= dept.DepartmentName };

if (query==null) Label1.Text = "no results match your search";

GridView1.DataSource = query; GridView1.DataBind();

Everything works in the right way, but the label doesn't show the message when query result returns null. The label can show without condition(querry==null). So how to test if a var query result returns nothing?

View 2 Replies

MVC :: Cannot Get Way To Direct Controller Url?

Mar 21, 2011

I cant get to directcontroller url (I have change the routing so it will fit into my paging system but I cant fit it also to get the controller url without action (I can gethttp://localhost:51443/home/inde )but I would like to get also "clean" url like http://localhost:51443/home

[Code]...

View 6 Replies

Rendering XMl/XSLT Direct From The Web?

Apr 13, 2010

Im using the ASP.NET Xml control and want to pass it a url to a rss feed and a stylesheet - so that i can style the rss myself on my website. When applying the full web path to the xml control [URL] i get an exception telling me that the document source is not a valid virtual path. What am i doing wrong? I would hate to download the file before showing it...

View 1 Replies

Protect Some Pages From Direct Access?

May 24, 2010

I have a ASP.NET page called admin.aspx that needs to be protected from direct access.

I want it to be accessed only when the user enter his name & password in another page called login.aspx I'm working in ASP.NET with Visual Basic .NET 2008,how to do it.

View 4 Replies

How To Prevent Direct Linking To A Few Pdf Files

Sep 22, 2010

I'm working on a website where I need to prevent the direct linking to a few pdf files. I'm using ASP.net 2.0. Is there an easy way in code to do this? or some simple IIS setting?

Right now i'm just using a standard anchor tag to link to the files. i can validate the user on the page containing the anchor tag but that still doesn't stop the user from nabbing the url and passing it on to someone else.

View 4 Replies

How To Stop Direct Urls Being Typed In 2.0

Jun 14, 2010

I have a website that has a members section. To view a members profile I pass the username across the query string, but I want to stop direct access by someone changing the url to a different username.

Do I need to encrypt the query string or is there a better way to acheive this ?

View 3 Replies

Security :: Denying Direct URL Access?

Jun 28, 2010

I need to restrict access to pages based on permission given to roles based user .Roles created dynamically so that i can't restrict thru the WEB config file .i am using the custom sitemap so menu is showns correctly based on roles , but if we enter direct url in address bar we can access that page although its not permitted for the user .is there any other way to redirect to common access restrict page .

View 3 Replies

Denying Direct Access To A Webpage?

Mar 11, 2010

I have a webpage errors.aspx that needs to be protected from direct access. I want it to be accessed only when redirected to by another web page.

View 3 Replies

Security :: Re-direct Particular Page After Login?

Sep 28, 2010

how to redirect to particular page after login. I have login,EDetails,home page..

1.If the user login very first time(suppose he does not have any personal details) he should be directed to EDetails.aspx

2.User who submitted the personal details already should be redirected home.aspx page.

I have 2 tables later i will add more,1.login table,2.employee detailed table.I am using Login control for login page

I am using Version ASP.Net3.5 with MySql database, Code where i am redirecting in login page

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
If YourValidationFunction(Login1.UserName, Login1.Password) Then
Login1.Visible = False
Session("UserName") = Login1.UserName
Response.Redirect("EDetails.aspx", True)
Else
e.Authenticated = False
End If
End Sub

View 5 Replies

C# - Event Triggering Without A Direct Connection?

Feb 2, 2011

In my ASP.NET app I have a control in the master page that raises an event Foo on certain occasions / interactions.I also have a couple of pages that have another control that must re-bind itself when this event is fired.Unfortunately the only way I can see them communicating between each other is by creating a long event chain (deriving a new MasterPage MasterPageSuperDuper, attaching an event handler to Foo's event in the user control, and then referring to this event in the masterpage from the control present in a couple of pages - basically using the masterpage as a control center).

View 2 Replies

Web Forms :: Layout A Web-application Without The Direct Use Of HTML And Css?

Jul 7, 2010

Are there possibilities to layout an ASP.NET web-application without directly using CSS and HTML ? I am mainly coming from the desktop-development world and I am in the first place familiar with the usage of layout- and container-controls like panels, tables, and so on.

View 2 Replies

Direct SQL Execution To Get Count Using Enterprise Library

Mar 16, 2011

I am new to asp.net development and using enterprise library in my application in the following way.

Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand("sp_MakePayment");
db.AddInParameter(cmd, "@BillGenID", System.Data.DbType.Int32);
db.SetParameterValue(cmd, "@BillGenID", billgenID);
db.AddInParameter(cmd, "@PayDate", System.Data.DbType.String, 50);
db.SetParameterValue(cmd, "@PayDate", mypaydate.Text);
db.AddInParameter(cmd, "@TransNo", System.Data.DbType.String, 50);
db.SetParameterValue(cmd, "@TransNo", transno.Text);
db.AddInParameter(cmd, "@AmtToPay", System.Data.DbType.Double);
db.SetParameterValue(cmd, "@AmtToPay", Convert.ToDouble(paidamount.Text));
////Execute Stored Procedure
int i = 0;
i = db.ExecuteNonQuery(cmd);

Now I am in a situation where i need to run this inlnie query using the same method to get the count of records and read in a variable. for example following query to find existing bill.

string bill_id = "1234";
string dofpayment = "11/03/2011";
mysql = "Select count(*) from payments where bill_id = " + bill_id + " and payment_date = " + dofpayment ;

Now how to incorporate the above lines using the enterprise library block.

View 2 Replies

Security :: How To Direct User When Login By Roles

Jan 27, 2011

How to Direct Users to specific Page By roles?

View 10 Replies

Crystal Reports :: Direct Printing Without Converting Into PDF?

Apr 3, 2010

I am using asp.net 2.0 and crystal. When I click on print button on tollbar of crystal report. Report is converted to pdf but I don't want to view this report in pdf it must ask for the printer and directly print the report, rather than opening report in pdf and printing.

View 2 Replies

Web Forms :: How To Prevent The Direct Call Of URL In IIS Environment

Aug 2, 2010

How can I achieve in an ASP.NET application, that a set of URLs/ASPX pages (parts of the application) cannot be called directly from the user in the Browser? These urls/pages may only be referenced in the application itself.

View 2 Replies

Databases :: Direct Download From BLOB Column?

Nov 12, 2010

i need to download a file directly from a table's BLOB column .

i used this procedure, but i got the error:

SQL> exec download_blob;
begin download_blob; end;
ORA-06550: line 2, column 7:
PLS-00905: object IFRSCD.DOWNLOAD_BLOB is invalid
ORA-06550: line 2, column 7:
PL/SQL: Statement ignored

The code is:

[Code]....

View 2 Replies

Security :: Deny Pages From Direct Access?

Dec 28, 2010

I have certain pages in my application that are designed to be accessed only by redirect from other pages, and not directly(i.e they must get a query string from other page, otherwise there is an exception).

So I want to prevent users from accessing them by typing the URL, but I want them to be available by redirect.

View 1 Replies

Security :: Restrict Pages Direct URL Access?

Mar 17, 2010

I have a security issue in my web application where user can enter malicious data/can change the page path directory. To avoid these i want to restrict the user by accessing/typing in the URL.

View 5 Replies

Security :: Disallow Direct Access To Files?

Aug 19, 2010

Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

View 2 Replies

Web Forms :: Force Direct To Entry Page?

Jun 17, 2010

I'm not sure if this is the best category for this one... Might be more appropriate in the navigation section.I am curious as to the standard for redirecting users to a entry page on first accessing a website. In my case, I am working on an adults only website that requires a warning for users that the content is only appropriate for users over 18yo, as well as containing the scripts to activate several different monitor systems to prevent children from accessing the site.

I know I can use session_start to redirect and check for a cookie... but that seems heavy. Is there a better way? Something in IIS or... something I have not thought of yet?

View 5 Replies

Security :: Show Image With Direct Path?

Nov 22, 2010

I am trying to put SSL on my website.

My problem is that my site dynamically loads different images and CSS from other URL's. These URL's are also hosted on my dedicated server.

To avoid the popup on the sicure site (ssl) that there are some not sicure elements on the page, I would like to make a direct path to the images (d:inetpubanothersite.comwwwrootimagesmyimage.jpg) instead of <img src = "http://www.anothersite.com"

View 2 Replies

Web Forms :: Hyperlink To Direct User To Certain Page At Time Of Day?

Apr 9, 2010

Got this question, probably simple to most people but I only just started using visual studio 2008 with c#

Create a 'contact us' web page (form) for your photocopier repair company that links dynamically depending on the current time. The linked pages should give details of support engineer contacts for different regions, during normal working hours and when the offices are closed.

You should use the HyperLink control to link to different pages (depending on the time of day.) At or after 5:00 p.m., the HyperLink control links to a page named AfterHoursHelp.aspx and before 5:00 p.m., it links to OfficeHoursHelp.aspx.

View 2 Replies

Web Forms :: Direct Visual Editing Of A Template Into Usercontrol?

Aug 2, 2010

How would I do visual editing of a template for a control X that is embedded within a user control?.
Of course, in this case the Control X is not directly available to the end user.

NOTE: I do not want to create another user control to the template.

View 1 Replies

To Get Direct File Access To Files Within The Web Directories From .NET Application?

Jan 10, 2011

My ASP.NET application logs transactions (both inside AND outside of databases), and therefore needs read/write access to text files within various directories within the root of the website - in ADDITION to the normal database access.

In this scenario, how can I safely allow my ASP.NET application to write data to the web folders? I have a thread-safe DLL that performs the actual work, so I don't believe I need to worry about multiple sessions writing to the log files at the exact same time - assuming my DLL will only be running in a single instance/process that will be shared between numerous ASP.NET instances/processes/threads.

But I'm more concerned about file access permissions. I've heard that ASP.NET applications generally aren't allowed access to the webserver's local file system, and that this may even restrict my DLL from getting the correct file access. Can I grant my application file-access to the web-driectories?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved