sol: double xx= (double)xx[0].xxxxx;
Every Question..What does it mean? Why is this? How it works?
Microsoft .Net (pronounced dot (.) net) may be a package element that runs on the Windows software package.
.Net provides tools and libraries that change developers to form Windows package a lot of quicker and easier.
Microsoft describes it as:".Net is that the Microsoft internet Service strategy to attach data, people,
system and devices through software".I'm Choulla Naresh..!
Thursday, June 2, 2016
ERROR : The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[class]', but this dictionary requires a model item of type 'class'.
SOLUTION :
public CLASSNAME gEtsinglerecord(int Id)
{
CLASSNAME retval = null;
retval = Entity.CLASSNAME.Where(s
=> s.Id == Id).FirstOrDefault();
return retval;
}
We have to use "First or Default( )" to the get record based on SINGLE ID value.
Tuesday, May 31, 2016
Error occurred during a cryptographic operation. 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.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
Server Error in '/' Application.
Error occurred during a cryptographic operation.
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.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
Source Error:
|
Source File: c:\Naresh\ Global.asax.cs Line: 55
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
=============================================================================
=Cleanup code and open...
For anyone who hasn't solved their problem, I was missing the "machineKey" entry for encrypt/decrypt in my web.config
=Try clearing your cache and cookies in order to mitigate the error. I suspect some sort of error occurred when information was sent to or from the server.
Friday, May 13, 2016
The localhost page isn’t working in visual studio
Resolved::: solution> project properties> change iis express port number ----
Wednesday, March 9, 2016
Convert Datatable to List
private static List<T> ConvertDataTable<T>(DataTable dt)
{
List<T> data = new List<T>();
foreach (DataRow row in dt.Rows)
{
T item = GetItem<T>(row);
data.Add(item);
}
return data;
}
private static T GetItem<T>(DataRow dr)
{
Type temp = typeof(T);
T obj = Activator.CreateInstance<T>();
foreach (DataColumn column in dr.Table.Columns)
{
foreach (PropertyInfo pro in temp.GetProperties())
{
if (pro.Name == column.ColumnName)
pro.SetValue(obj, dr[column.ColumnName], null);
else
continue;
}
}
return obj;
}
Tuesday, March 8, 2016
Visual Studio Expand/Collapse keyboard shortcuts
Collapse to Definitions: CTRL + M + O
Expand all Outlining: CTRL + M + X
Thursday, March 3, 2016
Not Running in Release Mode in Visual Studio
- Right click Project
- Properties
- Build
- Advanced
- Set Debug Info to full or pdb only
Tuesday, March 1, 2016
Difference Between "string" and "String"
what is
the difference between both (String and string)?
After completing the execution of this program when we mouse over on string is shows class
System.String and when we mouse over on String it also shows Class
System.String. Class System.String statement clarifying that string is the alias name of String.
Finally:
Finally:
String is the alias name of String because both contain the same things
Difference Between "string" and "String"
what is
the difference between both (String and string)?
After completing the execution of this program when we mouse over on string is shows class
System.String and when we mouse over on String it also shows Class
System.String. Class System.String statement clarifying that string is the alias name of String.
Finally:
Finally:
String is the alias name of String because both contain the same things
Wednesday, February 24, 2016
Convert Number To Word
public string ConvertNumbertoWords(int number)
{
if (number == 0)
return "ZERO";
if (number < 0)
return "minus " + ConvertNumbertoWords(Math.Abs(number));
string words = "";
if ((number/1000000) > 0)
{
words +=
ConvertNumbertoWords(number/1000000) + "
MILLION ";
number %= 1000000;
}
if ((number/1000) > 0)
{
words += ConvertNumbertoWords(number/1000)
+ " THOUSAND ";
number %= 1000;
}
if ((number/100) > 0)
{
words +=
ConvertNumbertoWords(number/100) + "
HUNDRED ";
number %= 100;
}
if (number > 0)
{
if (words != "")
words += "AND ";
var unitsMap = new[]
{
"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "ELEVEN",
"TWELVE", "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVENTEEN", "EIGHTEEN", "NINETEEN"
};
var tensMap = new[]
{"ZERO", "TEN", "TWENTY", "THIRTY", "FORTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY"};
if (number < 20)
words += unitsMap[number];
else
{
words += tensMap[number/10];
if ((number%10) > 0)
words += " " +
unitsMap[number%10];
}
}
return words;
}
Subscribe to:
Posts (Atom)