|
Hi!
I have a gridview with TemplateField column i need to get gridview row values on rowcommand event ,to update a gridview row how?
im writing GridViewRow rf =GridView1.Rows(e.CommandArgument);
n1 = rf.Cells[0].Text ;
but it doesn't work!!
Thanks
|
|
|
|
|
Hi,
I am working on a project, in this I need to pass parameters to a stored procedure or query which is using 'in' Keyword
The query will be like this:
select VideoTitle from Item where ItemId in(select ItemId from GroupLink where GroupId in(139,76,86))
This is working fine. But when I pass the GroupId as parameters to a stored procedure to make the query dynamic as:
CREATE PROCEDURE [dbo].[Procedure]
@GroupId INT
AS
BEGIN
SET NOCOUNT ON;
select VideoTitle from Item where ItemId in(select ItemId from GroupLink where GroupId in(@GroupId))
END
if I pass the parameters like:
exec Procedure (2,3,4)
or
select VideoTitle from Item where ItemId in(select ItemId from GroupLink where GroupId in('"+IDs+"'))
string IDs=2,3,4;
I am getting a error
If anyone have any solution to solve this, please kindly help me.
|
|
|
|
|
You can do as the following...
CREATE PROCEDURE [dbo].[Procedure]
@GroupId as varchar(500) = ''
AS
BEGIN
SET NOCOUNT ON;
DECLARE @query as nvarchar(500)
set @query = 'select VideoTitle from Item where ItemId in(select ItemId from GroupLink
where GroupId in (' + @GroupId +'))'
exec SP_EXECUTESQL @query
END
Now execute the procedure as exec Procedure (2,3,4)
I used to do like the above whenever I have to retrieve the values based on a list...Don't know if it has any performance issues...
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
modified on Friday, March 13, 2009 8:28 AM
|
|
|
|
|
Hi, I am using SQL in my project. I want to fetch only time alone. I know to fetch Date. How to fetch time? Can any one tell?
|
|
|
|
|
Use DatePart function for e.g. SELECT DATEPART(hour, '2007-06-01 10:00:01') gives you the value 10. as it queried for hour.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
S. Is it possible to fetch the full time?
|
|
|
|
|
Hmmm...You must have used Google by this time any way follow the link Get Time[^]
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
See my reply to your CROSS POST, which, by the way, is a bad thing.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi Friends,
i have used aspnet authentication to logging into my site.When i click logout and i click back button,i can see the last page.How can i logout properly.I used FormsAuthentication.Signout() to logout.What is the problem of dont properly logout fro site.
|
|
|
|
|
Hi,
After clicking the logout button,the all the cookies will be cleared... and when you click on back button it shows only UI and links...
if you want you can test it by clicking any link (button/link),you will not get any user information and automatically it will redirects to your redirected page..
if not like that,you have to clear all the cookies and abonden all the session variables
S Kumar
|
|
|
|
|
How can i clear all cookies when we click on logout.
|
|
|
|
|
Hi,
'clears formsauthentication cookies
Response.Cookies.Remove(FormsAuthentication.FormsCookieName)
'clears all sessions variables of application
Session.RemoveAll()
Session.Abandon()
S Kumar
|
|
|
|
|
Hi Friend,
I Given the code but it willnot cleared the cookie and i can took all datas,it willnot ask again to login.
|
|
|
|
|
HI,
Are you redirecting from that page to some other page (generally login page) whenever page losses cookie value...?
S Kumar
|
|
|
|
|
Hi,
Actually i put a login control in masterpage enabled page and i put menu in masterpage.in the menu i put a menuitem logout and in the menu item click event i given formsauthentication.signout and the above given code.and i retdirect the page to home page where the login control, is situated.This is the flow of login and logout.After logout i checked username is null or not in another menuitem page.but i can easily access the page because the username still exists.What is the problem.
|
|
|
|
|
HI,
you can check the formsauthentication cookie information in the masterpage's page_load event.. if the cookies value is nothing simply redirect to login page
|
|
|
|
|
Hi,
you can do like this also ...just by using javascript you can disable back button (but this is not good practice)....
S Kumar
|
|
|
|
|
Not when i click the back button when i click any menu link also i can easily access the datas without logged in.
|
|
|
|
|
hi,
what are modifications that you are done?
S Kumar
|
|
|
|
|
Hi,
just check the cookie information is either available or not in master page's page load event,if values are nothing just redirect to login page...
S Kumar
|
|
|
|
|
Hi,
In your first page, paste this code in pageload
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
|
|
|
|
|
Sorry to say again it works wrongly.the user can access pages after paster the page in pageload of first page.
|
|
|
|
|
Hi Kumar Sir,
I got it sir.Actually we have to given Formsauthentication.LoginUrl then it cleanely works.
|
|
|
|
|
Thanks for your corordination sir...
|
|
|
|
|
Hi,
I want to export an image field from sql 2005 to excel. This is with vb.net.
Is there anybody who knows if this is possible? And how to do this?
T.
|
|
|
|