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


Post New Web Links

Return a user and a set of values from the same sproc

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

I have a user table with userID, userName ...the standards.
I also have a "Material" table with materialID, materialName, etc.

I combine these in another table "UsersMaterial" with userID and materialID, depending on which materials the user has chosen (between 0 and 5).

Now I need a stored procedure that returns the user information + the set of materials that is mapped to the user.

But I can't see how I can return one row of user information combined with a set of the user materials? Do I join or can I return a set + one row?


Thanks in advance!

Niklas




View Complete Post


More Related Resource Links

Writing Webservice return values to table within SQL CLR

  
Visual Studio 2010/Sql Server 2005/ .net 3.5/ C# I have compiled and created assemblies and all works fine when all I do is .pipe.send.   I have changed it now to capture the values in local parameters so I can write to a sql table on the same server.  I have the connection to the database and the table created.  The code compiles fine but when I run it from sql I get the following error.  The code follows the error.   Msg 6522, Level 16, State 1, Procedure CventSP, Line 0 A .NET Framework error occurred during execution of user-defined routine or aggregate "CventSP": System.Data.SqlClient.SqlException: Incorrect syntax near '@eventtitle'. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at StoredP

Values in user control fields empty when AutoEventWireup=true ?

  
As a BizTalk developer I'm trying to build a ASP.NET website so some obvious things might be new to me (so please be gentle). I have a web form and I have a user control on it. This user control contains a panel with some user properties that are to be stored in a database. So far nothing fancy. The user control itself contains a panel and is working fine (all code to retrieve and store the values is working). I used the default settings of creating a user control and one of them was AutoEventWireup=true. This works fine because I also have some dropdown boxes (and other fields) that need to be filled with values from the database and that happens in the Page_load event. The panel specifies the 'DefaultButton' which calls a method when clicked to save the values after the user has changed them. On this click the code of the method is called, I confirmed that, but I found out that the values of my controls on the user control (for example the Textbox control) are empty. As a non-ASP.NET developer I couldn't figure out why. So I changed some settings like AutoEventWireup to false. Off course this resulted in my dropdown boxes no longer to be initially filled, but my surprise was big to find out my controls actually contained the values the user typed in. Logically I need both the values and th

User fills in the (different) values

  
Hello, I'm kinda new to this forum and Reporting Services. I wonder if it is possible to let the user fill in a value in a cell of a table. I'll explain some more. You have 3 columns in a report. One column shows numeric data, the second column is blank and the third column shows the sum of the first two colums. Now the user has to fill in the second column himself so that the third column gets calculated. Is this possible?    thx in advance  

return url in aspx refreshes the page when I click login after entering user name and password

  
Hello,   I need help as I am struggling to login into my web portal on my new sony vaio laptop. I think that I need to do some settings, or download some plugin. Infact I don't know what to do, as I have spent many hours trying to login, but no success. Below is my office website:   http://www.lantec-uk.net/SignIn.aspx?ReturnUrl=%2fdefault.aspx When I enter my credentials and click login, the web page gets refreshed, i.e username and password get erased, rather than taking me into my web-portal. The laptop is having windows 7 home premium, with ie8. I have also tried installing firefox, chrome, opera and safari, but same problem. Somebody please help, as sony has refused to take the laptop back and they are saying that there is problem with website. Similarly, website staff are saying that there is a problem with the laptop and not with the website.   Any help highly appreciated. 

User Specific Values for a Drop Down "Choice" Field

  
I would like to create a drop down field which has some fields disabled or not visible based on the user logged in.  Is this possible?

Pass values between user controls on 2 different aspx pages

  
I have 2 user controls that is hosted by 2 different aspx pages.example: srcpage.aspx --> hosts the --> sourceusercontrol.ascxanddestpage.aspx --> hosts the --> destinationusercontrol.ascxI would like the values in the text fields of the sourceusercontrol.ascx to be passed on to the labels in the destinationusercontrol.ascx. I have gone through the MSDN ASP.Net examples and i was able to successfully pass values between two aspx page using the postback URL functionality, but cannot do the same thing with the usercontrols on 2 different aspx pages. Any suggestions would be helpfull....! Thanks..! 

Getting VP.NET code to respond to SQL Return values and Error Codes

  

I have SQL stored procedures that will return values depending on the outcome of its execution. I have the following code at the end of each of my Stored Procedures:

RETURN @siReturnValue

It would be great to be able to use this Return value after running the Stored Procedures from my VB.NET code. I have included an example of how I am running SQL Stored Procedures below:

    Public Function SearchKeyword(ByVal SearchString As String) As Data.DataTable
        Dim AerialConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("aerialConnectionString").ConnectionString)
        Dim MediaArchive As New Data.DataTable
        Dim reader As SqlDataReader
        
        Try
            AerialConnection.Open()
            Dim SelectMediaArchiveCommand = New SqlCommand("EXEC spSearch @keywords", AerialConnection)
            SelectMediaArchiveCommand.Parameters.AddWithValue("keywords", SearchString)
            reader = SelectMediaArchiveCommand.ExecuteReader()
            MediaArchive.Load(reader)
        Catch e As Exception
        Finally
            AerialConnection.Close()
        End Try
        Return MediaArchive
    End Function

How can I code this to respond to different Return values, or even error cod

SPSWC:ProfilePropertyValue and multiple values user properties

  

