Click here to Skip to main content
15,906,569 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: What's new in ASP.NET? Pin
koolprasad200314-Jul-16 18:25
professionalkoolprasad200314-Jul-16 18:25 
AnswerRe: What's new in ASP.NET? Pin
John C Rayan18-Jul-16 2:05
professionalJohn C Rayan18-Jul-16 2:05 
AnswerRe: What's new in ASP.NET? Pin
petter201231-Aug-16 14:12
petter201231-Aug-16 14:12 
Questionwhat datasource control to use on a web from 2010 Pin
dcof12-Jul-16 11:58
dcof12-Jul-16 11:58 
AnswerRe: what datasource control to use on a web from 2010 Pin
petter201231-Aug-16 14:22
petter201231-Aug-16 14:22 
QuestionNeed help Regarding ADFS SSO implementation in Asp .net via SAML 2.0 Pin
Member 1263115512-Jul-16 4:09
Member 1263115512-Jul-16 4:09 
AnswerRe: Need help Regarding ADFS SSO implementation in Asp .net via SAML 2.0 Pin
Richard MacCutchan12-Jul-16 5:29
mveRichard MacCutchan12-Jul-16 5:29 
QuestionI need to add a Add New Button to the right of the heading. Pin
JBHowl12-Jul-16 3:18
JBHowl12-Jul-16 3:18 
AnswerRe: I need to add a Add New Button to the right of the heading. Pin
jkirkerx15-Jul-16 11:31
professionaljkirkerx15-Jul-16 11:31 
QuestionMVC 4 into ASP.net core conversion difficulties Pin
Member 1058746111-Jul-16 22:57
Member 1058746111-Jul-16 22:57 
AnswerRe: MVC 4 into ASP.net core conversion difficulties Pin
jkirkerx15-Jul-16 11:22
professionaljkirkerx15-Jul-16 11:22 
QuestionMSChart text annotation asp.net 4.5 Pin
BobbyStrain5-Jul-16 6:01
BobbyStrain5-Jul-16 6:01 
AnswerRe: MSChart text annotation asp.net 4.5 Pin
koolprasad20035-Jul-16 18:20
professionalkoolprasad20035-Jul-16 18:20 
Questionentity framwork one-to-many relation Pin
a1_shay5-Jul-16 4:37
a1_shay5-Jul-16 4:37 
AnswerRe: entity framwork one-to-many relation Pin
John C Rayan6-Jul-16 2:28
professionalJohn C Rayan6-Jul-16 2:28 
AnswerRe: entity framwork one-to-many relation Pin
Nathan Minier13-Jul-16 1:48
professionalNathan Minier13-Jul-16 1:48 
QuestionAutomating a website using Asp.net Pin
srikrishnathanthri3-Jul-16 23:56
srikrishnathanthri3-Jul-16 23:56 
AnswerRe: Automating a website using Asp.net Pin
Member 1039877314-Jul-16 21:40
Member 1039877314-Jul-16 21:40 
QuestionWeb api insert failed but code seems fine Pin
DotNetFellow1-Jul-16 19:14
DotNetFellow1-Jul-16 19:14 
hi

I do not know where is going wrong but i seems not able to insert data using web api. Any help greatly appreciated and thanks a lot

The data
{"ID":1,"EmailAddress":"demo@demo.com"}

and the code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Dapper;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;

namespace cirqer.Controllers.api
{

public class EmailListList
{

public int ID { get; set; }

public string EmailAddress { get; set; }

}

public class emaillistController : ApiController
{
static string connectionstring = ConfigurationManager.ConnectionStrings["CRConnectionString"].ConnectionString;

[HttpGet]
public Int16 EmailList_SelectCount()
{
try
{
using (var conn = new SqlConnection(connectionstring))
{
Int16 x = conn.ExecuteScalar<short>("EmailList_SelectCount", commandType: CommandType.StoredProcedure);
return x;
}
}
catch
{
return 0;
}


}

[HttpPost]
public void EmailList_Insert(EmailListList email)
{
try
{
// dynamic data = email;
using (var conn = new SqlConnection(connectionstring))
{
conn.Open();
conn.Execute("EmailList_Insert", email, commandType: CommandType.StoredProcedure);
conn.Close();
}
}
catch
{

}

}

}
}
QuestionRadiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Codeaddict742330-Jun-16 9:25
Codeaddict742330-Jun-16 9:25 
QuestionRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
ZurdoDev30-Jun-16 10:28
professionalZurdoDev30-Jun-16 10:28 
AnswerRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Codeaddict742330-Jun-16 10:35
Codeaddict742330-Jun-16 10:35 
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Richard Deeming30-Jun-16 10:52
mveRichard Deeming30-Jun-16 10:52 
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Codeaddict742330-Jun-16 11:16
Codeaddict742330-Jun-16 11:16 
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Richard MacCutchan30-Jun-16 22:26
mveRichard MacCutchan30-Jun-16 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.