Cannot use same sql datasource for formview - working for gridview

Hello, I have problem that is confusing me...

I am using a gridview on page1 that when selected navigates to page2 queried by the ID. On page2 i have a gridview which uses a sqldatasource using the query parameter of the ID taken from Page1. I have this working, but when i try to replace the gridview with a formview (with the same sqldatasource) i get the following error:

'System.Data.DataRowView' does not contain a property with the name 'publicationID'

Why can i not use the same sqldatasource in the formview??

 Kind regards,

0
gcp2985
1/28/2008 6:47:25 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

4 Replies
743 Views

Similar Articles

[PageSpeed] 24

Hi,

Where you getting that error? Can you post more details?

Check this link, maybe this will give you some idea..

http://msdn2.microsoft.com/en-us/library/ms227970(VS.80).aspx

 


Always remember to click "mark as answered" when you get a reply which answers your question.
0
nsuneel
1/28/2008 7:52:17 PM

Hi gcp2985 ,

gcp2985:

'System.Data.DataRowView' does not contain a property with the name 'publicationID'

This means that "Container.DataItem" in your line of code is evaluating to an object of type "System.Data.DataRowView" which does not have a property called 'publicationID'.

So please double check the underlying datasource to see whether there is one filed called 'publicationID' .

 

 



Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
0
Samu
1/30/2008 3:00:51 AM

The problem seems to be that the SQL datasouurce you are using does not have  the property(column, field) named 'publicationID'  but You have tried to bind that field in the form view. Try checking if the field is there in the sqldatasource or not, or if it should be in the form view or not


Vikram
www.vikramlakhotia.com


Please mark the answer if it helped you
0
vik20000in
1/30/2008 3:05:19 AM

Thanks Samu and Vikram that was indeed my problem! :) Its sort now

Many thanks for your help!

 

0
gcp2985
1/30/2008 9:08:15 AM
Reply:

Similar Artilces:

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

How to change the SQL used for the GridView, when using a control parameter in the datasource
I'm using a GridVeiw with and Access database. I want to allow users to select a date and then update the GridView to show only data entered after that date. So my question is, how do I modify the SQL used by the datagrid? I'm using a control parameter as part of my AccessDataSource and I think that is what I'm having trouble figuring out how to include. Here is my datasource, with the control parameter in the the GridView. The GridView works fine with these initial settings settings. <asp:AccessDataSource ID="AccessDataSourceForwView" runat="server" ConflictDetection="Compa...

How to: 2.0 Encrypting Field Data Using a Formview Control and a Gridview control for SQL
The Exercise: Using a Formview Control and a Gridview control to Encrypt data going into SQL, Decrypt it for display, and Be able to Edit it. Using Visual Studio 2005 ASP.NET 2.0 Framework   Files needed: – QSEnc64.vb to be placed in the App_Code folder of your application TestInsertEdit.aspx in the root of the application TestInsertEdit.aspx.vb in the root of the application A Web Config file with a valid ConnectionString Your_SQLConnectionString A SQL Database that you can add the test table to (see script below)   Hopefully this exercise will save you the time it to...

code for Custom paging without using sqldatasource control and sql datasource control for gridview...........
 code for Custom paging without using sqldatasource control and sql datasource control for gridview...........i need code for how to show all pagenumbers in gridview with custom paging in gridview..............It is very urgent................................. T.Ashok Kumar  suppose that we have a table like thisCountryId  identity intCountryTitle    nvarchar(50)you can use this sql command for paging the dataUSE [CyberOffice]GO/****** Object:  StoredProcedure [dbo].[CountryGetListPaged]    Script Date: 09/17/2008 14:01:06 ******/SET A...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

(master/detail) control using gridview and formview controls problem...
hi guys, i'm new to .net programming and have been toying with the (master/detail) control using gridview and formview controls...however, i can't seem to drilldown to the correct record when the primary key is a composite key. please help....   <asp:GridView ID="GridView1" runat="server" DataKeyNames="ServiceID,VersionNum" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"               &nbs...

Looking for a beginners tutorial or guide on using GRIDVIEW control with FORMVIEW control
what i want to be able to do is add a gridview control onto the page.. have it display my results then have a link to take me to another page where they can edit the data if needed I have a current project im working on that i have a search function on the top part and that value us passed into the GRIDVIEW below it and displays records.. each of those records has a link to a edit page.. since the gridview is merely a small teaser of all the data for the records.. the next page will display ALL fields for that record within a FORMVIEW.. The itemtemplate displays all the data in a nice fo...

