This is my technical area for troubleshooting and learning new programming skills and much more. Here, you will find answers on a wide range of technologies such as AI, Machine Learning, OpenAI, Databricks, ASP.NET, C#, Python, Microsoft Access, MySQL, Amazon Web Services, SQL Server, PL/SQL, JD Edwards, SAS, Salesforce, APIs, MVC, and many others. Please feel free to visit and join the discussion!
Friday, July 29, 2011
Error in executing xp_cmdshell in SQL Server 2005
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE
Thursday, July 28, 2011
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because .....
Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.
Export Gridview to Excel - Fixing Error -C# asp.net
{
string style = @"<style> .text { mso-number-format:\@;border:.5pt solid black; } </style> ";
string attachment = "attachment; filename=Report.xls";
Response.ClearContent();
Response.Write("<center>");
Response.Write("Gross Profit Report");
Response.Write("</center>");
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(style);
Response.Write(sw.ToString());
Response.End();
}
3. put following code:
public override void VerifyRenderingInServerForm(Control control){
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. */}
get Row number group by SQL-Server
select
payroll_item,[name],Row_number() OVER(PARTITION BY payroll_item ORDER BY payroll_item) AS 'OBJ_Detail' from TempprdetailSaturday, July 23, 2011
Fix:Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and SQL_Latin1_General_Pref_CP1_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and SQL_Latin1_General_Pref_CP1_CI_AS" in the equal to operation.
Use COLLATE DATABASE_DEFAULT after your join field.
select * from Tempprdetail
left outer join rk0901 on gmobj COLLATE DATABASE_DEFAULT =gl_OBJ COLLATE DATABASE_DEFAULT
and gmmcu COLLATE DATABASE_DEFAULT =HOME_BU COLLATE DATABASE_DEFAULT
Friday, July 22, 2011
Tuesday, July 12, 2011
Monday, July 11, 2011
Monday, July 4, 2011
Data annotations for validation outside of a UI framework
Several people have asked me about using data annotations for validation outside of a UI framework, like ASP.NET MVC or Silverlight. The System.ComponentModel.DataAnnotations assembly contains everything you need to execute validation logic in the annotations. Specifically, there is a static Validator class to execute the validation rules. For example, let's say you have the following class in a console mode application:
Saturday, July 2, 2011
Lost sql-server password
Here's a neat thing to remember if you're using MSSQL:
To change the "sa" password, login to your computer using an administrator account. Open your SQL Server and log in using Windows Authentication. Open a new query window and type in the following command:
After that go to section Security –> Logins –> double click "sa" or choose properties. Go to "Status" and check to see if "Login:" is enabled. If not, enable it.
Thursday, June 30, 2011
Get UDC JD Edwards
"06" -> BF szSystemCode
"PS" -> BF szRecordTypeCode
VA rpt_PASTUDC_P -> BF szUserDefinedCode
RV PayStatusH <- BF szDescription001
Monday, June 27, 2011
Excel counts columns Count With Letters Extension
Should you need to count as Excel counts columns, then look at Zeltera's "Count with Letters".
His routines can be extended to convert an Integer to an Excel Column or an Excel Column to an integer. A long time ago, I wrote two very simple, inefficient loop wrappers around Zeltera's core code to do just that. Here I present a way to calculate a result, so as to reduce the loop to no more than 26 passes.
http://www.codeproject.com/KB/cs/CountWithLettersExtn.aspx
Tuesday, June 21, 2011
Script Performance Automatic with Custom Templates -Visual Studio 2010
Sunday, June 19, 2011
RB Batch Partial posted in GL
I Ran sql on F03b13 , F03b14 I found POST field was blank and that particular entry missing from F0911.
I went to P0011 batch post screen and change that RB batch From Post status to Approve and ran posting program R9801 again.
after that particular line posted correctly in GL.
Filtering an ASP.NET GridView control with jQuery
GridView wired to some sample data. For demo simplicity I'm using an XMLDataSource and reading from an XML file in my App_Data directory.
http://www.msjoe.com/2011/06/filtering-an-asp-net-gridview-control-with-jquery/