Access :: Using A Subquery Value As Default In QueryStringParameter?
Jun 29, 2010
Using this call;
<asp:AccessDataSource id="AccessDataSource2" runat="server" DataFile="_database/92592_Web.mdb" SelectCommand="SELECT *, (SELECT MAX(ID) as Max_ID
FROM myMovies) FROM [myMovies] WHERE ([ID] = ?)">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="ID" Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
How can I use "Max_ID" as my DefaultValue? So that basically if the page gets passed without a parameter, the SQL will use the Max(ID) as a default. Can I use Max_ID as a DefaultValue?
I'm an old .asp developer still on the learning curve of .NET so some of this stuff is a little daunting. In .asp doing something like this was pretty easy...
View 4 Replies
Similar Messages:
Feb 16, 2011
im doing an update in web page by pressing a button. At the start some of the update was from a trigger, but i decided to put the hole update statement in the web page as an updatecommand in VB. this is the error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.The statement has been terminated.and this is the code.
[Code]....
the error is in the updatecommand. And i dont know what is it.
View 1 Replies
Feb 2, 2010
I am wondering there is no one asking this question on the internet even I have used google. (May be I am using a strange way on this case)
Here is the insert statement with select statement
Insert into a_table (ref, user, pw) values ((Select max(ref)+1 from reference_table), txtUser.text, txtPw.text);
Ignore the sql injection first, this statement is incorrect. Any idea? thx.
View 6 Replies
Jan 19, 2011
I am trying to secure very mixed content that is located in an ASP.NET directory. For purposes of this question, it can be ~/MyApp/.
I want all of the content in the directory and its subdirectories restricted to authenticated users. The default.aspx page, though, should be accessible to everyone. This is the web.config in that directory:
[Code]....
Now if you are an unauthenticated user, everything works fine if you request [code]....
The problem occurs in that visitors do not always request "Default.aspx". We have a default document configured so that they get Default.aspx even if they just request "/MyApp". An authenticated user works fine, but an unauthenticated user is directed to the login page.
Now I know that essentially this happens because even though the request for "/MyApp/" will actually end up serving up "/MyApp/Default.aspx", the security system is only checking for "/MyApp/" since that is what I requested. That is then getting the default security for the directory.
How can you configure an exception to allow access when no particular file is requested in the directory??
Is there some dependency between DefaultDocumentModule and UrlAuthorizationModule? In this environment, the UrlAuthorizationModule has been removed and re-added in order to make sure it fires for non-managed requests. I would not expect that to change the order of execution, though, since UrlAuthorizationModule usually goes after DefaultDocument.
A workaround could be to set up the opposite security with the directory being open, and then trying to secure individual files. Because of the (changing) number of files, and extensions, etc, and the fact that you cannot use wildcards in a <location>, this is not really a workable solution for me.
View 1 Replies
Oct 20, 2010
[Code]....
Let's say the current webpage name is ABC.aspx and I want to make two different webpages based on this page; ABC.aspx?Mode="A" and ABC.aspx?Mode="B" (By using querystringparameter). When the user opens ABC.aspx?Mode="A" page, I want to show below gridview but when the user opens ABC.aspx?Mode="B" page, I want to show below gridview except "Gender" column.
View 7 Replies
Mar 17, 2010
How to encode a datetime in a QueryString and read it in the asp:QueryStringParameter
out: (it's a asp:HyperLink NavigateUrl )
String.Format("~/Reports/Logs/Option_History.aspx?OptionID={0}&time={1}", id, time)
in:
<asp:QueryStringParameter Name="time" QueryStringField="Time" Type="DateTime" ConvertEmptyStringToNull="true" />
View 1 Replies
Jan 28, 2011
[Code]....
My question is: how can i create my own parameter based upon the QueryStringParameter?
Example:
[Code]....
I now called it QueryStringGuidParameter.
The purpose of this is: I'm not sending any querystring's via the aspx?querystring other thasn aspx?guid={guid identifier}.I hope my code below explains it al little bit.
[Code]....
A soon as a page Redirects f.i. with this example
[Code]....
Instead of calling Response.Redirect i call the Redirect i created. This transforms the querystring in a session with a guid and parameter. The Redirect only sends the guid in the querystring. and the receiving page picks up the guid and translates it back into a querystring.
Purpose is you have a secure way of dealing with info sending via querystrings. Lets say in the past you could easily get other info from the page by just changing a value in the key send via a querystring. In my case lets say the user request a Customer "A" with querystring ?ID=1.
Simple change the query in the addressbar to ?ID=2 (or something else) would give him another customer. Maybe a customer he is not allowed to see. (Of course this can be prevented also in the business layer, but that's not the point.)
So if i simply could create a new QueryStringParameter lets say called QueryStringGuidParameter which i can use in the ObjectDataSource but ideally just for all controllers which are able to use the QueryStringParameter , i don't have to go into code behind and set the SelectParameters in there.
View 4 Replies
Jun 9, 2010
Im just wondering if the default access rights of IIS in the PC where it is running is administrator? and by default does IIS has access to computer resources e.g. Printer, Finger Print Scanner, Smartcard reader installed in the same computer where the IIS is running.
View 1 Replies
Jul 6, 2010
How do I access the default SqlProvider in a DAL? I've only ever done this before from webforms.
View 1 Replies
Mar 12, 2010
In my default.aspx there's a label, then I am using an iframe which src="page1.aspx". When I click on the page1.aspx, I want the label text to change according to some click events on the page1.
View 12 Replies
Aug 17, 2010
What is the default access modifier of a class?
View 5 Replies
Jan 19, 2010
How to set defautl value in OleDbCommand Parameters?
In SQL, I can used New SqlTypes.SqlInt64, but in Access, I can't used New OleDbType.BigInt.
[Code]....
View 1 Replies
Sep 24, 2010
protected void ButtonSheel_Click(object sender, EventArgs e)
View 1 Replies
Oct 19, 2010
if I can save the querystringparameter to session state, I want to use the parameter in code behind. Or is there a better way to do it?
View 2 Replies
Sep 13, 2010
I have a problem regarding this code:
select NotificationID, (select u.UserName from aspnet_Users u, notifications n where u.UserId = n.FromID) as 'UserName', [Message], DateCreated, TypeID from Notifications n, aspnet_Users u
View 2 Replies
Aug 29, 2010
[Code]....
I always received an error of: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
View 1 Replies
Sep 1, 2010
I have some ajax fucntions on my default.aspx that I use for saving data to my db. I have the form on my web control. When I try calling the function from my button which resides on the web control. I get an error.
I need to call that function from my registerform.ascx. How do I do that from within the registerform code behind?
function ShowAvailability() {
$.ajax({
type: "POST",
url: "Default.aspx/CheckEmail",
data: '{usermail: "' + $("#<%=subs_email.ClientID%>")[0].value + '" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function(response) {
alert(response);
}
});
View 2 Replies
Jan 24, 2011
I have been utilising a SELECT query such as the following:
SELECT SRFILE.SR_GROUP, SRFILE.SROWNERSHIP, SRFILE.SRCONMAE, BSFLBWF_1.Incidentx,
BSFLBWF_1.Severityx, BSFLBWF_1.Openx, BSFLBWF_1.Closex, BSFLBWF_1.Closurex, BSFLBWF_1.Customerx, BSFLBWF_1.Availabilityx, BSFLBWF_1.KPIx,
CONVERT(Decimal, BSFLBWF_1.Minsx) AS Expr1, BSFLBWF_1.Unusedx, BSFLBWF_1.FirstIntx, BSFLBWF_1.RepeatIntx, BSFLBWF_1.Corex,
BSFLBWF_1.OffPeakx, BSFLBWF_1.NonCorex, BSFLBWF_1.DedTypex, CONVERT(money, BSFLBWF_1.SchoolChargex) AS Expr2, CONVERT(money,
BSFLBWF_1.LANMLEChargex) AS Expr3, BSFLBWF_1.KPIFailx, BSFLBWF_1.Overridex, BSFLBWF_1.Reasonx, BSFLBWF_1.Contactx,
SRFILE.SR_CLOCK, SRFILE.SR_BACK_REASON, CONVERT(int, BSFLBWF_1.Minsx) / CONVERT(decimal, BSFLBWF_1.FirstIntx)
* 100 AS PERCENTAGE
FROM support.SRFILE INNER JOIN
BSFLBWF AS BSFLBWF_1 ON BSFLBWF_1.Incidentx = SRFILE.SRONUMBER
WHERE (BSFLBWF_1.Closex IS NULL) AND (BSFLBWF_1.DedTypex = 'School' OR
BSFLBWF_1.DedTypex = 'LAN-MLE')
UNION ALL
The rest of the query continues as the above albeit selecting the same data from different tables and works fine.
The issue I have is that I want to Select some more data (another SELECT query) but with a different Where clause e.g. WHERE (BSFLBWF_1.KPIx NOT LIKE 'KPI%' OR
BSFLBWF_1.KPIx NOT LIKE 'Proactive%') AND (BSFLBWF_1.Availabilityx LIKE '')
The problem is that this WHERE clause returns data which the above in bold has null values for (and thus doesnt work). Im still selecting the same data its just the WHERE Clause has changed. Is it possible to run such a query? If so, can it be done via a sub query?
View 10 Replies
May 5, 2010
have 2 tables in SQL 2000 developer edition identicals, Prereception and eceptions, on the table Recepcions I have the following trigger:
CREATE TRIGGER [AumentaInventario] ON dbo.Recepcion
FOR INSERT
AS
declare @Codigo nvarchar (50)
,@Cantidad int
[code]...
View 2 Replies
May 20, 2010
I have a tables with data like this
Id BookId TagId
34 113421 9
35 113421 10
36 113421 11
37 113421 1
38 113422 9
39 113422 1
40 113422 12
I need to write a query (SQL Server) which gives me data according to the tags say if I want bookIds where
tagid =9 it should return bookid 113421 and 113422 as it exists in both the books, but If I ask data for tags 9 and 10 it should return only book 113421 as that is the only book where both the tags are present.
View 3 Replies
Mar 24, 2011
SQL query:
I have a hierarchy structure like:
B reports to A
C reports to A
D reports to A
E reports to B
F reports to B
and so on......
So, when A logins he should be able to see B,C,D(who are reporting to A) and also E,F(who are actually reporting to B and not directly to A)Please help to write such sql query.
View 5 Replies
Feb 16, 2011
im working on visual Studio 2010, and i have an error on an update.
this is the code in VB.
[Code]....
Thats the code and the error is:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.`
View 4 Replies
Jul 20, 2010
While developing and ASP.NET application in C# or VB using Visual Studio 2005/2008/2010 (Not a problem in 2003), if I create a new method automatically by double-clicking on a control in the designer or picking the new method in the code editor dropdowns (VB only), the access modifier is always protected instead of private. This is annoying because my developers have to manually change the method to private every time.
View 2 Replies
Aug 15, 2010
I use "ProductList" fuction to list All products.
Public Function ProductList() As System.Linq.IQueryable(Of Northwind.Products)
Now I want 2 Subquery from of above results . I want to save ProductList to DataTable or ... so that I only Connect to DB One and then Use Below subqueries from Sub1: Takes 1 record from "ProductList" results.Sub1: Skip 1 record and take 10 records from "ProductList" results.
View 4 Replies
Feb 15, 2011
query in SQL Server Express, which worked fine, now I am trying to do it in WebMatrix using a Compact 4.0 db but it gives me an error.
SELECT *, (SELECT
count(1)
FROM Posts
WHERE CategoryI
[code]...
View 7 Replies