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


Top 5 Contributors of the Month
ASPEvil
Jean Paul
satyapriyanayak
Ashutosh Jha
SP
Post New Web Links

The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value t

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

Hi All,

        int maxAge = db.tbl_zaposlenis.Where(p => p.IdSifra == 22)
                         .Max(p => p.IdSifra);

        zaposleni.IdSifra = maxAge;

How to display the largest number in the "IdSifra?


thanks.




View Complete Post


More Related Resource Links

DataSet does not support System.Nullable<>. at System.Data.DataColumn.set_DataType(Type value)

  
Hi All, I'm populating array of objects into DataTable.  One of the field is of type date and my be null..Can't seem to fix it. can anyone help.. Thanks,-----------------------------------------------------------Employees[] e = Service.GetEmployee();Util.ConvertToDataTable(e);-----------------------------------------------------------error:Unhandled Exception: System.NotSupportedException: DataSet does not support System.Nullable<>. at System.Data.DataColumn.set_DataType(Type value)    

Object of type 'System.Int32' cannot be converted to type 'System.String

  

When i'm trying to update a table using dynamic data, i'm getting the following error. I was trying to google the solution for the whole day, but it didnt work. I tried to declare the type of parameters like this

<asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableUpdate="true"
                OnInserting="DetailsDataSource_Inserting"
                onselected="DetailsDataSource_Selected"
                onupdating="DetailsDataSource_Updating" > <UpdateParameters><asp:Parameter Name="PK_ID" Type="Int32" /><asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="c_titulu" Type="Int32" />
                <asp:Parameter Name="perio" Type="Int32" />
            

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm

  

Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 


I already have read rights to IIS user to my BIN folder. 


Thanks for the help. 


The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must

  

Hi,

This is frustrating, and I don't know how to solve it.

I have a strange problem. I am adding a LinqDatasource object, and set the context:

        protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e)
        {
            e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        }


Then I get this error:
The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

 

On web.config I already have this:
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.

is there another way adding a refernce to a web project? or only though teh web.config?

Thanks.


Netting C++: Mapping Native C++ to the Common Type System

  

This month Stanley Lippman begins translating the Text Query Language Query class hierarchy from C++ to the .NET Common Type System.

Stanley B. Lippman

MSDN Magazine February 2007


Netting C++: The Design Space of the Common Type System

  

Stanley Lippman moves Text Query Language to the Microsoft .NET Framework using the C++/CLI language extensions in Visual C++ 2005.

Stanley B. Lippman

MSDN Magazine December 2006


Types in Yukon: Managed UDTs Let You Extend the SQL Server Type System

  

The next version of SQL Server, code-named "Yukon," will offer enhanced support for user-defined types (UDTs). Because UDTs can be managed by the CLR, you can represent a wide variety of data structures to create types not possible with previous versions of SQL Server. With UDTs you can more precisely control the kind of data your type accepts, resulting in better data management. This article explores UDTs in "Yukon" and covers their design and implementation.

Peter W. DeBetta

MSDN Magazine February 2004


Unable to cast object of type 'System.Web.Mvc.ValueProviderResult' to type 'System.IConvertible'

  

Hello,
 Why am I getting this error on line:

               sp.Price = Convert.ToDecimal(collection.GetValue("Price"));

sp is :
  SPecials_Templates sp = new SPecials_Templates();

SPecials_Templates Defined:

    [MetadataType(typeof(SPecials_TemplatesMetaData))]
    public partial class SPecials_Templates
    {
        public class SPecials_TemplatesMetaData
        {

                [ScaffoldColumn(false)]
            public object Key { get; set; }
            [StringLength(50)]
            public object Template_Name { get; set; }
            [StringLength(12)]
            public object Headline { get; set; }
            [StringLength(12)]
    &nbs

An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll

  
Additional information: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondThis error occurs when i was executing a vc++.net program implementing ICMP....Error occurs when executing this statement... iRet=st->ReceiveFrom(RecvByte,RecvByte->Length,SocketFlags::None,&senderRemote);How to solve this problem????

System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlCli

  
I have created a windows library control that accesses a local sql database I tried the following strings for connecting Dim connectionString As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Trusted_Connection = true" Dim connectionString As String = "Data Source=localhost\SQLEXPRESS;Initial Catalog=TimeSheet;Integrated Security=SSPI"   I am not running the webpage in a virtual directory but in C:\Inetpub\wwwroot\usercontrol and I have a simple index.html that tries to read from an sql db but throws the error System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)   at System.Security.PermissionSet.Demand()   at System.Data.Common.DbConnectionOptions.DemandPermission()   at System.Data.SqlClient.SqlConnection.PermissionDemand()   at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, etc etc  The action that failed was:DemandThe type of the first permission that failed was:System.Data.SqlClient.SqlClientPermissionThe Zone of the assembly that fa

A first chance exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

  
I've read a bit about this error and maybe I have nothing to worry about.  BUT ... my simple little app gets 7 of these before it even gets to the first Dim statement in the Class Form1!  I found and followed instructions on how to have the Debugger intercept these exceptions but it seems that they are not being intercepted.  I only know that they have happened because of the messages in the Immediate Window.  In the Designer all I have is 5 Labels and 5 TextBoxes.   Any thoughts on how I could get to the cause of these messages? Thanks,  Bob

Prompt "The proper type library could not be found in the system registry" when open SQL2008 Express

  
Hi folks, I just format my notebook and installed the Win7Pro Eng 32-bit version and then install the SQL2008Express. I restarted my notebook as usual after the installation and open the SQL SMS, it prompt the following error "The proper type library could not be found in the system registry", It's a big dialog with certain text saying I do not have permission...etc. Since, I am using administrator account to open the program already but still fail. I have to repaire the SQL SMS too. May I know any other I can check? Any comment is highly appreciated. Thank you very much! Regards, Tony  

The type or namespace name 'Linq' does not exist in the namespace 'System'

  
Hi, I uploaded my website to the server, and I have there a working with wcf - it should be fw 3.5 I saw that fw 3.5 is installed on the server and also we have there fw 3.0 sp1. I run my website : www.qenglishcenter.com and I'm getting an error : The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) shouldn't System.linq be already existed ? Thanks for any reply.  

How to convert System.Type to Data.DbType?

  
Hi,Is it possible to convert a System.Type to Data.DbType (this is unfortunately an enumaeration)?Thanks, Rainer.
Categories: 
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