• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
    • Book Reading 2026
  • Supply Chain Management Guide
  • PKM
  • Microsoft Excel
  • Microsoft Copilot in Office 365
  • Public Wiki Page

Ali Raza Zaidi

A practitioner’s musings on Dynamics 365 Finance and Operations

Uncategorized

Compiler Error Message: CS0030: Cannot convert type ‘ASP.login_aspx’ to ‘System.Web.UI.WebControls.Login’

August 6, 2007 by alirazazaidi

Problem occur when you page name is same as Class in .net
Usually we develop the login page as login.aspx . When we publish it, the aspx is retained and tries to compile against Login’s codebehind,  which is not resolve properly in the assembly due to System.Web.Login.
To avoid it developer must Insure that Page name will not the same as in System.Web.

how to upload larger files in asp.net 2

July 23, 2007 by alirazazaidi

by default asp.net application did not upload file more than 4.5 mb or 4 mb. For this purpose You have to add following http runtime tag in web.cofig of web site.

<httpRuntime executionTimeout=“90“ maxRequestLength=“20096“useFullyQualifiedRedirectUrl=“false“ minFreeThreads=“8“ minLocalRequestFreeThreads=“4“appRequestQueueLimit=“10000“;/>

you have to change two setting in above code.MaxRequestLength (Here you mention the size limit of file , bydefault it is 4 mb) and appRequestQueueLimit (it is the time when application take time to upload the request.)

database level paging in Tsql 2005 with common table expression

July 11, 2007 by alirazazaidi

In MSSQL 2000 we used to do paging either by dynamic sql or by some
 advanced techniques like the example with rowcount.
In MSSQL 2005 with the introduction of ROW_NUMBER
 function life is a lot easier.   

 
DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 2;
SET @PageSize = 10;
 WITH OrdersRN AS (     SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, OrderID) AS RowNum           ,
OrderID ,
OrderDate,
CustomerID,
EmployeeID
FROM dbo.Orders )
SELECT *    FROM OrdersRN  WHERE RowNum BETWEEN (@PageNum - 1) * @PageSize + 1 AND @PageNum * @PageSize  ORDER BY OrderDate,
OrderID;
 

how to remove Html tags from string in c#

July 5, 2007 by alirazazaidi

use this function

public string Strip(string text)
{
    return Regex.Replace(text, @”<(.|n)*?>”, string.Empty);
}

downloading file in c#

May 7, 2007 by alirazazaidi

private void DownloadFile(String strFileName){FileStream fs;

string strContentType;string strPath=TaskManagementTool.Config.Path.ToString();

//Dim strFileName As String = Request.QueryString(”DocumentFile”)fs = File.Open(Server.MapPath(strPath + strFileName), FileMode.Open);

Byte[] bytBytes = new byte[fs.Length] ; // Write the stream to the byte array

fs.Read(bytBytes, 0, Convert.ToInt32(fs.Length)); // Close the file stream to release the resource

fs.Close();Response.AddHeader(“Content-disposition”, “attachment; filename=”+strFileName);

// Next we need to add some header information.// These headers will tell the browser what it needs to do

// with the content we’re serving

Response.ContentType = “application/octet-stream”;// Now our headers are added, we can serve the content.// To do this, we use the BinaryWrite() method of the server object

// This successfully streams our external file to the user,

// despite the fact that the file doesn’t exist

// anywhere inside the web application

Response.BinaryWrite(bytBytes);// Call Response.End() so that no more// content goes through to the client.

Response.End();}

}

how to get multiselected from listbox in asp.net

February 1, 2007 by alirazazaidi

we Select multiple indices from list boxes . the listbox have propery of GetSelectedIndicdces . Which return all selected indexes .

so code is like 

int[] _SelectedIndexes = lstBlog.GetSelectedIndices();

foreach (int Y in _SelectedIndexes)

 {            Response.Write(this.lstBlog.Items[Y].Text + ” “ + this.lstBlog.Items[Y].Value );

} where lstBlog is name of listbox

How to use Check boxes in DataList

January 27, 2007 by alirazazaidi

 This is html code for  datalist

 <asp:DataList ID=”dlist” runat=”server” RepeatColumns=”3″ OnItemDataBound=”dlist_ItemDataBound”                                      Width=”681px” ItemStyle-HorizontalAlign=”Left”>

<ItemTemplate>       

  <asp:CheckBox ID=”chkBlogSites” runat=”server” />

</ItemTemplate>

</asp:DataList>

   

IN Code Behind OnItemDatabound Event look like

 protected void dlist_ItemDataBound(object sender, DataListItemEventArgs e){

if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)

{

// Here we get the reference of check box

   CheckBox lit = (CheckBox)e.Item.FindControl(“chkBlogSites”);

   if (lit != null)

{

//bind it with database field, in my case i bind name feild of table

      lit.Text = DataBinder.Eval(e.Item.DataItem, “Name”).ToString() ;      lit.Checked = true;

         }

      }

    }

     Here the user define method where i get the value of selected textboxes 

 private void GetCheckedBlogs(){//DataListItem _obj = null;//naviagate in datalist item to fine which item is checked foreach (DataListItem _obj in dlist.Items)

     {

//check other than first row where names are mentioned

if (_obj.ItemIndex > -1)

{ 

   CheckBox _checkBox = (CheckBox)_obj.FindControl(“chkBlogSites”);

   if (_checkBox.Checked == true) 

     {

        Response.write(_checkBox.Text);

      }

   }

}

}

How to fetch data form Rss

January 14, 2007 by alirazazaidi

