Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8173371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:07:32+00:00 2026-06-06T22:07:32+00:00

I have the following Webservice and SQL-Query: public class DIENSTLEISTUNG { public string DienstleistungName

  • 0

I have the following Webservice and SQL-Query:

  public class DIENSTLEISTUNG
        {
            public string DienstleistungName { get; set; }
            public string DienstleistungArtBezeichnung { get; set; }
        }

        internal static List<DIENSTLEISTUNG> Dienstleistung(string RAUM_ID)
        {
            List<DIENSTLEISTUNG> BestuhlungObject = new List<DIENSTLEISTUNG>();

using (SqlConnection con = new SqlConnection(@"Data Source=Localhost\SQLEXPRESS;Initial Catalog=BOOK-IT-V2;Integrated Security=true;"))
            using (SqlCommand cmd = new SqlCommand(@"
                                       SELECT
                                       DISTINCT dl.NAME AS NAME, da.BEZEICHNUNG AS BEZEICHNUNG
                                       FROM RAUM r
                                       RIGHT JOIN DIENSTLEISTUNG_Raum bs ON bs.RAUM_ID = (" + Room_ID + ") 
                                       RIGHT JOIN DIENSTLEISTUNG ba ON bs.DIENSTLEISTUNG_ID = ba.ID 
                                       RIGHT JOIN DIENSTLEISTUNGSART da ON ba.DIENSTLEISTUNGSART_ID = da.ID
                                       RIGHT JOIN DIENSTLEISTER dl ON da.DIENSTLEISTER_ID = dl.ID", con))

            {
                con.Open();
                using (SqlDataReader rdr = cmd.ExecuteReader())
                {
                  while (rdr.Read())
                    {
                        if (rdr["NAME"] != DBNull.Value && rdr["BEZEICHNUNG"] != DBNull.Value)
                        {

                            BestuhlungObject.Add(new DIENSTLEISTUNG()
                               {                                                                                                                                      
                                DienstleistungName = rdr["NAME"].ToString(),
                                DienstleistungArtBezeichnung = rdr["BEZEICHNUNG"].ToString()
                             });

                        }

                    }
                }
            }
            return BestuhlungObject;
        }

    }
}

This Webservice is working like charm. I can send one Room_ID = 219 and get the expected output. My Question is, how can i send more then one Room_ID seperated by comma. For Example: Room_ID = 219, 220, 221

Can someone please help me with that?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:07:35+00:00Added an answer on June 6, 2026 at 10:07 pm

    See T-SQL stored procedure that accepts multiple Id values

    One of many ways (MS SQL 2005+), if you can pass parameters as xml:

    var sql =
        @"SET ARITHABORT ON;
        SELECT ...  
        RIGHT JOIN DIENSTLEISTUNG_Raum bs ON bs.RAUM_ID IN
        (
            SELECT tbl.col.value('.', 'varchar(20)')
            FROM @xml.nodes('id') as tbl(col)
        ) ...";
    SqlCommand cmd = new SqlCommand(sql, connection);
    cmd.Parameters.Add("@xml", SqlDbType.Xml).Value = "<id>111</id><id>222</id><id>333</id>";
    

    Or using LIKE if you can pass parameters as ,aaa,bbb,ccc, (note the order of LIKE arguments to avoid an injection)

    var sql =
        @"SELECT ...    
        RIGHT JOIN DIENSTLEISTUNG_Raum bs ON @ids LIKE '%,' + bs.RAUM_ID + ',%'
        ...";
    SqlCommand cmd = new SqlCommand(sql, connection);
    cmd.Parameters.Add("@ids", SqlDbType.VarChar).Value = ",111,222,333,";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following webservice: [webmethod] public string MakeReservation(?? PassengersInfo)//what data type use for PassengerInfo
I have following example method: namespace Postcode_webservice { public class Business { public string
I have a WebService with the following Method: [ScriptMethod(ResponseFormat = ResponseFormat.Json)] [WebMethod] public string
I have the following json output when i call a sample webservice <string>[{Name:Ajay Singh,Company:Birlasoft
I have the following entities: @Entity public class Alert implements Serializable { private long
I have written following code to get JSON result from webservice. function SaveUploadedDataInDB(fileName) {
I have the following endpoint interface: @WebService public interface SEIWebService { @WebMethod @WebResult(name=CreateWorkOrderItemResponse) CreateWorkOrderItemResponse
Having a deadlock in webservice + hibernate... No idea why. I have the following
I have come up with the following code to call a webservice using client/server
I have a basic web service that returns the following object as JSON: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.