Hi, I'm trying to customize the profile.aspx page in My Profile (SP 2010). All works fine except for the fact that I can't see the values of the user properties configured as multiple-value fields.

I'm using spswc:ProfilePropertyValue and what I get is a list of value separator (comma or semicolon, as configured in the user property) without values.

Do you know how to display multiple value user properties?

Thank you
Riccardo


Capturing USB Barcode Scanner Return values

  

Hi

We are using USB barcode scanner to scan material barcode labels. These lables are from our vendors.

We does not have control over the label generation. We are using USB barcode scanner for scanning purpose. We want to capture USB barcode scanner output. Normally the scanner returns output in the place holder in which the cursor present.

But we do not put writable text box for the cursor. Instead of write allowable text box we want to put locked or readonly text box in the screen and want to capture scanner value.

How can we do?

Assume that our barcode scanner does not support serial ports.

Regards
S. Muhilan


Muhilan

WPF Textbox loses original values, even if the user doesn't udpate

  

Hi,

I am having a very strange issue. I have a datagrid which is binding to an observable collection of type Person The selected item is bind to an Object Person. I have 2 textboxes firstname and lastname. When ever user selects an item from grid, the textbox values gets populated. user can edit the values and click submit button, values gets updated.

Source to Target works correctly - i.e. able to display from viewModel When I update the values gets updated.

Lets say user selected an item with firstname john, lastname smith The problem is user edits the firstname to johnny and he doesn't click submit button instead he selects a different item from datagrid, so when I go back to the original selected item. In the grid the selected item is shown as John smith, but in the textbox the value is shown as Johnny smith.

How to solve this problem? Any help would be greatly appreciated.


encoding function parameters and return values when binaryMessageEncoding is used

  

Dear All,

I'm creating simple web service that will accept some parameters (such as customer name and file name) and return content of an xml file as a string and WS client will save it on his side. I'm using custom binding with binaryMessageEncoding and httpTransport. The question is if it is possible to have these input parameters as well as returned xml content binary encoded somehow?

Thanks in advance for your help!


Dzordz

WPF Textbox loses original values, even if the user doesn't udpate

  

Hi,

I am having a very strange issue. I have a datagrid which is binding to an observable collection of type Person The selected item is bind to an Object Person. I have 2 textboxes firstname and lastname. When ever user selects an item from grid, the textbox values gets populated. user can edit the values and click submit button, values gets updated.

Source to Target works correctly - i.e. able to display from viewModel When I update the values gets updated.

Lets say user selected an item with firstname john, lastname smith The problem is user edits the firstname to johnny and he doesn't click submit button instead he selects a different item from datagrid, so when I go back to the original selected item. In the grid the selected item is shown as John smith, but in the textbox the value is shown as Johnny smith.

How to solve this problem? Any help would be greatly appreciated.


Getting values from Multiple user controls

  

Friends,

I have a asp.net page where i had placed two user controls.When the asp.net page loads naturally the first user control loads and then then the second user control loads.There is a value in the page load event of the first user control.I need to get this value in the second user controls page load event.

Can someone help me with this problem.

Thanks and Regards

Ashvin


WPF Textbox loses original values, even if the user doesn't udpate

  

Hi,

I am having a very strange issue. I have a datagrid which is binding to an observable collection of type Person The selected item is bind to an Object Person. I have 2 textboxes firstname and lastname. When ever user selects an item from grid, the textbox values gets populated. user can edit the values and click submit button, values gets updated.

Source to Target works correctly - i.e. able to display from viewModel When I update the values gets updated.

Lets say user selected an item with firstname john, lastname smith The problem is user edits the firstname to johnny and he doesn't click submit button instead he selects a different item from datagrid, so when I go back to the original selected item. In the grid the selected item is shown as John smith, but in the textbox the value is shown as Johnny smith.

How to solve this problem? Any help would be greatly appreciated.

 


How to Access MsiEnumRelatedProducts Return Values?

  

I am using the MsiEnumRelatedProducts function and according to all the articles I should be getting text return values such as:

ERROR_BAD_CONFIGURATION,
ERROR_NO_MORE_ITEMS

But I am only getting numbers returned from the function. I assume I need to use some Enum but I cannot find any example anywhere. I have looked at this article:

http://msdn.microsoft.com/en-us/library/aa370103(VS.85).aspx

But there is no explanation of how to actually get those text return values back?


How do I make it so when I user pressing return, it goes to the next line in a textbox?

  
I've got a textbox control on a WPF 4.0 app I've written.  This control allows for multiple lines, and that works fine.  However, my users like to be able to type something, hit the enter/return key which they're used to having it go to the next line in the textbox, where they then continue typing whatever it is they want to type.  Well, it's not doing that.  How do I make it do that?
Rod

workflow triggered during upload but after the user enters values in the properties dialog

  
 

1) When "Start this workflow when a new item is created" option is selected the workflow gets triggered as soon as the file is uploaded and even before the 'edit properties' dialog is displayed.  I want the workflow to be triggered after the properties are entered by the user on upload.

 

2) Selecting "Start this workflow when an item is changed." option also does not trigger the workflow during upload.  This triggers only when the user explicitly selects 'Edit Properties' dialog.

 

So my question is, how to get the workflow triggered during upload but after the user enters values in the prop

Categories: 
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