This is some code I used to fetch data from rss links  and insert to database.  Where _RssAgent is containing business logic, having getters, setters and function to insertion in database. you can implement as your requirement 

XmlDocument doc = new XmlDocument();
doc.Load(xmlPath);
//Get all Items in the XML file
//Get reference to the first author node in the XML file
XmlNodeList titleList = doc.GetElementsByTagName(“item”);
// loop for all get
for (int _Count = 0; _Count <= titleList.Count – 1; _Count++)
{
XmlNode authorNode = doc.GetElementsByTagName(“item”)[_Count];
_RssAgent = new clsBlogPost();
foreach (XmlNode child in authorNode.ChildNodes)
{
if ((child.Name == “title”) && (child.NodeType == XmlNodeType.Element))
{

// Assign Title of post to some variable
_RssAgent.PostTitle = child.FirstChild.Value;
}
if ((child.Name == “description”) && (child.NodeType == XmlNodeType.Element))
{

// assign the description of rss item to variable
_RssAgent.Content = child.FirstChild.Value;
}
if ((child.Name == “link”) && (child.NodeType == XmlNodeType.Element))
{
_RssAgent.PostUrl = child.FirstChild.Value;
}
if ((child.Name == “pubDate”) && (child.NodeType == XmlNodeType.Element))
{

//if pub date found then assign it to date
_RssAgent.PostedDate = Convert.ToDateTime(child.FirstChild.Value);
}
}
if (_RssAgent.PostedDate == Convert.ToDateTime(“1/1/0001”))
{
_RssAgent.PostedDate = Convert.ToDateTime(“1/1/1900”);
}
_RssAgent.DateIndexed = DateTime.Now;
_RssAgent.BlogId = _RssId;

///insertion method call you can use ur own code here
_RssAgent.Insert(_RssAgent);
}

Url regular expression in asp.net

January 13, 2007 by alirazazaidi

buddy here is regular expression for Url Vaildation

“http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?”

asp.net control would be look like

<asp:RegularExpressionValidator ID=”RegularExpressionValidator1″ ControlToValidate=”XYZl” ValidationExpression=”http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?” runat=”server” ErrorMessage=”Invalid URL”></asp:RegularExpressionValidator>

enjoy

Shopping Cart in asp.net 2

September 17, 2006 by alirazazaidi

Currently I m working on shopping cart application . I found some cool and very helpful articles where guys describe the way in which they write  shopping cart application in dot net. These are the best links which I found on net.

 Building an ASP.NET Shopping Cart Using DataTables I found this cool article on site point.

From Code project
  http://www.codeproject.com/aspnet/shopcart.asp
http://www.codeproject.com/aspnet/ShoppingCartCSharp.asp

best article if u good in object oriented programming this article is really good by david.hayden on codebetter web site http://codebetter.com/blogs/david.hayden/archive/2005/03/22/60166.aspx

« Previous Page
Next Page »

Primary Sidebar

About

I am Dynamics AX/365 Finance and Operations consultant with years of implementation experience. I has helped several businesses implement and succeed with Dynamics AX/365 Finance and Operations. The goal of this website is to share insights, tips, and tricks to help end users and IT professionals.

Legal

Content published on this website are opinions, insights, tips, and tricks we have gained from years of Dynamics consulting and may not represent the opinions or views of any current or past employer. Any changes to an ERP system should be thoroughly tested before implementation.

Categories

  • Accounts Payable (2)
  • Advance Warehouse (2)
  • AI (3)
  • Asset Management (3)
  • Azure Functions (1)
  • Books (6)
  • Certification Guide (3)
  • ChatGPT (3)
  • Claude (1)
  • Customization Tips for D365 for Finance and Operations (64)
  • D365OF (60)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (59)
  • Dynamics 365 for finance and operations (139)
  • Dynamics 365 for Operations (175)
  • Dynamics AX (AX 7) (134)
  • Dynamics AX 2012 (274)
  • Dynamics Ax 2012 Forms (13)
  • Dynamics Ax 2012 functional side (16)
  • Dynamics Ax 2012 Reporting SSRS Reports. (31)
  • Dynamics Ax 2012 Technical Side (52)
  • Dynamics Ax 7 (65)
  • Exam MB-330: Microsoft Dynamics 365 Supply Chain Management (7)
  • Excel Addin (1)
  • Favorites (12)
  • Financial Modules (6)
  • Functional (8)
  • General Journal (1)
  • Implementations (1)
  • Ledger (1)
  • Lifecycle Services (1)
  • Logseq (4)
  • Management Reporter (1)
  • Microsoft Excel (4)
  • MS Dynamics Ax 7 (64)
  • MVP summit (1)
  • MVP summit 2016 (1)
  • New Dynamics Ax (19)
  • Non Defined (9)
  • Note taking Apps (2)
  • Obsidian (4)
  • Personal Knowledge Management (3)
  • PKM (16)
  • Power Platform (6)
  • Procurement (5)
  • procurement and sourcing (6)
  • Product Information Management (4)
  • Product Management (6)
  • Production Control D365 for Finance and Operations (10)
  • Sale Order Process (10)
  • Sale Order Processing (10)
  • Sales and Distribution (5)
  • Soft Skill (1)
  • Supply Chain Management D365 F&O (5)
  • Tips and tricks (278)
  • Uncategorized (165)
  • Upgrade (1)
  • Web Cast (7)
  • White papers (4)
  • X++ (10)

Wiki

  • SCM

Copyright © 2026 · Magazine Pro On Genesis Framework · WordPress · Log in