Find Jobs
Hire Freelancers

Update a c# project to return multiple id's as opposed to single id

$25-50 USD / hour

Completed
Posted about 10 years ago

$25-50 USD / hour

The following is a web service to return a view from a sql database. I need to include an IN clause to allow for multiple groups (external ID) on the return query. This may need to be serialised to ensure that all the groups (external IDs) are returned. Here is a snapshot of the code below: [AccessKeyAuthorization] public class XmlViewsController : ApiController { public HttpResponseMessage Get(string accessKey, string viewName, string fieldName = null, string fieldValue = null) {if (accessKey == "293892380") { viewName = "ViewName1"; }; //To ensure only the relevant View is allowed string vToRedirect = "No"; switch(viewName) { case "ViewName2": vToRedirect = "Yes"; break; } if (vToRedirect == "No") { return new HttpResponseMessage([login to view URL]); }; string dataSetName = "DataSet"; string userIdFiledName = "Team"; var cn = new SqlConnection([login to view URL]["DataConnection"].ConnectionString); var cmd = new SqlCommand([login to view URL]("SELECT * FROM [{0}] WHERE 1=1", viewName), cn); var adapter = new SqlDataAdapter(cmd); var dataSet = new DataSet(dataSetName); [login to view URL](dataSet, [login to view URL], viewName); // filter by user id if ([login to view URL][viewName].[login to view URL](userIdFiledName)) { var userIdColumn = [login to view URL][viewName].Columns[userIdFiledName]; // TO SKIP THE FIELD SELECTION ON TEAM IF TEAM IS ALL if ((User as User).ExternalId == "ALL") { if ([login to view URL] == typeof(string)) { //[login to view URL] += [login to view URL](" AND [{0}]=@Team", userIdFiledName); //[login to view URL](new SqlParameter("@Team", "%")); }} // NEED TO CONVERT SO THAT IT IS NOT ONLY A SINGLE TEAM, BUT A LIST FROM A TABLE else { if ([login to view URL] == typeof(string)) { [login to view URL] += [login to view URL](" AND [{0}]=@Team", userIdFiledName); [login to view URL](new SqlParameter("@Team", (User as User).ExternalId)); }}} // filter by field value if (![login to view URL](fieldName) && ![login to view URL](fieldValue) && [login to view URL][viewName].[login to view URL](fieldName)) {var fieldColumn = [login to view URL][viewName].Columns[fieldName]; [login to view URL] += [login to view URL](" AND [{0}]=@FieldValue", fieldName); [login to view URL](new SqlParameter("@FieldValue", [login to view URL](fieldValue, [login to view URL])));} var content = new HttpResponseMessage([login to view URL]) {Content = new StringContent([login to view URL](dataSetName, viewName, Url))}; [login to view URL] = new MediaTypeHeaderValue("application/xml"); return content; }}}
Project ID: 5854175

About the project

3 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello , My self Parm. I am Microsoft technology Expert Having 7+ years of Experience in Development of Web & windows based projects. I have skills in ASP.Net 2.0 - 4.5, c#, VB.net, mvc, wcf, wpf, silverlight, SQL Server 2005-12, MySQL, jQuery, JavaScript & Ajax Technologies. its easy job for me, let me help you on this. i will charge $10/hr for this job. I have worked in team environment on following projects. [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] ####My Expertise#### 1. Web Application Development 2. Desktop Application Development 3. Database Programming 4. Reporting & Charting 5. Business Intelligence Dashboard 6. Data Integration -ETL 7. Social Media & 3d party API Integration I have good understanding of E Commerce, Health Care application, Practice Management Systems, Logistics, Supply Chain Management, Telecom, Education and many other areas. I am individual person & easily available over Skype for voice calls or chat. I am expecting your positive reply on my proposal. Thanks Regards Parm
$25 USD in 40 days
5.0 (1 review)
1.4
1.4
3 freelancers are bidding on average $29 USD/hour for this job
User Avatar
Hi, I can able to get the output quickly but need more details so we can talk about it and work together for completion. Looking forward.
$25 USD in 3 days
5.0 (1 review)
2.4
2.4
User Avatar
Hi Sir I have many interesting about your project If you give me your project , i will do my best for you I wanna work with you As you can see, im top 9th on freelancer Thanks!
$36 USD in 40 days
5.0 (2 reviews)
1.0
1.0

About the client

Flag of SOUTH AFRICA
Johannesburg, South Africa
5.0
7
Payment method verified
Member since Nov 8, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.