Problem using two gridviews when using selected value of 1st to control datasource of 2nd
 I have a page with 2 gridviews. When you select a row in the first gridview, the DataKey of that row gets passed to the second gridview, which then displays a list of related records. I've read at http://www.asp.net/learn/data-access/tutorial-08-cs.aspx that there can be issues around page lifecycle timing that can affect what I'm doing so I've tried to follow the instructions there. However, I'm still having problems.Here's the flow of what I want to happen:a) User clicks row in gridview1.b) Postback occurs.c) gridview1 is selected, gridview2 shows records relating...

Gridview Filter using Dropdown where dropdown is populated from a distinct list in the Gridview
I have a report page that shows the user who accessed pages, when they accessed it, and the page they accessed.  I have it attached to some dates, so they can easily filter the search down.  What I want to do is to further filter the list with a dropdown of users, so they can see which user viewed what pages over a certain time frame.  I know how to query the database for a list of users and then populate the dropdown with all the users...then attach that dropdown to the sqldatasource for the gridview to filter it down by user.   But, what if I just want to popu...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

Gridview linking to formview but NOT using formview.pageindex = gridview.selectedindex
I would like to be able to open my Formview based on my selection in Gridview. I don't want to use formview.pageindex = gridview.selectedindex (ie using selectedIndexchanged) because if a row is deleted in my source table (both Gridview and Formview have the same datasource)  then my selected index will not match up properly to my formview.pageindex. So what I want to do is open Formview based on the primary key of the table. - ie when I click the GridView, the formview is then opened based on the key of the value in the GridView selection. Can anyone point me in the right dire...

How to use ADO.Net with Formview control?
 Hi everyone.  I am using ADO.Net(code) to Insert,update,delete,select record into the database.  i have a user input form and formview in my project.   When i enter user info and click insert button the data in the input form gets saved in the database as well as the form gets redireted to  formview.aspx.  But i m not able to extract the values from the database and show it in the formview.  i know i can do this using SqlDataSource. But i want to use code to bind the record to the formview instead of using sqldatasource or objectdatasource. any s...

Using MultiView for a GridView and a FormView Control
I have three tables where the Identifying key is CLientID - one table has CLientID as Primary and two tables are foreign.  I have set up a RadioButtonList1 to select a client from the Client Table.  I have a RadioButtonList2 that a user can select either Cars (RadioButton1) or Investments (RadioButton2).  When a user selects a CLient and then selects Cars, View1 of the Multiview will display the cars from the cars table for that Client.  When Investments is selected, View2 displays the investments for that client from the investment table.  Let's say a ...

Custom Datasource Controls Vs. Object Datasource Controls
Hi folks,I am a web developer developing pages in the project. I need to integrate the front end pages with the backend API. Active directory is being used as the database system for our project. I only use the API and the methods offered by it to interact with the data.For all the operations on the data, I have methods that I can call from the API (viz. Create(), Delete(), Modify() etc.). For connecting the data to my frontend data controls (viz. GridView, DropDownList etc.) I can use Object Datasource Control. I also read some articles about Custom Datasource controls. Now, I am having a d...

Web resources about - Cannot use same sql datasource for formview - working for gridview - asp.net.presentation-controls

Datasource - Wikipedia, the free encyclopedia
A DataSource object has properties that can be modified when necessary. For example, if the data source is moved to a different server, the property ...

Inverness Graham Acquires DataSource
Inverness Graham , a lower middle market private equity firm headquartered in suburban Philadelphia, has acquired DataSource , a print supply ...

SmartGlance for iPad for iPad on the iTunes App Store
Read reviews, get customer ratings, see screenshots, and learn more about SmartGlance for iPad on the App Store. Download SmartGlance for iPad ...

Chaitanya Pandit (@chaitanyapandit) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Data source - Wikipedia, the free encyclopedia
... Data source A data source is any of the following types of sources for (mostly) digitized data: a database in the Java software platform, datasource ...

2ndQuadrant - PostgreSQL expertise from specialists with a source code level understanding of RDBMS ...
PostgreSQL expertise from specialists with a source code level understanding of RDBMS PostgreSQL Planets Gabriele’s PlanetPostgreSQL Gianni’s ...

Tagged entries for CLOUD COMPUTING
Alan Williamson's output as a Java Champion, Blog-City Architect, BlueDragon Creator, Author, Speaker and Internet Guru

Private equity deals
... of biometric identity management systems, applications and services. www.crossmatch.com Inverness Graham Investment has acquired DataSource ...

C# C Sharp and Tutorials on C# Friends.com
Learn the c# langauge to build web applications using our online tutorials with live demos. Participate in our forums and learn from others. ...

JavaScript UI Library, Ajax Components & HTML5 Framework - DHTMLX
DHTMLX offers a rich JavaScript library, UI components & HTML5 mobile framework. Build impressive web apps for both desktop and mobile devices. ...

Resources last updated: 1/10/2016 5:46:02 AM