Saturday, August 20, 2011

Error : Meta data is not found

I got this error when I was working with Dev Express Reporting Tool. I investigated why I am getting this run time error.

Then I came to know that actually corresponding dll is missing. I checked on Application Reference list and GAC list for the dll for which meta data is not found.

I surprisingly notice targeted dll was both place. Then why I am missing the dll? To solve the problem, I simply set copy to local to true.

I got the problem fixed. Aha great release! I am very glad to share my experience in my blog.

Thursday, July 21, 2011

StringBuilder Object where you can point specific character but not in System.String

From sample code, you will see nice thing that can be useful in programming
--------------------------------------------------------------------------
System.Text.StringBuilder sb = new System.Text.StringBuilder("Rat: the ideal pet");
sb.Append(" is caught");
sb[0] = 'C';
System.Console.WriteLine(sb.ToString());
System.Console.ReadLine();
-----------------------------------
Output : Cat: the ideal pet is caught

Thursday, July 14, 2011

Padding character before a string in sql query

select right(replicate(@padchar, @len) + @str, @len)
e.g. select right(replicate('0', 10) + 'hell boy', 10)

Wednesday, July 13, 2011

Expression evaluation in C#

Try with this code block which is faster than using codeDom
----------------------------------------
static double Evaluate(string expression)
{
var loDataTable = new DataTable();
var loDataColumn = new DataColumn("Eval", typeof(double), expression);
loDataTable.Columns.Add(loDataColumn);
loDataTable.Rows.Add(0);
return (double)(loDataTable.Rows[0]["Eval"]);
}

Friday, June 24, 2011

Database Restore, Error 3154

Error detalils:

Msg 3154, Level 16, State 4, Line 1
The backup set holds a backup of a database other than the existing 'dbName' database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

----------------------------------------------------------------
Solution:
RESTORE DATABASE dbName--AdventureWorks
FROM DISK = targeted location -- e.g. N'K:\june_24.bak'
WITH REPLACE