简体   繁体   English

表的OutOfMemory异常

[英]OutOfMemory exception for a table

I am trying to fill table with random color in each column(a rough idea to create an image in table form)(I may sound somewhat funny). 我正在尝试在每一列中用随机颜色填充表格(以表格形式创建图像的粗略想法)(听起来有些可笑)。 I have created one view with code given below but is giving me OutOfMemoryException. 我使用下面给出的代码创建了一个视图,但是给了我OutOfMemoryException。 Any kind of help will be appreciable. 任何帮助都将是可贵的。 I am doing it in an MVC application. 我正在MVC应用程序中执行此操作。

<table>
@(int i=0;i<10;i++)
{
    red = random.Next(0, 255);
    green = random.Next(0, 255);
    blue = random.Next(0, 255);
    hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);
    <tr style="height:1px !important; width:1px !important;background-color:'@hexColour'">
    @{
    for(int j=0;i<10;j++)
    {
        red = random.Next(0, 255);
        green = random.Next(0, 255);
        blue = random.Next(0, 255);
        hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);
        <td style="height:1px !important; width:1px !important;background-color:'@hexColour'"></td>
    }
    </tr>
    }
}
</table>

Thanks in Advance 提前致谢

for(int j=0;i<10;j++)

应该:

for(int j=0;j<10;j++)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有不同路由的Jenkins OutOfMemory异常 - Jenkins OutOfMemory Exception with different routing 尝试使用Ionic.Zip dll将多个文件下载为Zip文件时出现OutOfMemory异常 - OutOfMemory exception when trying to download multiple files as a Zip file using Ionic.Zip dll libgit2sharp。内存不足补丁 - libgit2sharp.Patch outofmemory 实体框架在* lookup *表上引发SqlDate异常 - Entity Framework throws SqlDate exception on the *lookup* table 尽管模型类似于 MVC 中的表,但为什么总是引发 ModelValidation 异常 - Why is ModelValidation Exception is raised always though the model resembles the table in MVC 尝试在数据库表中插入新条目时出现LINQ to SQL异常 - LINQ to SQL exception when attempting to insert a new entry in a database table 从C#实体框架MVC创建表的异常 - Exception on creating a table from C# Entity framework MVC 实体框架 - MYSQL MVC 数据库表异常:表不存在 - Entity Framework- MYSQL MVC Database table exception: Table doesn't exist 一个表的ASP.Net数据库查询异常,即使另一个表也可以 - ASP.Net Database query exception for one table even though another works 在C#中将数据从数据表复制到mysql表中,引发致命异常 - copy data from datatable to mysql table in c# throwing fatal exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM