.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

FormView Error when inserting

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

When doing an insert using a FormView i get the following error.

"Could not find a property named 'Project.IID' on the type specified by the DataObjectTypeName property in ObjectDataSource 'UserStoryDataSource' "

Other posts have suggested removing the value from the DataObjectTypeName. Which I have done but that just results in the error "ObjectDataSource 'UserStoryDataSource' could not find a non-generic method 'Save' that has parameters: ListItemID, UserStoryID, Name, Project.IID, AsUser, Action, Reason, Priority, Complexity, Story."

I think the error has something to do with the binding the Selected Value of the Project drop down list to the Project.IID property of the UserStoryDTO class.

What is the cause of this error and how can i fix it?

The insert Item template and datasource code is below.

                <asp:Label runat="server" AssociatedControlID="ListItemIDTextBox">ListItemID</asp:Label>
                <asp:TextBox ID="ListItemIDTextBox" runat="server"  Text='<%# Bind("ListItemID") %>' />
                <br />
                <asp:Label ID="Label1" runat="server" AssociatedControlID="Lis

View Complete Post

More Related Resource Links

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

DropDownList within FormView Error

I have a FormView which works find and I have added a new DropDownList within the form which references another table to which I need to select a value,
I have added the dropdownlist2 and setup a new connection string to this, when I run the page I get this error:

Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'DropDownList2' in ControlParameter 'CurrencyID'.
any help would be greatly

Cast error when inserting record with Linq (to Sql)



I'm getting  the following error message: 

Unable to cast object of type 'System.Data.Linq.DataQuery`1[Username]' to type 'Username'.

I've been searching but can't find a solution.  This particular table has 4 columns. The first column is the int indentifier.  Column 2 is "username" (varchar50) and is the primary key.  Column3 is "userID" (uniqueidentifier) and column 4 is "active" (varchar5) .

            Dim dc As New DataClassesDataContext
            Dim c3 As New Username With {.userID = userGuid, _
                                    .username = userCustomName, _
                                    .active = "False"}


        Catch ex As Exception
            Throw ex
        End Try


Flat file upload: Error when inserting into datetime field.

Hi All I am having an issue with uploading a txt file into an SQL table and one of the fields needs to go into a datetime column. The issue is with column3 I have been into the advanced editor of the flat file source and set the output column to decimal and it fails. The error I am getting is below: Error: 0xC02020A1 at Materials Transfer, Flat File Source [1]: Data conversion failed. The data conversion for column "Column 3" returned status value 2 and status text "The value could not be converted because of a potential loss of data.". Error: 0xC0209029 at Materials Transfer, Flat File Source [1]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "Column 3" (48)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "Column 3" (48)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure. Error: 0xC0202092 at Materials Transfer, Flat File Source [1]: An error occurred while processing file "D:\Development\r3_downloads\mat.txt" on data row 1. Any help would be great.   Thanks BigGopher

Update in formview doesn't work, but I don't get an error message?

I have a datasource:<asp:SqlDataSource ID="MySQLProfielDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:WAPMySQLConnStr %>" InsertCommand="INSERT INTO usergegevens(UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum) VALUES (@Param1, @Param2, @Param3, @Param4, @Param5, @Param6, @Param7, @Param8, @Param9, @Param10, @Param11, @Param12)" ProviderName="<%$ ConnectionStrings:WAPMySQLConnStr.ProviderName %>" SelectCommand="SELECT UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum FROM usergegevens WHERE (UserId = @Param1)" UpdateCommand="UPDATE usergegevens SET Geslacht = @Param1, Voornaam = @Param2, Tussenvoegsel = @Param3, Achternaam = @Param4, Adres = @Param5, Huisnummer_toev = @Param6, Postcode = @Param7, Woonplaats = @Param8, TelnrV = @Param9, TelnrM = @Param10, Geboortedatum = @Param11 WHERE (UserId = @Param12)" onselecting="MySQLProfielDataSource_Selecting" onupdating="MySQLProfielDataSource_Updating" onselected="MySQLProfielDataSource

error in inserting data into the datasource


