private int GetReturnedValueFromStoredProcedure(string storedProcedureName, string connectionString, string paramValue)
{
SqlConnection connection = new SqlConnection(connectionString);
// Command - specify as StoredProcedure
SqlCommand command = new SqlCommand(storedProcedureName, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@orgID", System.Data.SqlDbType.NVarChar).Value = paramValue;
// Return value as parameter
SqlParameter returnValue = new SqlParameter("returnVal", SqlDbType.Int);
returnValue.Direction = ParameterDirection.ReturnValue;
command.Parameters.Add(returnValue);
// Execute the stored procedure
connection.Open();
command.ExecuteNonQuery();
connection.Close();
return Convert.ToInt32(returnValue.Value);
}
getSolution(Problem problem): Solution
Monday, September 27, 2010
Wednesday, August 11, 2010
Counting Number of Files in a directory - UNIX/ Linux
Go to that directory first and then type the following command:
Command: ls | wc -l
Command: ls | wc -l
Tuesday, August 10, 2010
jQuery UI CSS List in Google CDN
- UI Lightness: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css
- UI Darkness: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-darkness/jquery-ui.css
- Smoothness: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css
- Start: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/start/jquery-ui.css
- Redmond: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css
- Sunny: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/sunny/jquery-ui.css
- Overcast: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/overcast/jquery-ui.css
- Le Frog: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/le-frog/jquery-ui.css
- Flick: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css
- Pepper Grinder: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/pepper-grinder/jquery-ui.css
- Eggplant: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/eggplant/jquery-ui.css
- Dark Hive: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/dark-hive/jquery-ui.css
- Cupertino: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/cupertino/jquery-ui.css
- South Street: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/south-street/jquery-ui.css
- Blitzer: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/blitzer/jquery-ui.css
- Humanity: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/humanity/jquery-ui.css
- Hot Sneaks: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/hot-sneaks/jquery-ui.css
- Excite Bike: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/excite-bike/jquery-ui.css
- Vader: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/vader/jquery-ui.css
- Dot Luv: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/dot-luv-grinder/jquery-ui.css
- Mint Choc: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/mint-choc/jquery-ui.css
- Black Tie: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/black-tie/jquery-ui.css
- Trontasic: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/trontastic/jquery-ui.css
- Swanky Purse: http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/swanky-purse/jquery-ui.css
Sunday, July 18, 2010
Finding Full Size of a Directory in Human readable format - UNIX/LINUX
Command: du -sh directory
here, -s, --summarize => display only the total of the specified directory
-h, human readable format =>print size of a directory in human readable format e.g., 100K or 2000M or 4.9 G
here, -s, --summarize => display only the total of the specified directory
Monday, July 12, 2010
Running a background process - Using the nohup command in UNIX
Command:
nohup command &
For example:
If you want to run a java program as a background process you can do the following:
nohup java -cp ./wikify/bin:./wikify/mysql-connector-java-3.1.13-bin.jar:./wikify/trove.jar:./wikify/weka.jar:/usr/share/tomcat6/lib/servlet-api.jar:./wikify/src/org/wikipedia/miner/service/ org.wikipedia.miner.service.WikipediaMiner &
You r program will be running in the background even if you logout from your terminal. Use Kill command to terminate the nohup command
nohup command &
For example:
If you want to run a java program as a background process you can do the following:
nohup java -cp ./wikify/bin:./wikify/mysql-connector-java-3.1.13-bin.jar:./wikify/trove.jar:./wikify/weka.jar:/usr/share/tomcat6/lib/servlet-api.jar:./wikify/src/org/wikipedia/miner/service/ org.wikipedia.miner.service.WikipediaMiner &
You r program will be running in the background even if you logout from your terminal. Use Kill command to terminate the nohup command
Wednesday, June 16, 2010
Thursday, June 3, 2010
A generic error occurred in GDI+.
Got the following error when one of client was trying to upload a picture in his website after publishing the website in godaddy.com. It was a easy fix. Just give the “write” permission to the “image” directory of your solution folder in the godaddy domain where all the files resides. More specifically,
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +377630
System.Drawing.Image.Save(String filename, ImageFormat format) +69
iTalk.Controllers.AccountController.ChangePicture() in AccountController.cs:306
lambda_method(ExecutionScope , ControllerBase , Object[] ) +39
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
System.Web.Mvc.Controller.ExecuteCore() +123
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Solution: Login to godaddy.com –>on the top, Content tab –> Click File manager –> check the folder which contains the images –> Click permission tab on the top – uncheck the already checked items –> check the read and write from the check box list –> Click ok at the bottom and you are done!
Subscribe to:
Posts (Atom)