How to use existing SharePoint Data Source in Visual WebPart in Visual Studio

I want to create a SharePoint Visual Web Part using Visual Studio, which will query SQL database and will display some data (e.g. Latest News from Database)
I already have a SQL Data Source (rsds file) in SharePoint. Can i use this rsds to connect SQL database for my Visual Web Part ?

I will use web.config as last option but can you please explain how BdcService will connect external SQL database.
What if I use SharePoint property to store connectivity information and all web parts will use it to make connection string?
Following code returns 0 entities
// Get reference to BDC Service
BdcService service =
SPFarm.Local.Services.GetValue<BdcService>();
// Get MetaData Catalog
IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);
// Some heading for the literal control
string dbData =
"<h1>Lob Systems and Entities … </h1> " +
"</br>";
// Get all the external content types from the meta data catalog
foreach (IEntity
ect in catalog.GetEntities("*"))
// Add external content type’s name and lob system name to the literal control
dbData += ect.Name +
"," + ect.GetLobSystem().Name +
"</br>";
ltMsg.Text = dbData;

Similar Messages

  • How to use container's data source as mapviewer data source?

    Hi,
    I want to take advantage of connection pooling and hence was trying to create a mapviewer datasource from J2EE container.
    When I use the J2EE ds as the Mapviewer datasource in the Mapviewer admin page, it wouldn't work.
    Rest of the applications deployed on the OC4J container which makes use of the same J2EE ds works fine.
    I referred to the article below to configure the datasource(not the permanent stuff), but it didnt work.
    http://www.oracle.com/technology/products/mapviewer/htdocs/faq_1012/mvfaq_1012.html#oc4jds
    Any help is much appreciated.
    Cheers,
    Sumanth

    I am running mapviewer application with my dynamic datasource created out of JDBC URL. All the shipped-in demos and my own mapviewer application works fine with this.
    The trouble is when my application runs it creates too many database connections (my observation is a connection each for a theme).
    There are about 16 themes and the application opens up 16 connections (I have monitored the statements for each of these connections and they are for the individual themes). Although we could increase the max connections of our database, ideally we would like to make use of less connections.
    An efficient way of solving this would be to create the dynamic datasource out of J2EE data source rather than JDBC URL.
    So, when I define a dynamic datasource through the mapviewer admin page from an existing J2EE data source, it creates a datasource with JDBC URL as "thin:@:1521:" and schema user as "scott", both of which are incorrect. Referred to the article below to solve this but with no luck
    http://www.oracle.com/technology/products/mapviewer/htdocs/faq_1012/mvfaq_1012.html#oc4jds
    Sorry if I sound stupid with this elementary question. Would appreciate any help.
    Cheers,
    Sumanth

  • How to use .UNX as data source in design studio??

    How to user .UNX as source in design studio??
    I am new to design studio. Experts I need to transfer some Dashboards(Dashboards are developed using BEX query ) from Xcelsius to Design studio.
    Experts need some guidance.

    Hi,
    I haven't worked on this, but the below links seems to helpful about your queries.
    Migrating SAP Dashboards to Design Studio
    Dashboard Migrator to Design Studio - Recent Webcast
    Dashboard Migrator - Xcelsius | Design Studio - SAP BusinessObjects - APOS
    http://events.asug.com/2013AC/Business%20Intelligence/0302%20SAP%20BusinessObjects%20Design%20Studio%20and%20Dashboards%…
    Design Studio dashboard application based on a Universe as a data source - Part 1
    --SumanT

  • How to use existing master data datasource as a enhanced datasource

    Hi,
    I have a requirement like this, 0FI_AP_0 is a datasource. But at my client side there were using this datasource as an Masterdata purpose.They are using this from past 3years. But due to the requirement changes I have to use that datasource and two more tables PAYR and REUGH in my cube creation.The report requirements are specifically from these tables BSAK,BSIk,PAYR,REUGH,LFB1 ,0FI_GL_4(This datasource is existing and using in the right way).
    How can I go head with this 0FI_AP_0 datasource. Can anybody please give some idea on this requirement.
    Thanks in advance for your all help.
    Points will be rewarded.
    Vamsi.

    0FI_AP_0 - go to the master data infoobject of this datasource. Check mark charercteristics is an export datasource in the master data tab
    Go to the infoprovider tab in RSA1, Insert this charecteristics as data target.
    Use export data mart of this infoobject in your cube creation. You can use this in update rules for update of cube

  • How to modify (add a new field) existing SOAP data source ?

    Dear Friends,
    I am getting data from Legacy databases (from different Views) mapped to the BW through XI.
    There is an existing SOAP Data source which is mapped to the non-R/3 source system Views through XI.
    My question is:
    Now I wanted to add a new field to the existing SOAP Data source, which will be mapped to the newly added field in the source system by XI.
    Please advice how could I modify the existing SOAP data source?
    Thanks,
    Venkat

    My plan is to add the new InfoObject(field)/BIC/ZXXX in the Datasource --> Map that field to the Info Object Zxxx in Comm Str.  --> Extras (menu) --> Create BW Data source with SOAP connection --> Regenerate the PROXY --> so that now the XI guys could map the new Infoobject in my Datasource to the new field in the Legacy database tables
    But why is that I am not able to add a new field in the Datasource ? I am trying this way: RSA1 --> Infosource tab --> Dbl. click on the existing Datasource --> here...I am trying to add new field in the Datasource...
    is there any other special place where I could add a new field to the existing SOAP Datasource ?
    Please help..?

  • Bursting using a Concatenated Data Source

    Greetings,
    I am trying to burst a report using a concatenated data source. I have a bursting SQL query set up that works fine, but I am unsure how to handle the "Split By" option. I have a data model that pulls data from multiple queries, like this:
    DETAILS_A
    select * from table_a
    where payee_id in (:p_payee_id)
    DETAILS_B
    select * from table_b
    where payee_id in (:p_payee_id)
    So, if I choose to "Split By" Details_A_Row/Payee_ID, then the data from Details_A is split appropriately, but the reports I generate don't split the information from Details_B properly. I end up with reports where one payee has information for another payee from the Details_B data source. How can I specify that the report should also split/filter the info from Details_B?
    To put it another way, what I'd really like to do is go through a list of parameters (payee IDs in this example) and generate a report for each parameter. Is Bursting the most effective way to do this?
    From searching the forums, it seems like I might be able to accomplish this using Data Templates as my Data Model instead of SQL Queries. Am I on the right track with that? If so, you guys have any helpful links on how to create Data Templates?
    I am using BI Publisher version 10.1.3.4
    Any help is appreciated!
    Martin

    For data template samples, check the following out and then download the zip file (you may not be able to run the reports, but you can view the code)
    http://blogs.oracle.com/xmlpublisher/2009/06/data_template_progression.html
    Thanks,
    BIPuser

  • How can I manage my data sources better?

    I'm learning WebLogic and my installation already has a data source configured to point to one of our eight databases. As we move through different phases of development, I need to point to a different database and changing it in WL is cumbersome. What I would like is to have all eight databases added as eight sources and enable only one at a time depending on our needs. I'd like to know:
    1) How does WebLogic know which data source to use for my .ear?
    2) With more than one data source, how do I ensure that only the one I want is used by my ear?
    Many thanks,
    TenLeftFingers

    It depends a bit on what you want to do (what you mean by "manage"), but perhaps this will help:
    Settings app > iCloud >
    http://help.apple.com/ipad/7/#/iPad995bbafe

  • How can i lookup a data source v5 in WSAD 5.1?

    Hi all,
    I'm using WSAD 5.1 to developer a web application based on J2EE 1.3 that have a simple java classes. My application uses a data source version 5 to have access the database. I?m using service locator pattern to lookup a JNDI but it dont work properly on stand alone java classes, only on EJB components.
    How can i lookup a data source version 5 from my java class on WSAD 5.1?
    Can anyone help?
    Thanks,

    Oh I did not realize that you were talking about a stand-alone application. You cannot use the server datasources in your stand-alone application.
    You can use the Oracle helper classes to construct a DataSource on the client side.
    http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html and driver specific documentation to achieve this. I will try to send a few links, if I find any.
    In a stand-alone application, you can use some connection pooling mechanism on your own.
    The ideal thing to do is to keep your data access in your middle tier (EJBs) and call the EJB's. This way you can reuse things in multiple client tiers and use the container provided datasource and connection pooling mechanisms.
    Hope this helps.
    Vijay

  • How to connect to different data sources in  XI 3.1 UNIVERSE?

    hi experts,
    We are going to migrate from BO 6.5 to  BO XI3.1.
    and we have different data sources to extract and generate the reports using various tools like Webi,Crystal Reports, Deski etc.
    1         How to connect to different data sources like SAP BI query, DB2, Oracle etc,, provide me the step by step solution.
    2     We need to migrate the universes and reports from BO 6.5 to BO XI 3.1 using the Report Conversion Tool.
    can we directly convert from the deski reports to Webi or do we need to migrate first through Import Wizard?
    3    Scheduling the Reports through Infoview
    4    Various issues and how to resolve those issues, we generally face while scheduling, and while creating the queries like for example time out errors etc..
    5    BO Security
    6    Universe creation with best practices and the loops,contexts,aliases etc..
    please provide me the step by step solution documents and links.
    thans in advance
    venuscm

    I would recommend to take a look at the official documentation. YOu can find this here
    http://help.sap.com
    NAvugate to SAP BusinessObjects->All products and the select the product you want eg. BusinessObjects ENterprise or Universe designer and the appropriate version XI 3.1. Take a look at the admin and the user guides.
    Currently the Data FEderator will allow you to buid a universe that access data from various data sources. Another option is to merge queries from different universes at report level.
    Regards,
    Stratos

  • Which user id is used in each data source?

    Using SQ: SSRS 2008 R2 - Beginner - Is there a report or query that provides which user ID is associated with the data source of each report? I need to be able to list out all the data sources being used and which user id is being used in the data source
    configuration instead of going to each report and using manage to review this. Any help is greatly appreciated

    Thank you - This is useful - but the username column is encrypted - how do I unencrypt
    as per my knowledge there is no way to decrypt it and below link confirm my understanding :)but there is work around also that have shared on technet;
    https://social.msdn.microsoft.com/Forums/en-US/f65b4d50-abaa-400b-a09d-ae1d7d1ea041/decrypt-the-connectionstring?forum=sqlreportingservices
    WITH XMLNAMESPACES -- XML namespace def must be the first in with clause.
    (DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2006/03/reportdatasource'
    ,'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner'
    AS rd)
    ,SDS AS
    (SELECT SDS.name AS SharedDsName
    ,SDS.[Path]
    ,CONVERT(xml, CONVERT(varbinary(max), content)) AS DEF
    FROM dbo.[Catalog] AS SDS
    WHERE SDS.Type = 5) -- 5 = Shared Datasource
    SELECT CON.[Path]
    ,CON.SharedDsName
    ,CON.ConnString
    FROM
    (SELECT SDS.[Path]
    ,SDS.SharedDsName
    ,DSN.value('ConnectString[1]', 'varchar(200)') AS ConnString
    FROM SDS
    CROSS APPLY
    SDS.DEF.nodes('/DataSourceDefinition') AS R(DSN)
    ) AS CON
    -- Optional filter:
    -- WHERE CON.ConnString LIKE '%Initial Catalog%=%TFS%'
    ORDER BY CON.[Path]
    ,CON.SharedDsName;
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • How can we create a data source on structures

    Hi,
       How can we create a data source on structures.
    Regs,
    abdul

    Abdul,
        Welcome to SDN!
        We can't create Datasource using Strcutres. We need to have base tables.
        For Function Module Extractors, we will create strctures. We will use these strctures as Extract Structures. But, we will get the data from Base tables only not from Strcutures.
    Strctures won't contain data.
    all the best.
    Regards,
    Nagesh Ganisetti.

  • How Get JDev to Omit data-sources.xml from every .war deployment

    I want a global data-sources.xml file to be used for all deployments. I do not want a copy of my standard data-sources.xml file to be included in every single deployment. I want my global data-sources.xml file to reside in the standard J2EE location of:
    oc4j_home/oc4j_instance_name/j2ee/config/data-sources.xml
    JDeveloper, for whatever reason, includes a data-sources.xml into every .war file. How do we configure JDev to omit the data-sources.xml? How do we set up JDev to automatically configure the .xml files (orion-application.xml, application.xml, etc) to use the global data-sources.xml? I do not want to manually do this for every deployment.
    I've been trying hard to find the answer in JDev online help and other OAS manuals. I read everywhere that I can have a "global" data-sources.xml, but I find no way to easily configure JDeveloper to do it this way.
    I would be grateful for you insights/help.
    thanks
    -Paul Janda

    I found the answer:
    In JDeveloper, Go to Tools | Preferences
    Select Deployment
    Uncheck the option for "Bundle default data-sources.xml during deployment"
    Upon the next generation of the .ear or .war file (including the next deployment), data-sources.xml will be omitted.
    -paul janda

  • Using a SQL data source and XML data source in the same template

    I am trying to develop a template for the Request for Quote report generated in Apps 11.5.10. I have loaded the data from the XML output into the template, but I am missing one field - I need the org_id from the po_headers table. Is it possible to use a sql data source (i.e., "select org_id from po_headers_all where po_header_id = [insert header_id from xml data]...") in addition to the xml data source to populate the template at runtime? When you use the Insert > SQL functionality is it static at the time the template is created, or does it call to the database at runtime? I've looked through all the docs I could find, but this isn't clear.
    Thanks for any help or suggestions you may have.
    Rhonda

    Hi Pablo
    Thats a tough one ... if you go custom with a data template you will at least get support on the data template functionality ie you have a problem when you try and build one. You will not get support on the query inside the data template as you might have gotten with the Oracle Report, well you could at least log a bug against development for a bad query.
    Eventually that Oracle Report will be converted by development anyway, theres an R12 project going on right now to switch the shipped OReports to data templates. AT this point you'll be fully supported again but:
    1. You have to have R12 and
    2. You'll need to wait for the patch
    On reflection, if you are confident enough in the query then Oracle will support you on its implementation within a data template. Going forward you may be able to swap out your DT and out in the Oracle one without too much effort.
    Regards, Tim

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • Can any one tell me how to use EXISTS clause inplace of IN operator.

    Hi All,
    Can any one tell me how to use EXISTS clause AND (JC.EMPL_ID, JC.EMPL_RCD) inplace of IN operator.
    SELECT COUNT (1)
    FROM SYSADM.OHR_PERS_CURR PC
    , SYSADM.OHR_JOB_CURR JC
    WHERE PC.EMPL_ID = JC.EMPL_ID
    AND (JC.EMPL_ID, JC.EMPL_RCD) in (
    SELECT HS.EMPL_ID, HS.EMPL_RCD
    FROM SYSADM.HU_SCRTY_JOB HS, ODSHR.OHR_SCRTY_USER_CFG OS
    WHERE HS.HU_SCRTY_CFG_ID = OS.HU_SCRTY_CFG_ID
    AND OS.DB_LOGIN = USER)
    Thank you.

    SELECT COUNT (1)
    FROM SYSADM.OHR_PERS_CURR PC
    , SYSADM.OHR_JOB_CURR JC
    WHERE PC.EMPL_ID = JC.EMPL_ID
    AND EXISTS (
    SELECT null
    FROM SYSADM.HU_SCRTY_JOB HS, ODSHR.OHR_SCRTY_USER_CFG OS
    WHERE HS.HU_SCRTY_CFG_ID = OS.HU_SCRTY_CFG_ID
    AND OS.DB_LOGIN = USER
    AND HS.EMPL_ID = JS.EMPL_ID AND HS.EMPL_RCD = JC.EMPL_RCD)
    But why ?
    Rgds.

Maybe you are looking for

  • Can I refactor this query to use an index more efficiently?

    I have a members table with fields such as id, last name, first name, address, join date, etc. I have a unique index defined on (last_name, join_date, id). This query will use the index for a range scan, no sort required since the index will be in or

  • Using SWL files with ActionScript 2

    Hi, Hopfully this wont get too drown out..I have a cisco DMP-4310g that can use flash files localy on the device i'm tring to find out what type of SWF files can be used. Here is a link to help... refer to the shockwave part  http://www.cisco.com/en/

  • Attatchments and innvoice

    Hello gurus This might be the wrong group for this question but i could not find any more suitable group. Our problem is this, for a period during a carv out, the system will be run over a Citrix solution. This works fine, but with only one small pro

  • DHCP 2008 R2 - MMC Cannot Initialize Snap-in when clicking on Address Leases

    I recently migrated my DHCP/DNS to a Windows 2008 R2 server. It generally seems to be working fine however, whenever I click on "Address Leases" within my scope it iterates all the leases and either at the end (or close to it) I just get the error "M

  • Delay between getting added to app store and showing up in search?

    My first app made it into the app store last night but still doesn't show up when searching the store (either in iTunes or on the iPhone). Does Apple do a daily reindex or something along those lines?