hello all i have a gridview and textbox i want to insert the data that typed in the textbox  into the gridview i can do this but in other culomn i just can insert number 
and when i type some world the error say:Invalid column name'every thing ' 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="soal.aspx.vb" Inherits="soal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <style type="text/css">
            width: 100%;
<body bgcolor="#fe9cef">
    <form id="form1" runat="server">
    <table class="style1">
                <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 

Compilation error after inserting script


I have a one page ASP.Net site; there is no separate code-behind file.  It pulls its data from a SQL ODBC connection; All was well, until I tried to include script to change the color of the row, based on a condition.  Normally, the backcolor is black; and the forecolor is white; the forecolor should change to blueviolet when the field "flex_in" is not null.  Here is the code:


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

ORA-06550, PLS-00306; Error inserting data to Oracle procedure.


I have tried to troubleshoot this problem but to no avail. I get error while inserting a big chuck of data to Oracle package containing procedure 'INSCRAPP'. The error message is,

ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'INSCRAPP' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

The C# code is big but I am providing the parameters I am passing,


                OracleParameter param_fName_in = new OracleParameter("fName_in", OracleType.VarChar);
                param_fName_in.Value = FirstName;
                param_fName_in.Direction = ParameterDirection.Input;
                OracleParameter param_mi_in = new OracleParameter("mi_in", OracleType.VarChar);
                param_mi_in.Value = MiddleInitial;
                param_mi_in.Direction = ParameterDirection.Input;

                OracleParameter param_lName_in = new OracleParameter("lName_in", OracleType.VarChar);
                param_lName_in.Value = LastName;
                param_lName_in.Direction = ParameterDirection.Input;

                OracleParameter para

getting error while inserting values into table in sql server 2005

i have connected to sql server n my connection string is

conn.ConnectionString =

"data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\subi.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"

But i am not able to insert values into the table..

am getting sqlexception error.... and msg as invalid object name "staff" as staff is my table name.. before this i had some problem with connection then i cleared that problem then after that this problem occured.. plz guide me on this ... i need to complete my project as soon as possible

FormView Disappears or gives a SQL Conversion Error


I am using a gridview for control parameters for a formview on the same page.

I keep getting the SQL Error below.  I have painfully looked through the code to see what the deal is and I have a feeling it has to do with the control parameter. When I test the query in the wizard it gives me back what I should get back.

When I run the page and code I get the error below. This value is the CorpID and it is a varchar. So I am thinking the way the parameters are configured is not correct.

I have no issues with the Insert Template, just the edit template. So it eithers gives me the SQL error or the Formview does not appear.

Any guidance on how to map the parameters from a GrdiView would be aprreciated.

SQL Error:Conversion failed when converting the varchar value 'X123456' to data type int.

SQL for Form View

select userid, FirstName , LastName ,PermissionLevelDesc, a.Permissionlevelid as permissionlevelid,
case active_flg when 1 then 'Active'
else 'Inactive' end as Active_Status,active_flg,CorpID
from dbo.NPE_APP_Users a inner join dbo.NPE_APP_SEC_PROFILE b
on a.PermissionLevelID = b.PermissionLevelID
where userid = @userid and corpid=@corpid and a.permissionlevelid=@permissionlevel

Receiving a fatal error 3624 @pageref.cpp:913 inserting into an empty table


Hi guys,

I'm using Integration Services to insert rows into a SQL Server 2008 table, and I'm receiving an error - only when the table is empty before the insert.  I use SSIS quite frequently, and this is the first time I've seen this kind of issue.  Since I'm getting some internal errors that seem related to the engine in the reports, I figured I'd post here for ideas.

Here's the dump from the Agent job that runs the package:

Executed as user: CORP\_DWAdmin_Service. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  8:38:29 PM  Error: 2010-10-11 20:39:14.14     Code: 0xC0202009     Source: Insert New Records DIM_CUSTOMER [6]     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Warning: Fatal error 3624 occurred at Oct 11 2010  8:39PM. Note the error and time, and contact your system administrator.".  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x800

Display error when inserting table in Content Editor Webpart


