.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links


Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net


My stored procedure has the following structure:

CREATE procedure [dbo].[Get_User]
@Username varchar(20),
@menurole varchar(20) output
DECLARE @roleID int,@rolename varchar(20),@UserID int
Begin try
	Begin Tran
	SELECT @USERID=UserID FROM Users WHERE Username=@Username


	SELECT @rolename=RoleName FROM Roles WHERE Roleid=@roleID

	if (@rolename = 'Admin')
			select @menurole='MenuAdmin'

	else if(@rolename='Accountant')
			select @menurole='MenuAccountant';

	 else if (@rolename='Doctor')
			select @menurole='MenuDoctor';
	else if (@rolename='Secretary')
			select @menurole='MenuSecretary';

end try
Begin catch
	if @@error>0
declare @ErrMsg varchar(4000),
		@ErrSeverity int
Select @ErrMsg=Error_Message(),

Raiserror(@ErrMsg ,@ErrSeverity,1)

end catch

I am trying to call it from the server side code as following(using VB.NET):
  Dim connectionString As String = "Data Source=;Initial Catalog=SecurityCapstone;Persist Security Info=True;User ID=sa;Pa

View Complete Post

More Related Resource Links

sp_OACreate 'Scripting.FileSystemObject' troubles

We use calls from within SQL 2008 SP's to a wrapper SP around the FSO to generate external text documents like so:  ALTER PROCEDURE [dbo].[CNVAppendDocument] @FileName varchar(255), @Text1 varchar(max) AS DECLARE @FS int, @OLEResult int, @FileID int EXECUTE @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT --IF @OLEResult <> 0 PRINT 'Scripting.FileSystemObject' --Open a file execute @OLEResult = sp_OAMethod @FS, 'OpenTextFile', @FileID OUT, @FileName, 8, 1 --IF @OLEResult <> 0 PRINT 'OpenTextFile' --Write Text1 execute @OLEResult = sp_OAMethod @FileID, 'WriteLine', Null, @Text1 --IF @OLEResult <> 0 PRINT 'WriteLine' EXECUTE @OLEResult = sp_OADestroy @FileID EXECUTE @OLEResult = sp_OADestroy @FS Since we deal with large numbers of created files we at one point added a counter to alter our file path going in to create a new subfolder every 15000 files. This worked fine until a recent customer required so many files that we exceeded 254 subfolders and every file in subfolder 255 on up are created but nothing is written to them. I added print lines like: execute @OLEResult = sp_OAMethod @FS, 'OpenTextFile', @FileID OUT, @FileName, 8, 1 --IF @OLEResult <> 0 begin --print CAST(@int as varchar) PRINT 'OpenTextFile' print @FS print @FileID print @FileName print @OLEResult print '' --

jQuery 1.2.6 Ajax: troubles in FireFox and Opera

