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

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


Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net

[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
    public bool AddProduct(int Id, Guid UserId, string Priimek)
        // Create a new ProductRow instance
        Northwind.tbl_zaposleniDataTable products = new Northwind.tbl_zaposleniDataTable();
        Northwind.tbl_zaposleniRow product = products.Newtbl_zaposleniRow();

        product.ID = Id;

        if (Priimek == null) product.SetPriimekNull(); else product.Priimek = Priimek.Value;
        // Add the new product
        int rowsAffected = Adapter.Update(products);

        // Return true if precisely one row was inserted, otherwise false
        return rowsAffected == 1;


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'string' does not contain a definition for 'Value'

Source Error:

Line 92: 
Line 93: 
Line 94:         i

View Complete Post

More Related Resource Links

System.ComponentModel.DescriptionAttribute not showing up in REST service

I am trying to set the description for a REST WCF service, but it doesn't seem to be working. Code is: [AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]     [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]     [WebDispatchFormatterConfiguration("application/xml")]     [WebDispatchFormatterMimeType(typeof(WcfRestContrib.ServiceModel.Dispatcher.Formatters.PoxDataContract), "application/xml", "text/xml")]     [WebDispatchFormatterMimeType(typeof(WcfRestContrib.ServiceModel.Dispatcher.Formatters.DataContractJson), "application/json")]     [WebDispatchFormatterMimeType(typeof(WcfRestContrib.ServiceModel.Dispatcher.Formatters.FormUrlEncoded), "application/x-www-form-urlencoded")]     public class PublicAppointmentSchedulerSvc : IPublicAppointmentScheduler     {         IPublicAppointmentScheduler impl = new PublicAppointmentScheduler();         [WebDispatchFormatter]         [Description("Immediate or callback contact request")]         [WebInvoke(UriTemplate = "InitiateContact", Method = Verbs.Post)]  &n

System.ComponentModel.Win32Exception: The operation completed successfully

Hi,      I'm calling a .Net 1.1 Infragistics calender windows control (32 bit) from a html page (old code) in Windows 2008 Server R2 (with WOW64) . This control was working on all operating systems including Windows 7 and when loaded in Windows 2008 Server R2 it throws up the exception given below. I'm able to load the control sometimes, say 5% successful (only the first time when I load the application) and the remaining 95% it throws up the exception dialog box (sometimes it happens when I load the application for the first time too). Not sure whether this is the right forum, if it's not please direct me to the right forum. -------------------------------------------------------------------------------------------------------------------- See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.ComponentModel.Win32Exception: The operation completed successfully    at System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)    at System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)    at System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr target

Using Reflection to get System.ComponentModel.DisplayName or Description

I have a class and on the properties I have assigned the attributes System.ComponentModel.DisplayName and System.ComponentModel.Description.  Using reflection I can't seem to retrieve these attribute values.  How can I do this?

System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary Error

I have a WCF service that is using the SharePoint object model to query a list.  (I need my recurrence events.)

I have a Silverlight application referencing that service to display it using a datagrid.

Without referencing the sharepoint object model, everything works fine (test data).  Once I start using the SPsite, SPweb, I receive:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Mon, 21 Sep 2009 01:29:39 UTC
Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at CalendarSVCApplication.TestDataRef.GetTestDataCompletedEventArgs.get_Result()
   at CalendarSVCApplication.MainPage.AnonymousMethod1(Object s, GetTestDataCompletedEventArgs args)
   at CalendarSVCApplication.MainPage._Lambda$__1(Object s, GetTestDataCompletedEventArgs args)
   at CalendarSVCApplication.TestDataRef.TestData1Client.OnGetTestDataCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http:/

System.ComponentModel.PropertyChangedEventHandler not handling the event



I'm working in a wpf app that is binding controls to a class that implements INotifyPropertyChanged. I'm trying to track when there are changes to the underlying object by setting a flag whenever a property is changed. To do so, I wired up an event handler to the PropertyChanged event of the class like so:

_facilityLogic.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(facilityLogic_PropertyChanged);


public void facilityLogic_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
Can anyone tell me why this event handler never gets called? The event is firing, but SetIsChanged() never gets called.

The service 'System.Workflow.ComponentModel.Design.IMemberCreationService' must be installed for t

I am getting this error

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

The service 'System.Workflow.ComponentModel.Design.IMemberCreationService' must be installed for this operation to succeed. Ensure that this service is available.


at System.Workflow.ComponentModel.Design.NamePropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager m

The service 'System.Workflow.ComponentModel.Design.IIdentifierCreationService' must be installed f



I am trying to workthrough "Microsoft Workflow Foundation Tutorials".


I am creating workflow in VS 2008 by adding simple class with .vb extension and getting this error in designer view.

"The service 'System.Workflow.ComponentModel.Design.IIdentifierCreationService' must be installed for this operation to succeed. Ensure that this service is available."


Please guide what to do?

Should System.ComponentModel.Container() be used in a Custom Control


I have developed a simple custom control which is effectively a custom button with a timer, derived from Control. I am unsure of using "components = new System.ComponentModel.Container()". Since the control uses a timer, should it be added to the components container? i.e. components.Add(timer); ? If so, how is it disposed, components.Dispose() is only called if Dispose(true) is called, which i dont? Or should i have a destructor ~MyComponent() which calls timer.Dispose().

In short, when do you use a "components = new Container()" and "components.Add()" in a custom control.

Also, if my control uses Graphics, Brush & Pen objects, should Dispose() be called on them and if so where. In the deconstructor? Or do you leave it up to the garbage collector?


System.ComponentModel and distributed applications



I've just been told about how good .NET is with a broker model for distributed applications. However, I haven't found anything, only a couple of sentences about the component model and how objects can be called from different processes and possibly network places.

So, is this it? I haven't seen any books or articles about System.ComponentModel and the objects therein.

Does anybody have any ideas of how to learn to work with System.ComponentModel?

Lots of Greetings!


Insert value using Table Value Functions

a real gem in Sql Server 2008. mostly people still using Stored procedure may be they shifted to SQL Server but they are not using TVF right now.

Insert Rows with a GridView

In ASP.NET version 1.x, I used the footer on the DataGrid control to insert new rows by placing a series of TextBox, DropDownLists, CheckBoxes etc. controls on it and then handling a save button. This also works with the GridView in version 2.0 but with one major exception: if your data source is empty, the GridView will hide your footer (and header) and only display the EmptyDataText.

System Development Life Cycle

The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various SDLC methodologies have been developed to guide the processes involved including the waterfall model (the original SDLC method), rapid application development (RAD), joint application development (JAD), the fountain model and the spiral model. Mostly, several models are combined into some sort of hybrid methodology

The Agile System Development Life Cycle (SDLC)

The goal of this article is to describe the agile system development life cycle (SDLC), putting it in context from what you may have heard about within the agile community and more importantly within the context of your overall IT efforts.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.



hello i have the following problem

i have upload my content to hosting server but i get the following error

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of typ

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

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