datasource

Manipulating DisplayMember before it is displayed

Let's say I am using databinding like this: List<Entity> Entities = <some data> entityBinding.DataSource = Entities; lstEntities.DisplayMember = "Description"; which works fine. However, I want to manipulate the string coming back as the Entity's "Description". How can I call a function on DisplayMember? ...

Websphere 6.1, Datasource, two apps

Hi, I've got a webapp running on a Websphere 6.1 Server which JNDI lookups for a datasource. This webapp runs fine, the Websphere server recognizes the datasource ref in the web.xml etc.. Now we added a second webapp which should use this datasource with same configuration but I recieve a ClassCastException when I try to access the da...

How to set up jndi.properties for DataStore?

I'm struggling to set connect a Java program to MySQL using JPA/Hibernate. I'm currently getting the following error when I try to call createEntityManagerFactory(): [main] ERROR org.hibernate.connection.DatasourceConnectionProvider - Could not find datasource: java:jdbc/myDataDS javax.naming.NoInitialContextException: Need to specify ...

How to change a Datasource's username/password at runtime in a J2EE app?

I've deployed a web-module which connects to the database via a datasource configured in the J2EE application server. Currently, the user/password for the database connection is set in the proper J2EE application server's datasources configuration file. I want to change during runtime the datasource's user/password. (e.g.: implement a ...

Sharing a custom datasource between Winforms and Webforms

Hello, I'd like to create a custom datasource that is shared between a Winforms and Webforms project. This functions as a middle layer for a reporting tool(DevExpress Reporting). The Webforms project is a designer for these reports. So we want for the reports to be capable of going to the server to get data and such. So our datasource wo...

winforms datasource PositionChanged validate previous object

In my appplication I have a ListBox with items in the left panel and in the right panel I have the item details. If user click a new item in the listbox and if the current item was changed I want to ash the user if he wants to save changes or discard them. The way I am doing now is on SelectedIndexChanged of the listbox to remember pre...

What is the difference between a DataSource and DataAdapter?

Title says it all. What is the difference between a DataSource and DataAdapter? I'm trying to decide if I should descend from IDataSource or IDataAdapter for code to be shared between Winforms and WebForms and I can't seem to figure out what the difference is other than slightly different ways to use them. ...

Executed Query Source

Where is the value of the actual query executed for an AccessDataSource with the parameters replaced with actual values? Note: Answers in VB.NET or C# are fine. ...

Using a dropdown on a static webpage as a DataSource in C#.net

I know this is a terrible way of doing things, but it's for an internal app where security is no issue. Basically, an old group created a php page with a drop down and this drop down is populated with entries from a DB. The DB owner is currently absent and for the sake of time, I would just need something that turns the entries in that...

automatically refresh datasource in different instances of windows forms C# application

I have different instances of an [.NET 3.5] C# win forms application that run on different machines. All instances use the same SQL 2005 db. I need to send an alert and to refresh grids [contained in user controls] when another instance of the application changes smth in db. Which is the best way ? Thank you very much. ...

Does anyone have some JMX code for creating a new websphere datasource ?

Hi guys, I'm trying to update the password on a websphere J2C datasource connector using JMX. Does anyone have any source or tips ? cheers, Trevor ...

DataSourceID vs DataSource - Messing with my Custom Repeater

I have made a Custom Repeater. In the DataBind event, I am using a PagedDataSource (which persists) and I am determining how to grab my data from there. This works fine when I bind a datasource directly to the control. However, when I use the DataSourceID property, it binds the data, but my PagedRepeater doesn't work anymore. This leads ...

How do I get entity for primary key when using EntityDataSource in ASP.NET

I have a GridView in my ASP.NET application that takes data to be rendered from EntityDataSource. GridView allows user to select rows. I want to get the entity that corresponds to the row user selected. I can get from GridView the ID(primary key) of the entity that corresponds to the row selected. How can I get the Entity that has partic...

Passing DataSource object from a servlet to a JavaBean

I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data to avoid having that lookup code in the bean? ...

Switching DataSources in ReportViewer in WinForms

I have created a winform for the users to view view the many reports I am creating for them. I have a drop down list with the report name which triggers the appropriate fields to display the parameters. Once those are filled, they press Submit and the report appears. This works the first time they hit the screen. They can change the para...

Open JdbcTemplate connection in read only mode (Spring framework)?

Hi, is it possible to open a JdbcTemplate connection in read only mode, so that I can't perform any changes to the underlying data source? ...

WPF application with MS Access database as a data source

I have a Microsoft Access 2010 database(*). Now, using Visual Studio 2010, I want to create a WPF application and add the database as a data source. The app will have a window with a frame that provides navigation through pages. No problem so far. But: -What is the right way to set up the database in this scenario? Tables only? Or must ...

How to conditionally disable a detailsview databound field

I have an ASP.Net detailsview control. Its DataSourceId varies and I set it in Page_load accordingly... (based on LLBLgen sub types, but this is not too important) I guess this is a page lifecycle leaky abstraction I am not "getting". The problem is that I bind to fields that may or may no be there depending on the datasource... To "d...

Can I use multiple data sources in a single stateless session bean (EJB3) ?

Hello, Does anybody know whether I can use multiple data sources in a single stateless session bean in EJB3? I want to develop a session bean to aggregate a lot data and return, but these data comes from 2 data sources, is this possible? Can someone provide a sample on this? Thanks very much ! ...

ASPxGridView -- How to simply add example values with only a DataSource property?

Hello I have a ASPxGridView. In it(for the uninformed) is only a DataSource property for telling it what data to load. My problem is that I'm simply trying to mock up an example and don't need to tie it to an actual database. How would I do this? I basically just want a few rows and some columns but since it only takes a datasource I'm n...