Hi everybody! Today I downloaded jQuery and begin learning it. I wrote a simple ajax request that normal working in IE:<script type="text/javascript">$.ajax({url: 'http://mysite/link.axd',type: 'GET',timeout: 3000,error: function(){alert('Error loading document');},success: function(xml){//alert(xml); //for test$("div#divMess").html(xml);}});</script>But when I was testing it in FF and Opera I has found next troubles:FF doesn't send request to my handler (FF generally nothing do),Opera throws error event and also and FF doesn't send request to my handler. What should I do that the code will work in all browsers?

linqdatasource.where property troubles

hello,Operator '=' incompatible with operand types 'String' and 'Int32'linqdatasource1.where = "myFieldname = " + AlistBox.SelectedValue;AGridView.DatasourceID = linqdatasource1;AGridView.Databind();above was just freeform ad hoc example... not typed in visual studio so ignore issues like case sensitivity. I get this error from code like that.. why? I'm finding my first experience with linq very negative. I realize I don't know what I'm doing yet, but I'm getting very discouraged... I just need to build a pretty simple search page. My aspx markup contains the linqdatasource with everything setup except the 'where' property, which obviously I need to control at runtime based on user input on the search page. I do have a way of making my page work using the linqdatasource's 'selecting' event but I just don't like that, it seems so out of the way for what should be so simple and straight forward. Change where condition, databind, change where condition, databind, change where condition, databind.. why is it not that simple?edit:ldsMain.Where = "JobNID = " + "\"" + lstJobNumbers.SelectedValue + "\"";             GridViewInventory.DataSourceID = "ldsMain";             GridViewInventory.DataBi

Browser specific troubles


I have an ASP.NET 3.5 application written in VB.NET that works just fine when viewed from my developmental box on IE8, but when I browse to the site using Firefox or Safari it doesn't work so well.

How do I handle this problem?  What is this problem called?  Please advise.  Thanks.

Troubles with WSS in Win /



When we use wss 3.0, IE 8 and Win 7 combination, several archives are opened from WSS web site and they require autentication although the user is logged. If the autentication is omitted then the archive open without troubles. We are sure that the problem isn't permission level in WSS. This event only happen in Win 7 Operating System.

Why is this autentication requested?

Best regards.

Backup Exec 2010 -MOSS 07 GRT Restore troubles

I was just curious if anyone else had trouble restoring documents from Backup Exec 2010 SP1 ?  I'm at a client and whenever they try to restore a document library to their portal, only the folder is restored and none of the contents. Re-directed restores to file shares work fine.  Symantec support says to upgrade to R2 to fix it, but that this is not a 'known issue'.  Funny, because they didn't troubleshoot long and had a quick fix ready to manually re-link the document to the site!!  Seems a little shady. I'm just wondering if this client has a unique issue or if anyone else out there has experienced this problem as well?  I'd like to warn our other clients with the MOSS 2007/ BUE 2010 combo if this is common. 

dropdown wtih popup


I Load the database in droplist uisng asp.net.my need is while selecting the data from dropdownlist i need popup window to show some issue.this thing i need nin selected index change events

Communication using TCP Endpoint IP troubles help


I want to create a service library and a self hosting console app.

I want to deploy the app in my house with my computer with ip 71.57. XXX.XX but my router gives me 192.168.X.XXX. This is my app.config in my service library.


<?xml version="1.0" encoding="utf-8" ?>
 <compilation debug="true" />

  <binding name="TCPBinding">
   <security mode="None"/>

  <binding name="PipeBinding">
   <security mode="None"/>

  <service behaviorConfiguration="VTService.Service1Behavior"
  <clear />
  <endpoint address="ws" binding="wsHttpBinding" name="WsEndpoint"
   contract="VTService.IEvalService" listenUriMode="Explicit">
   <dns value="192.168.XX.XXX" />
   <certificateReference storeName="My" storeLocation="L

Sharepoint - having troubles uploading website pages - please help

I am doing a project at school to create a website. We are doing this in Sharepoint design so I e-mailed my incomplete website to myself from school in order to acess it from home.  However, the attachments in the e-mail I sent did not have background pictures or text when I uploaded them to Sharepoint design on my home computer.  Can anyone tell me how I can get the pages to upload correctly?  It would be great to get some help quickly as I need to finish my project this week.

Sharepoint 2007 list troubles: IP fields and sort by IP


Help! I've created text fields that have IP's but they do not get sorted right.


I know this is correct sort for normal text. Do anybody have any clue of how I can use IP's in Sharepoint 2007 lists?

TextBoxFor rendering troubles with name attribute


I tried to change my input name atribute:

<%: Html.TextBoxFor(m => m.City.Title, new { id = "Title", name = "Title" }) %>

but browser rendered:

<input id="Title" name="City.Title" type="text" value="" />

Why does it work with id attribute, but not with name attribute?

Insert into troubles


 Good morning,

I'm sure that this is an easy problem.  In my test database I have an "Insert into" query that works, but How do I insert a value that contains  a single quote? I want to insert O'Brien.

Insert into myTable (LName, FName) Values('O'Brien', 'Pat')

does not work.  Thanks for your help.  

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend