Forms Data Controls :: Multiple Data Sources For Datagrid?
Jan 17, 2011
I want to have one datagrid use two different data sources, the two datasaet I use have all the same cloumn names, the only difference is that the come form different databases. I wan tto have the data source be chosen by a dropdown list box. Is this possible or do I have to use two datagrid and just make on invisiable as needed.
View 1 Replies
Similar Messages:
Jul 16, 2010
I need to display some data in a gridview. Its shipping data.
Part of the data can come from a generic database query. Static shipping data that can be looked up from the database. Part of the data is external and has to be queryed from USPS. Any suggestions on what is the best way to accomplish this.
Should I just programmatically fill the gridview from the code behind doing the database lookup manual and filling the gridview with manual data then going out and filling the rest of the gridview with the data obtained from the USPS service?
View 2 Replies
Nov 19, 2010
I have a page in which i need to show data in the form of a grid. Each row in the grid is made up of 2 sub-rows, the first sub-row consists of a dropdown, a textbox & a textarea. Whatever is entered in these controls should be displayed in the second sub-row in the form of labels at runtime (i.e. using javascripts)
There can be multiple rows like this. The grid would have a max of 30 row, not more than that. create this which one would be better, in terms of performance & complexity, a GridView or a DataRepeater?
View 2 Replies
Aug 26, 2010
I've created a set of CrystalReports (*.rpt files) for an ASP.NET web app on a development server. I call each report using the following code:
[Code]....
When I transfer the *.rpt files to a different server, the reports display data from the development server; even when I change "Constants.DatabaseName" to point to the new server. It seems like the *.rpt file saves the database connection information from the ODBC File DNS used when creating the report.Has anyone experienced this problem? I'm looking for a solution so I don't have to create multiple copies of my *.rpt files for each server environment (i.e., Dev, Test and Production servers).
View 2 Replies
Feb 1, 2011
So I have been trying to follow serenarules posts about persistence layers, but I seem to be missing something.
The persistence layer is an architectural layer whose job is to provide an abstract interface to information storage mechanism(s).
This makes sense to me, but I am still having a hard time with this.
So in what cases is this necessary? When you are pulling similar data from multiple information sources?
View 7 Replies
Feb 5, 2010
I am writing a currency converting module for one of our applications. I have a list of products, a list of currencies we are interested in seeing prices for, and a list of currency rates. I want the user to be able to select which currencies from the list they see in the GridView. I also want to be able to amend my list of currencies and include a new currency, without having to make additional changes to this module. So my GridView display has to be "dynamic". Essentially I am planning on ending up with a GridView that has the following columns:
Part No - Description - USD Price - AUD Price - GBP Price
The USD price would be static as it's our base currency, the AUD and GBP are user selected and could have potentially any number of currencies listed. I would normally use a DataSet and DataTables for this work, but I am sure there is a "better" way to do it using System.Collections.Generics. Right now I have all of the data I need in List collections, but there does not seem to be a way to define how these collections relate to each other, or combine these collections into one so it can be bound to a GridView. Should I be looking at something other than List to achieve this or do I need to go back to my original approach of a DataSet and DataTables.
**UPDATE / SOME CODE**
I will explain a little bit more about what I have setup so far.
1) List of Products & Currencies - These come from an SQL DB via LINQ, so they can be any of the System.Collections.Generics objects, e.g. List, IEnumerable etc.
2) Currency Rates - These I am pulling from the European Bank public XML file. I download the file, strip the data I need out of it and currently store that as a List object.
I could store the currency rates in the database table as well, but then I have to have some sort of background process that goes and updates the rates each day. This way the rates only get updated when someone accesses the report function (which is only going to happen occasionally). So I would rather grab the latest rates "on demand". What I know I need to end up with is some object that has the following structure:
PartNo - Description - Base Price - Currency Price 1, Currency Price 2, Currency Price 3
Where the number of Currency Prices is undefined, as it's based on what currencies the user wants the report to display. It's the undefined part that I am struggling with, essentially how can I create a structured object, that I don't know the complete structure of until runtime?
View 1 Replies
Feb 23, 2011
I have one view page (MyView.aspx) and many data sources to bind on this page. Lets say it has Books, Publishers, Comments, etc. Each one of those has an object which provides a List, List, etc. In my view, what are my optiosn for multilple model biding? I want to check to see if each one is empty, and then enumerate it. But I can't check Model.Count() because wouldn't Model be made of all those objects if I set the page to inheriet from? What are my options? Should I load each content area in a control/partial view? Or can I just dump each object into ViewData and then check the count by casting in the view?
View 2 Replies
May 25, 2010
I am trying to display a gridview with element names bound to a datatable (transformed from OracleReader) and also display two contact dropdowns inside the gridview. For each record in the datagrid i want to display these dropdown lists that will also be bound to two different datasources. How would I accomplish this?
View 9 Replies
Mar 9, 2011
I have a repeater like so:
[Code]....
Problem is, I also want to show the viewer the available number of spots in the room. But this requires somehow pull in either the current_occupancy / max_occupancy or in performing a calculation (e.g. max_occupancy - current_occupancy = actual_available) and then returning that with the room.
The end result I'm looking for is to return each room in a button control with text that looks like this:
"Room 1 - 2 Open" "Room 8 - 1 Open" and so on
View 2 Replies
Mar 31, 2011
so I know that DataTables are often used as the DataSources for gridviews. Lately, I have found that I can also use generic lists as data sources for gridviews. But I figured that out by simply trying it to see if it worked.
I have looked all over the web and simply cannot find any kind of inclusive list or description of exactly which data structures can be used as the data source for a gridview. Does anyone know if there is such a list, or some kind of reference that I can look to for this info?
Although it sounds like an obvious question, like there is obviously one out there and I just haven't looked, my experience has been that it's just not so.
View 1 Replies
Jan 31, 2011
I have a stored procedure written using dynamic SQL in the SQL Server and I am calling it on the code behind and adding parameters to it and filling a dataset and binding the data set to a Gridview. But I am getting this error when I bind it.
Can someone please tell me how to fix this?
It used to work fine when I did not use dynamic sql.
Line 237: da.Fill(ds);Line 238: gviewInvestigations.DataSource = ds;Line 239: gviewInvestigations.DataBind();Line 240: Line 241: }
Source File: s:Cybage2CybageSourceCodeGulfcoastGulfcoastControlsInvestigationsControl.ascx.cs Line:
239
Stack Trace:
[Code]....
[HttpException (0x80004005): The IListSource does not contain any data sources.] System.Web.UI.DataSourceHelper.GetResolvedDataSource(Object dataSource, String dataMember) +8665698 System.Web.UI.WebControls.ReadOnlyDataSource.System.Web.UI.IDataSource.GetView(String viewName) +41 System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +128 System.Web.UI.WebControls.DataBoundControl.GetData() +4 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +60 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 Controls_InvestigationsControl.bindSearch() in s:Cybage2CybageSourceCodeGulfcoastGulfcoastControlsInvestigationsControl.ascx.cs:239 Controls_InvestigationsControl.btnSearch_Click(Object sender, EventArgs e) in s:Cybage2CybageSourceCodeGulfcoastGulfcoastControlsInvestigationsControl.ascx.cs:323 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
View 2 Replies
Jul 29, 2010
I'am developing a commercial website using vs2005 and sql2005 in which i want to display the images from the datagrid in three columns,as
1 2 3
4 5 6
7 8 9
View 8 Replies
Mar 17, 2010
We are using a tierd design with a Data Access Layer and classes for everything we need. This serves as an advantage because we do not have to write querys over and we can separate the Presentation layer from the Data Access Layer and Business Rules.I have always in the past populated GridViews, DataLists, repeaters,etc with SqlDataSources. This is what I have become accustomed to and I feel like it is simple. For querys such as Select * from Members, I feel like using a DataSource is simpler than having to go in the code and calling methods to populate and DataBind these presentation controls.
I am working with a gentleman who has introduced me to the world of Data Access Layers and we are breaking everything down into simeple, but effective queries to populate controls and do what we need to accomplish with this application. He is not very approving of using any type of DataSource. We are disagreeing on the time and place to use these class methods to call the database.So my question is, which is more widely used in the programming world? Do most people use DataSources to populate presentation controls regardless of the Data Access Layer they are working with? Which type of queries are best suited for a DAL - simple, populating queries or complicated joins and upserts?
View 9 Replies
Apr 12, 2010
I developing a application in Asp.net3.5(C#) and Sql server2005, my problem is that i have to Import data from diffrent-2 data sources like MS Access, Oracle, ODBC, XML to my Data base(in Sql server) using C# code. I don't know any thing about importing data from these data sources.
View 1 Replies
Sep 20, 2010
I have a gridview which sources information dynamically from database.
Here when i go for the default "AllowSorting" flag equal to true, i am able to achieve sorting of all displayed columns except the textBox control column whose values refreshes to zero.
View 2 Replies
Sep 30, 2010
I have "Order" object with Columns Ticket,OTP and CustomerName etc.Intially on DataGrid, I'm binding Ticket only , when user clicks on "Column Chooser" button, another windows appears to pickup CustomerName,OTP columns to add specified column dynamically on Datagrid. Environment : Asp.net ,C# with Object Data source
Public Class Order
{
publc void Order()
{
}
public string Ticket
{
get
{
return this.strTicket;
}
set
{
this.strTicket = value;
}
}
public string OtpNumber
{
get
{
return this.strOtpNumber;
}
set
{
this.strOtpNumber = value;
}
}
public string CustomerName
{
get
{
return this.strCustomer;
}
set
{
this.strCustomer = value;
}
}
}
}
View 1 Replies
Apr 6, 2010
I have 2 grids gvParent & gvChild I would like to filter gvChild when a row is selected in gvParent the linking fields are contractNo
I added a column for selecting:
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select"
OnClick="LinkButton1_Click" Text="Select"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
I know how to handle the filtering of the grid (create a criteria and set to rowfilter of the dataview) But, I dont know how to get the value of the column of the selected row.
View 5 Replies
Mar 4, 2011
I have Datagrid , i want to clcik on row and get data in textbox , but my textbox is FreeTextBox control,i tried to use javascript but work for asp.net control not working for freetext box control, how i can capture this code is sample code but it work for asp.net control but not working for my freetextbox
[Code]....
View 1 Replies
Sep 22, 2010
Simply put... I want to duplicate the example found at this link, in VB.net rather than C#.
[URL]
I would like the selectedvalue of the dropdown to display additional data base on its selection in multiple text boxes.
I have tried using the DropDownList OnSelectedIndexChanged property, within a DataGrid EditiItemTemplate, but I cannot retrieve data from the selection. (AutoPostBack is "True"). I can however use a button onclick event to fire a "prre-defined" selection value.
View 2 Replies
May 27, 2010
I have 2 datagrid (using .net 1.1). I need to access column of second grid ( i need to make a column of second grid as disabled) when i click "Cancel" link button in First Grid. How can this be done?
View 7 Replies
Jan 12, 2010
I need to create a query which does a join between two tables which are in different databases. I can easily connect to each database, and write queries in each, however, I can't seem to find a way of generating a query which does a join between two tables from different databases.
View 2 Replies
Jan 8, 2010
I had called the data from query to data table and now i have a gridview in which i am using one datalist and 2 text boxes and and reming coloumns are bounded iahve to assiaign them values which datatable have either null or any value.
View 2 Replies
Feb 6, 2010
I just installed the SmallBusiness Starter kit from MSDN. I believe the starter kit by default points to MDF and LDF files in App_Data folder but I would like to use my SQL server instead. Could you please provide me with instructions on how to convert these two files in actuate tables in SQL server?
View 5 Replies
Oct 10, 2010
I have a datagridview control that I'm using to display cache data to the end used on a web form. The issue that I'm having is that every time I re-run the application, and the cache data is re-generated... it loads duplicate data that's being displayed to the end user. I can't seem to figure out how to keep this from happening.
What I would like to have happen is that only unique data rows be returned and cached for the end user. Unless there are new data rows on the database that needs to be included in the cache data results...the previous data results should not be duplicated. I've tried to change a few properties on the datagridview control, but nothing seem to keep this from happening.
[code]....
View 3 Replies
Feb 1, 2011
I have gridview with 3 columns and one textbox in each column. My requirement is when i paste 3 cells of copied data from excel to textbox in first column of gridview automatically 2nd cell data has to be pasted in textbox of 2nd column and 3rd cell data to textbox of 3rd column of gridview. How can it be done and can anyone provide the best code.
View 3 Replies