CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 2/13/2008 6:05:45 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 46 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
Ganesh@Nilgris
Asp.Net User
Unable to pass the string to a stored procedure2/13/2008 6:05:45 PM

0/0

I am building a sitemap and treemenu in master page based on the following article

http://msdn.microsoft.com/msdnmag/issues/06/02/WickedCode/

I modify the following stored procedure "proc_GetSiteMap" so that it accepts a string called "username"

 

Here is the problem

I have a login page which has a login control. In the login_authenticate event i want to pass the "username" to the storeprocedure so that i can load the treeview based on userrights. My problem is unable to pass the string.

Any ideas ?

 


Jai Ganesh. J , GSD ,India

Please Mark As Answer If my reply helped you.
amensi
Asp.Net User
Re: Unable to pass the string to a stored procedure2/14/2008 1:46:18 AM

0/0

Hi,

Can you post some code. I think i ran in a simillar situation before.


Alex Mensi - Check out my blog
Maven Technologies Inc.
--
Don't forget to click "Mark as Answer" on the post that helped you.
Ganesh@Nilgris
Asp.Net User
Re: Unable to pass the string to a stored procedure2/14/2008 5:02:22 AM

0/0

 

source code is available in the link.

i want to pass the "username" from the login page to the "sqlsitemapprovider.cs" class

Any ideas?

 


Jai Ganesh. J , GSD ,India

Please Mark As Answer If my reply helped you.
amensi
Asp.Net User
Re: Unable to pass the string to a stored procedure2/14/2008 5:44:39 AM

0/0

Hi,

Try this. I didn't test it though: 

MembershipUser u = Membership.GetUser(HttpContext.Current.User.Identity.Name);
                
SqlCommand command = new SqlCommand("proc_GetSiteMap", connection);
command.CommandType = CommandType.StoredProcedure;
		
command.Parameters.Add("@username", Data.SqlDbType.Varchar);            
command.Parameters("@username").Value = u.UserName;
 
Alex Mensi - Check out my blog
Maven Technologies Inc.
--
Don't forget to click "Mark as Answer" on the post that helped you.
Ganesh@Nilgris
Asp.Net User
Re: Unable to pass the string to a stored procedure2/14/2008 7:27:34 AM

0/0

 

U know that there is a function called as getsitemapfromdb in the "sqlsitemapprovider.cs" which gets the records from the database.

so if i use there MemshipUser class will i would get the UserName who has logged In?

I would be trying this code tonight only

 

 


Jai Ganesh. J , GSD ,India

Please Mark As Answer If my reply helped you.
Ganesh@Nilgris
Asp.Net User
Re: Unable to pass the string to a stored procedure2/14/2008 3:45:47 PM

0/0

 

Excellent timely Help.  If i have to use the membsership object Then i need th sql database aspnetdb.But i dont use aspnetdb.

i authenticate the users from the database so i modified the code. Here is the code by which i get the "userName

string strusername = "";
if (HttpContext.Current.Request.IsAuthenticated)
strusername =
HttpContext.Current.User.Identity.Name;

Now i Pass the strusername to the storedprocedure;

 


Jai Ganesh. J , GSD ,India

Please Mark As Answer If my reply helped you.
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP Databases Authors: John Kauffman, Kevin Spencer, Thearon Willis, Pages: 856, Published: 2003
Cisco Unity Deployment and Solutions Guide Authors: Todd Stone, Jeff Lindborg, Dustin Grant, Steve Olivier, Toby Young, Pages: 1008, Published: 2004
The Psychology of Reading: Insup Taylor, M. Martin Taylor Authors: Insup Taylor, Maurice Martin Taylor, Pages: 511, Published: 1983
Proceedings of the 1986 Acm Conference on Lisp and Functional Programming: Proceedings of the 1986 ACM Conference: Cambridge, Massachusetts, August 4-6, 1986 Authors: Association for Computing Machinery, Special Interest Group on Programming Languages, ACM Digital Library, Special Interest Group in Artificial Intelligence, Special Interest Group for Automata and Computability Theory, Pages: 0, Published: 1986
UPnP Design by Example: A Software Developer's Guide to Universal Plug and Play Authors: Michael Jeronimo, Jack Weast, Pages: 481, Published: 2003
General Surgical Operations Authors: R. M. Kirk, Pages: 903, Published: 2000

Web:
unable to pass string from proc to SSIS variable - HELP!!! in SQL ... How can I pass a string from a stored proc to the SSIS variable? ... I call a stored procedure. I assign the value ...
SQL Server reportingsvcs Re: How to pass a fixed string parameter ... You say you are wanting to pass a string parameter to a stored procedure. The report parameter should display when you do a preview and then ...
String concatenation as a procedure variable Just wondering why i'm unable to pass a couple of variables as a concatenated string to the following stored procedure. ...
How to Pass Array as Input Parameter to the DB2 stored Procedure ... I am unable to find a way as to how the parse the data in the Stored .... pass a stored procedure to FROG, itp, Tips and Techniques ...
Unable to pass null value with DropDownList parameter in Reporting ... How would I pass null to the parameter value and not an empty string? .... But at first your stored procedure doesnt have any null value, because its a ...
In hyperlink column how to pass querystring - C1 Community ... the datanavigation filed. but i am unable to pass query string .... This is setup for a stored procedure using single tick marks for ...
ADP Report Parameters to a Stored Procedure - MS Access However, I've been unable to pass the parameters at run time. ... pass parameters to a stored procedure from a report at runtime in an adp? ...
How to pass a null parameter to a stored procedure executed within ... Can I even move the xml result to a string Any help would be appreciated. Thanks , J Dubo Tag: How to pass a null parameter to a stored procedure executed ...
CodeProject: Passing a Comma Delimited Parameter to a Stored ... Pass in the string containing an XML, then parse the string with OPENXML, ... I was unable to create one without having to create a stored procedure using a ...
OraFAQ Forum: Application Server => problems with cr/lf in string ... I am unable to pass strings to a stored procedure if the string contains a carriage return/line feed character. I get the following error: ...




Search This Site:










master pages and loading themes dynamically

framework question

create fixed master page - content page with scrolling

images on menu

menu/treeview hybrid site navigation?

changing layout dynamically

pages that aren't in the sitemap

trying to initiate a pop up page.

menu control help needed

master page image url in table

when to reset the state of a masterpage multivew activeindex, if you are reloading a content page?

accessing a control in the wizard template

how to use multiview control in asp.net 2.0

convert webpage to an image?

referencing controls on nested master pages through clientside

include .js file - master page or content page ???

page last updated date

treeview : disabling clicks on node graphics

master page and content page using different language

findcontrol not working within a content page

sitemap context issue

skin choose in asp.net

can't have all three? menu with background image + text with mouseover effect + dropdown submenu??

re: using multiple sitemaps

need help with forms and master pages

how i can handle onmouseover event in treeview control.

master page does not display image on pages which are not in same root level

how set in css gridview's properties gridlines?

how to apply theme to masterpages

treeview onselectednodechanged does not execute

  Privacy | Contact Us
All Times Are GMT