I've got a MOSS 2007. I want to insert a table into the Content Editor Webpart using the Rich Text Editor. I am choosing "Insert Table" and the new window occurs. But I can't do anything.

The buttons in the format section are not enabled.

There are a lot of display errors. (I wanted to upload an image but I don't know where...) The display errors are pictures with the name "TRANS.GIF" lying in the images folder of the 12Hive. There are several of these images maybe to align the context.

To summarize:

  • I can't use the "Format"
  • There are disply errors (images) in the dialog
Can anybody help me?

Interesting javascript error with formview


hii.. I have a formview which implements the edit, delete and new operations on database. The form is working absolutely fine. But now i had inserted the code of the formview into a modalbox created through javascript.

The form now displaying the data perfectly. But, when i click on any buttons to do any operation.. it is throwing an exception at the following line..


and the exception throwed is

Microsoft JScript runtime error: Object expected

Can some one tell me what is the problem..

I want to post to server from the modalbox form. Please explain if we can directly post back to server from modalbox or not ?

inserting script gives error?



i am tryingto insert javascript 'add this' button into my asp page.

i am placing it between the body tags as instructed, but i get the error:

The string 'fb:like:layout' contains too many device filters. There can be only one.

this is the code i was given my add this, so should be right, sdo why is it not working? maybe because the application is not online but local?

can someone syggest why it doesnt work?


<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>

<a class="addthis_button_tweet"></a>
<a class="addthis_counter addthis_pill_style"></a>
<a href="http://www.addthis.com/bookmark.php"

Error inserting new records


Hi i am trying to insert new records by using a stored procedure with the following code:

Dim Connection
Dim Command
Dim Records
Dim Count
Dim CurrentService

Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open Application("conn")

Set Command = Server.CreateObject("ADODB.Command")
Set Command.ActiveConnection = Connection
Command.CommandType = adCmdStoredProc 'Call the stored procedure here

Select Case Request("Action")
	Case "Create"		
        Command.CommandText = "spTaxiBookingCreate" 'Call the type of stored procedure here
		Command.Parameters.Append Command.CreateParameter("@theDate", adDate, adParamInput) 'Append Parameters
		Command.Parameters.Append Command.CreateParameter("@theTime", adDate, adParamInput)
		Command.Parameters.Append Command.CreateParameter("@Location", adVarWChar, adParamInput, 50)
        Command.Parameters.Append Command.CreateParameter("@DropOff", adVarWChar, adParamInput, 50)
		Command.Parameters.Append Command.CreateParameter("@Paid", adInteger, adParamInput)
        Command.Parameters.Append Command.CreateParameter("@Notes", adVarWChar, adParamInput, 3600)
		Command.Parameters("@theDate") = Request("theDate")

While inserting this string"SC1101E,B+,", I get error "ORA-06502: PL/SQL: numeric or value error: ch


I'm using Microsoft Oracle Data Provider(System.Data.OracleClient). As soon as I get the string (SC1101E,B+,) in my input parameter, I get the below error:-

"ORA-06502: PL/SQL: numeric or value error: character string buffer too small"

Strange, as this same query works completely fine with my SQL client/toad.

The database type is varchar2 with 2000 length.  A lot of longer strings easily able to be updated. But as soon as above string get in the parameter, the code starts vomitting error. Please help.

string maj1string = "SC2212,B+,4,SC2204,B+,4,SC2220,C+,4,SC2203,B+,4,SC3205,B-,4,SC3211,B+,4,SC2205,B-,4,SC3220,B-,4,SC2216,B-,4,SC3213,B-,4,SC3221,B-,4,SC1101E";

OracleParameter[] parmschk_subjreqm;

parmschk_subjreqm[0] = new OracleParameter("V_MTHSTRING",maj1string.ToString());

Error inserting data in Excel spreadsheet from SQL 2005 SP



I am using a SP on a SQL 2005 server to insert data into an Excel spreadsheet.

If I run the following query:



INTO OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0','Data Source ="\\wvns01\data\Finance\ZIP\FY2011_testZIP\BankFile.xls";extended Properties=Excel 8.0')...

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend