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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Design Data Contract for User Create/Update/Delete REST API using WCF 3.5 & JSON

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :WCF
 

Hi,

I'm using REST with WCF .NET 3.5. I've design the class structure with below JSON struvture of input & output.

API 1: Create User: POST /id & request body is as shown below:

{
  "userList" :
   [
    {
       "name" : "<name>",
       "email" : "<email>",
       "dataId" : <dataId>,
       "country" : "<country code>",
    },
    {
       "name" : "<name>",
       "email" : "<email>",
       "dataId" : <dataId>,
       "country" : "<country code>",
    }
   ]
}

The response object should be as shwon below:

{
  "userCreateResults" :
   [
    {
       "email" : "<email>",
       "userId" : <userId>,
       "password" : "<password>",
       "result" : <result code>
    },
    {
       "email" : "<email>",
       "userId" : <userId>,
       "password" : "<password>",
       "result" : <result code>
    }
   ]
}

API 2: Update User: PUT /id & request body is as shwon below:

{
  "userList" :
   [
    {
       "userI


View Complete Post


More Related Resource Links

Can't perform Create, Update or Delete operations on 'Table(outbox)' because it has no primary ke

  

 Hi,

I'm a beginner in asp.net and I have some problem inserting data into sql server 2005 with linq.

 

my code is : 

 

        Dim Result As New SMS.SendResult
        If Result.status = 0 Then
            Label1.Text = "Your Message Sent Successfuly"
           
            Dim db As New IGSSDataContext
            Dim out As New outbox With {.ClientID = intRandomNumber, .From = User.Identity.Name, .TO = TextBox1.TabIndex, _
            .Time = Now, .Message = Message}
            out.ID = (ID)
            db.outboxes.InsertOnSubmit(out)
            db.SubmitChanges()
           
            TextBox1.Text = ""
   &nb

Data-Bound Design: Create a Silverlight 4 Web Part for SharePoint 2010

  
When building custom SharePoint 2010 solutions, it makes a lot of sense to take advantage of Silverlight 4 on the front end. We'll walk you through the process of building a Silverlight Web Part with Visual Studio and Expression Blend.Paul StubbsMSDN Magazine September 2010

LINQ - Can't perform Create, Update or Delete operations on because it has no primary key.

  
Hi, not sure if I'm posting this thread in the right section. anyway, I''m trying to do the update/insert/delete using LINQ but the underlying table does not a primary key. The table consists of composite ket (e.g. fieldA & FieldB make a primary key). At the moment, I have LINQ complaning about not having a single primary key (not sure what LINQ does it - not making any sense at all). did anyone ever come across this issue and rectified it?  thanks

what is the better design for location of system database data / log files and user data/log file,

  
is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

inserting data to Users Table in ASPNETDB from Create User Wizard

  

When a user starts a membership using the Create User wizard supplied by the aspnetdb profile service, I need to add a field to a table in aspnetdb and upon clicking the ContinueButtonClick insert some data.  The field I'll add is "SubscId".  My first question is what table is best for this - Users or Membership?

Secondly, what is the best way to insert new data for this scenario?  code behind?  markup?  Can someone provide basic syntax of insert code in code behind for this scenario?


Need to create a service to allow client application to update their data

  

Hi,

I want to create a  WCF Service to transfer data to our clients application(WPF).

The Data I am trying to send is as follows.

ID  Code          Description   unit    Rate

1   104200000   LIVE GOAT      NOS     25

2   104200000   LIVE GOAT2    NOS    25

3   104200030   LIVE GOAT3    KGS     10

4   104202030   Water             LTR      5

and so on till ~ 11000 records.

What I have done so far is. Created a service which return a list of data.

-----------

 public List<Classes.TariffData> GetTariffData()
{
var currentTariffData = new List<Classes.TariffData>();

using (var myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
const string query = "select a.ID,a.Code,a.Description,a.unit,a.rate,a.rate3 from tariff.dbo.tariffdata a, tariff.dbo.code_history b where a.id = b.id and b.endofvalidity is null";
using (var myCommand = new Sq

Save/Update/Delete Sql Server data base table using Sharepoint Designer

  

Can some one help me to achieve below task

Save/Update/Delete Sql Server data base table using Sharepoint Designer.


How to use Designer to create a WF to collect data and update item in the list

  

Hi,

I’m trying to create a workflow in SharePoint Designer 2007 to finish the item in the list. In the list, I setup 10 fields (Name, Address, Phone#....), and in the workflow, I set it to start automatically when a new item added in the list (I can add a new Name in the list to start the workflow).

 

In the step1:

The Conditions is: “If Address is empty”.

The Actions is: “Collect all data from lw1990 (Output to Variable: collect1)

 

At this point, I don’t know how to update the current item in the list with the data that just collected from user in Variable:

Windows 7 Phone Database Rapid Repository Create Read Update and Delete

  

Download the code and a fully working example application from http://rapidrepository.codeplex.com/

Tutorials

  1. Introduction
  2. Set up the Rapid Repository
  3. Create, Read, Update and Delete
  4. Cannot create a connection to data source ... Login failed for user: BUT not for all reports!

      

    SQL Server 2008 using Report Builder v2.0  (Microsoft SQL Server Reporting Services Version 10.0.2531.0)

    We have several reporting service apps with many reports in each one. There is a set of 4 reports that all report on similar info (but grouped differently) that can be run by me and other network administrators but not any "regular" users. On these reports only, they are getting "Cannot create a connection to data source ... Login failed for user...". As I've said there are other reports that regular users can run just fine!? ALL reports use the same Shared Connection Data Source on the server that is set up as Windows Integrated Security. The Data Source's Security allows Domain Users to browse.  

    I've uploaded a test report to SSRS whos SQL is "SELECT 'test' as testField" and that's it: and is connected to this same Data Source and users still get the Login Failed error... even tried creating and using a new Data Source that points to the same SQL Server DB to no avail. Examining the rdl's XML doesn't reveal anything either.

    Reporting Server is a different machine than the SQL Server DB holding the data.

    The only clue is that working reports were created a year before now.


Contoso Karate - Data Driven User Interface Widgets in an ASP.NET MVC 3 Design

  
In the previous post in this Contoso Karate MVC Series we re-factored our LogIn control widget into a PartialView. We did this for a few reasons. Views want to be associated with only one model and we want to reserve that model for one that is more central to the particular page being displayed. (Specifying the Model for the view [...] Read More......(read more)

Permissions for a user to read data and create Views

  

Hello Forum

is it possible to allow users to read data and create views without giving them dbo privileges?

The SQL Server version is 2008 R2.


Please click "Mark As Answer" if my post helped. Tony C.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

  
Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?



Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.



For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

how to get an array of all the asp.net textbox control inside create user wizard control?

  

Hi,

How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

<script type="text/javascript">
        function addLoadEvent(func) {
            var oldonload = window.onload;
            if (typeof window.onload != 'function') {
                window.onload = func;
            } else {
                window.onload = function() {
                    oldonload();
                    func();
                }
            }
        }


        function prepareInputsForHints() {
            var inputs = document.getElementsByTagName("asp:TextBox");
            for (var i = 0; i < inputs.length; i++) {
                inputs[i].onfocus = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
                }
                inputs[i].onblur = function() {
                    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
                }
            }
        }
        addLoadEvent(prepareInputsForHints);

    </script>


 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
       

form feild hints are not displaying for textboxses inside create user wizard?

  

Hi,

I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		}
	}
addLoadEvent(prepareInputsForHints);
</script>
span.

Linq - add data to database then email user the details

  

Hi all

I'm not sure how to structure the code for this but what I want to do is be able to add data to a database, and once this has completed successfully, then email the user to say the details have been added successfully to the database.

I need to:

1. Check that the relevant data has been added into the database then

2. Email the details of the relevant data when completed. 

 

Thanks in advance for your help,

Laura

 

 


logged in user data

  

I'm using the defualt membership provider, i created a table and used the gridview on the logged in user page to show his information such as address e-mail phone zip code etc,, how can i do this without writing a code?


I am new to asp.net  i need simple help please?



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