How to combine two datatable in c#}

Hi Everybody,
I have two datatables I want to combine single output.
First datatable1 result
A1    A2
10   15
Second datatable2 result
B1   B2
5    10
The final result should be in datatable3
A1     A2     B1     B2
10     15     5      10

Hi,
SQL Server do not have datatables but tables. Datatables
(datatable)
is a dot.Net object. You can read more about DataTable class here: http://msdn.microsoft.com/en-us/library/system.data.datatable(v=vs.110).aspx
Are you talking about DataTable or tables in database?
>> Combining two DataTables objects in dot.net can be done with the DataTable.Merge Method.
>> combining two tables in SQL Server database can be done using the Merge operation in T-SQL (as other mentioned before me)
[Personal Site] [Blog] [Facebook]

Similar Messages

  • How to combine two datarows (business component data) in BI Publisher

    Hi ,
    We are using BI Publisher in Siebel Environment.
    We have data coming from two business components (like from 2 diff tables)
    a) <?for-each:ssTest1?>
    b) <?for-each:ssTest2?>
    ssTest1 and ssTest2 are the business components
    We need to combine these 2 datarows (a&b) and show the data into a single combined data row for ex like <?for-each:ssTest1ssTest2?> and show all the fields in that.
    I'm not sure how we can combine these two data rows into a single combined data row and show the data.
    Any help from any one would be apprecated.
    Thanks
    PV
    Edited by: user8633002 on Oct 21, 2010 4:05 PM

    Hi sajid
    There was nothing more description about your issue in this site and I found an issue below is mostly like yours
    http://www.codeproject.com/Questions/855487/how-to-combine-two-table-value-in-rdlc-report
    In the issue above, if you want to show the two other tables in the report, I think you could combine the tables into one datatable joining on key. The link below show an example of a DataSet Helper from Microsoft about combine DataSets. Take note of
    the related content for other DataSet Helper examples. And then you could use the datatable in your RDLC.
    # HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
    http://support.microsoft.com/kb/326080/en-us
    In an alternative way, I think you could create a view in the database which combine your tables and use it in your rdlc.
    In addition, your issue is about asp.net and you could get more support in the asp.net forum whose link as below.
    http://forums.asp.net
    Best Regards
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • How to combine +two fields without submitting page (via AJAX/HTMLDB_Get)?

    Hi all,
    After my last contribution "Request for Scott Spendolini" I was able to create the scripts to update fields in forms without having to refresh the page. Thanks again to Scott, Carl and the others who helped me solving my problem.
    I have another question regarding this however. How do I combine two (or more) values on a form to fill a field with the values, for instance to create a unique Primary-key field?
    This is the example: combine the postcode and the house-number (and maybe an extension to the housenumber) in one field 'adrescode'. This uniquely identifies an adress in the Netherlands. I can 'get' the postcode to fill the first part of the adrescode, but how do I modify the scripts to 'get' the housenumber (huisnummer) and - if not left null - the extension to the housenumber?
    Here are the scripts I created to far:
    in the region source of the page I have the following Javascript:
    <script language="JavaScript1.1" type="text/javascript">
    function f_P52_getAdrescode ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=P52_getAdrescode',0);
    get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P52_ADRESCODE').value = gReturn  }
    else
    {  html_GetElement('P52_ADRESCODE').value = 'null'  }
    get = null;
    </script>
    and in the shared components of the application I have created an process P52_getAdrescode as follows:
    declare
      l_adrescode varchar2(16);
    begin
        l_adrescode := :P52_POSTCODE || :P52_HUISNR ;
        if :P52_HUISNRTOEVOEGING is null then
              NULL ;
        else
              l_adrescode := l_adrescode ||':'||:P52_HUISNRTOEVOEGING ;
        end if ;
        htp.prn(l_adrescode);
    -- dbms_output.put_line(l_adrescode);
    end;
    I ran this PL/SQL in the SQL-section of HTMLDB and it does what a expect: combine the values in a new string.
    In my page however, it only gets the value of postcode and puts this into the adrescode field.
    So my question is: how do I modify the Javascript (I Guess) so that also the fields 'huisnummer' and 'huisnummertoevoeging' end up in the adrescode field?
    Thanks for your help,
    Jan.

    Carl, Scott,
    I have two pages with exact the same fields and codings (as described before in this Post.
    I now have two different named functions and application processes, a javascript an process for each page. They both do the same thing, use the same code except for the page-number (:P52_ and :P92). I tried to make one process to replace both, but ran into problems when I changed the name in the get.add statement.
    Changing the get.add from: get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value) to: get.add('POSTCODE',html_GetElement('P52_POSTCODE').value) always ends up in what looks like a complete html-(source)dump of the page in the field that has to be updated. Even when I replace the :P52_POSTCODE in the application process as well Changing back the application process and the javascript to so that both javascript and process use the :P52_ again and the function returns the correct value again. What am I doing wrong?
    I requested an online-workspace to post the application to it, but have no answer to my request yet, so I can't provide a working example at the moment....
    Thanks for your help again,
    Jan.

  • Does anyone know how to combine two apple ID's together?

    I have found out that I have two Apple ID's! One is for my apps on my iphone and the other is for iTunes.  Somehow they are set to different email addresses but are being sent to the same email address.  Does anyone know how to combine them, so I use just one Apple ID?

    This is my solution too.
      You see, what I also downloaded all the free apps I have on iPhone to this account I choose to use, so this way I didn't need to change accounts (of course it was on the iOS 5 times)

  • How to combine two dimension in dashboard??

    Dear experts,
    I have a requirement that i need two combine two dimension in dashboard.
    Ex:-
    -  I have two different providers (Query1 and Query2) and both is having common dimension called Plant.
    - The plant from both query is having different values (for example, Query1 Plant = A,B,C and Query2 Plant = D,E,F,G)
    - Now I want the total list of plants from both query and list of plants will be used as filter on combo box in dashboard.
    Note: List of values for Plant (dimension) may increase or decrease from both query.
    Thanks and regards
    Vijay Muniraj

    Hi Vijay,
    How can you combine the 2 queries as a single query in dashboard?If i understood the query,use a Multiprovider for your requirement and get the combined results in single query and use Plant as single prompt in the dashboard(If you are getting data from BI).You cannot merge this behaviour in the dashboard.(In Web Intelligence you can merge it based on common dimension values only).
    Regards,
    Venkat

  • How to combine two reports in obiee 10g(not union)

    Hi Everyone
    I have got a requirement where client is asking to combine two report to one
    Report A has columns
    "Region", "category" ,"in house " ,"sales" which can be shown by applying filters for current running year
    Report B
    Region,Category, Week5,week6, week7,week8 in this showing sales in individual week by using pivot view and limiting to four weeks
    with a week filter
    Now client req is to combine both reports into single one
    region, category,inhouse,sales,week5,week6,week7,week8 here the issue is inhouse and sales data has show yearly data and week 5,week6,week7,week8 has to show weekly data .And weeks columns has to get updated automatically .
    I am having a confusion in this will it possible to combine both reports, if possible pls help out how to do it
    Regards
    Sandeep
    Edited by: Sandeep on Jul 31, 2011 9:20 AM
    Edited by: Sandeep on Aug 1, 2011 1:43 AM

    First of all, proof read your post. Generally, grammatical and punctuation errors can be deciphered, but where words are critical to presenting your issue clearly, you must type those sentences correctly. Otherwise, it can be confusing and turn off someone who may want to help.
    "...which can be shown without and filters and want data for current year." What does this mean?
    "...And weeks columns have to update its week no based on that week." What does this mean?
    In an attempt to answer you question, do this:
    1) Base your query filters on the "current running year." This will satisfy the requirements for displaying data from the first report.
    2) Now add 4 "sales" columns (i.e., same column, but 4 instances of it). In each of these columns, click on the fx button, click on Filters, go to your Time dimension and select the appropriate week, and then click "OK." Now, each of these columns will hold the measure value for the particular week while the "sales" column will have the "running total" for the whole time period.
    Once you get the above to work, you can work on automating this by substituting a function in place of the hard-coded week number values.

  • How to combine two photos in one without white border?

    I am trying to combine two different photos next to each other (each 10 cm * 7.5 cm) in one of 10 cm * 15 cm and save it as a jpg file. Unfortunately when I do this in the print module (custom package) I get a file with a white border. I have set up page settings to 10*15 cm without border. How can I get a combined file without a border?

    Titas,
    This involves row level comparison of the report column data values we can achieve this in BI Publisher but at answers level there is no option.
    Thanks,
    Saichand

  • Sapscript: How to combine two elements into a block when display ?

    /E  ITEM_CONDITIONS
    /:   PROTECT
    ZC &KOMVD-VTEXT&,,&KOMVD-KWERT&
    /:   ENDPROTECT
    /E  TOTAL_AMOUNT_ITEMS
    /:   PROTECT
    ZC &KOMK-SUPOS&
    /:   ENDPROTECT
    Hi, all. May i know how to combine the two elements into a same block when displaying?
    That's mean this two element content will not be split into two part between two pages when there is insufficient space in the front page.
    Thanks.
    Edited by: Jiansi Lim on Oct 8, 2008 12:24 AM

    You can evoke the PROTECT..ENDPROTECT in the print program before the call of the text elements.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'PROTECT'.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'ENDPROTECT'.

  • How to combine two 8 bit numbers to make a 16 bit number??

    Hi
    My electronics ADC ouputs the result of the conversion over two bytes because it is a 10 bit number. This is then fed into Labview via the serial port. I have the two bytes stored in the various elements of an unbundle block diagram.
    My current vi has the two bytes stored seperately. HOw may I combine the two together??
    So far I have
    1st byte sent : (MSB)bit7/bit6/bit5/bit4/bit3/bit2/bit1/bit0(LSB)
    2nd byte sent : (MSB)X/X/X/X/X/X/bit1/bit0(LSB)
    I can send the two bytes from my electronics in either order, whichever suits labview the best.
    At the present time, byte 1 max value is 255 and byte to is 3
    I would like to combine these two arrays to form the following:
    (MSB)X/X/X/X/X/X/bit9/bit8/bit7/bit6/bit5/bit4/bit3/bit2/bit1/bit0(LSB)
    This way, the combined two bytes has a range up to 1048, a true representation of the ADC value. This value can then be converted and displayed on a dial.
    If anybody has any ideas or help it would be appreciated. I can attach a vi to explain what I am doing if that helps/or my details above are unclear.
    Thanks

    Sign extention of a 10 bit integer. Input two bytes, Output signextended 10 Bit. The output value will be in the range from -512 to 511. No check if Highbyte is greater than 3!
    Code in LV 6.0.2
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    SignExtend10Bit.vi ‏17 KB

  • How to combine two accounts?

    I somehow seem to have created two accounts, both for the same email address, is there a way that i can transfer the credit from one account to another, and therefore combine them?

    Dear Readers,
    I am sorry it took so long for this thread to find me ... or, for me to find this thread!
    Skype does not permit the transfer of features, subscriptions, calling plans, or credit from one account to another.  Therefore, multiple accounts can not be "merged" into a single account.  This is true regardless of whether the account is under a Skype Manager hierarchy or not.
    The only way to manage this is to cancel the items that are not needed on the account you no longer wish to use, and start new subscriptions and/or purchase new credit for the account you will use.  More details here: 'Can I delete my Skype account?'
    If you need assistance with this, here is a link to the instruction on how to contact Skype Customer Service via their secure portal: Contact Customer Service
    Best regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • How to combine two images in preview onto one page

    Sorry if this topic doesn't go here - there wasn't a "preview" category.
    I have two images that i want to print out on the same page and right now they are each on a separate page in the same file in preview. Does anyone know how I can combine them onto one page?
    Thanks
    Message was edited by: p-rock

    Hi -
    I load two images in Preview and select them.
    !http://www.spotsbeforeyoureyes.com/Preview1.jpg!
    Then I select Print Selected Images:
    !http://www.spotsbeforeyoureyes.com/Preview2.jpg!
    When the print dialog box opens, I select Images per Page:2
    !http://www.spotsbeforeyoureyes.com/Preview3.jpg!
    Hope this helps.
    MtD

  • How to Combine Two Calendars?, How to Combine Two Calendars?

    Greetings,
    In iCal I have two calendars. One is called Calendar and the other is called Home. I am not sure how this happened. Some new events are in Calendar and some are in Home.
    My Question is: How can I combine the two calendars so I just have one calendar. I would like to put the events on Home onto Calendar and just have one calendar.
    Thanks in advance for your help and support,
    Leighh

    Austin,
    Thank you very much. Your suggestion worked splendidly.
    I appreciate you help and support.
    Leighh

  • How to combine two Vis

    Hello Every One,
    Can anyone help me in combining these two attached VIs please. What I am trying to do is convert 16bit tif image (attached) to 64 RGB image and then only crop the image, however I do not know how to attached these two VIs. Please someone help
    Many thanks 
    Lazer
    Attachments:
    Image Crop_2009.vi ‏85 KB
    Grayscale to Color 16bit_v2010.vi ‏85 KB
    1800s.jpg ‏8 KB

    Hi Lazer,
    Thank you for your question. Firstly, the image you've attached is blank, have you uploaded the file in the appropriate format?
    I see that the 'Grayscale to Color' VI converts the image from a Grayscale U16 image to a U64 RGB image. Is this what you wish the VI to do? The second VI simply crops the image. 
    Do both of these VI's function as you wish them to, as separate entities? If so, the issue is calling them in a sequence, is that correct? If so, you can do this by simply making a third, Main VI, which calls these two VI's as sub-VI's. 
    Kind Regards,
    Shalimar Ali
    Applications Engineering Intern

  • How to Combine Two SubPaths into a Single SubPath

    For CS 5, ActionScript:
    I have a Path which contains two subpaths, which may or may not overlap.
    How do I combine them into a single SubPath (i.e., union) via scripting?
    I know that in the GUI, I can select both SubPaths and then press the "combine" button - this is the effect I want.
    TIA,
    mlavie

    This should combine the first path in the Paths Panel:
    // 2012, use at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    if (myDocument.pathItems.length > 0) {
    myDocument.pathItems[0].select();
    // =======================================================
    var idcombine = stringIDToTypeID( "combine" );
        var desc10 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref7 = new ActionReference();
            var idPath = charIDToTypeID( "Path" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref7.putEnumerated( idPath, idOrdn, idTrgt );
        desc10.putReference( idnull, ref7 );
    executeAction( idcombine, desc10, DialogModes.NO );

  • How to combine two arrays?

    HI. Can anyone help me?I need to make waveform graph that shows channels' on and off states. I have done a program which works fine for one channel. Now I want to have the other channel in the same picture. I just can't plot those two signals in same picture. Is there any way to combine these two arrays so line 1 would show channel 1 state and line 2 would show channel 2 state? And it would be great if those extra lines wouldn't show at all in the chart. I know I should some how move bits of one array to the other array,but it should remain 1-D. I attach the code here. If there is(and I bet there is) a better way to do this,  please tell me.
    Mika
    Attachments:
    Channelsstate.vi ‏31 KB

    Would this do?
    Message Edited by devchander on 02-06-2008 04:44 AM
    Attachments:
    dig_graph_21.vi ‏16 KB

Maybe you are looking for