Monday, January 16, 2023

Generate Excel Bulk Report in Asp.Net With Extension method

To Generate the faster report for bulk data i used following code base for the download the data. Sample Code is :-

Supporting DLL is Click here (ClosedXML.dll)

 if (dtBase != null && dtBase.Rows.Count > 0)
        {
            if (dtBase.Rows.Count > 0)
            {
                dtBase.ExportExcel("VKYC_Report", "VKYC_Report");
            }
            else
            {
                lblError.Text = "Records not found.";
            }
        }
        else
        {
            lblError.Text = "Records not found.";
        }
-------------------------

public static class Extension
{
    public static void ExportExcel(this DataTable dt, string WorksheetName = "Report", string FileName = "Report")
    {
        try
        {
            using (XLWorkbook wb = new XLWorkbook())
            {
                wb.Worksheets.Add(dt, WorksheetName);
                if (HttpContext.Current != null)
                {
                    HttpContext.Current.Response.Clear();
                    HttpContext.Current.Response.Buffer = true;
                    HttpContext.Current.Response.Charset = "";
                    HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + FileName + ".xlsx");
                    using (MemoryStream MyMemoryStream = new MemoryStream())
                    {
                        wb.SaveAs(MyMemoryStream);
                        MyMemoryStream.WriteTo(HttpContext.Current.Response.OutputStream);
                        HttpContext.Current.Response.Flush();
                        HttpContext.Current.Response.End();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            // throw;
        }
    }
}

Friday, January 13, 2023

Some Dotnet Core Command

On Visual Studio you need to use below list of command for execution. 

 dotnet new XX_Type XX_Name (First XX is type of project what you wanted to be create and another XX is name of project) 

 dotnet build (Go to physical directoy and type this command to build the application) dotnet run (To run/execute the application) 

 donet publish XX_Location (XX is location where do you wanted to publish the code) 

To run the Publish file via commend line dotnet XXXX.dll (To execute the publish file you need to mention name of the file next to dotnet command)

Wednesday, January 4, 2023

Dynamic Create N level Navigation menu using JQuery and CSS

 For creating n level of dynamic navigation we required first data in JSON format.

Code base i will upload here.. including CSS and JS Complete code reference.


Working Code bundle is (Due to Code CSS application design is completed vanished ignore for outer design) Click Here for

Source Code and Preview is availble below




	
	
	
	


 




Jquery Loop for Object, Array Loop, Object loop, Sorting, Finding data in Nested array

 I found very good article here please visit here.

https://stackoverflow.com/questions/16626735/how-to-loop-through-an-array-containing-objects-and-access-their-properties


Sunday, November 20, 2022

Oracle Query to Get Database Information like Version, db size, avilable size, file location

select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size"

, round(sum(used.bytes) / 1024 / 1024 / 1024 ) - 

round(free.p / 1024 / 1024 / 1024) || ' GB' "Used space"

, round(free.p / 1024 / 1024 / 1024) || ' GB' "Free space"

from    (select bytes

from v$datafile

union all

select bytes

from v$tempfile

union all

select bytes

from v$log) used

, (select sum(bytes) as p

from dba_free_space) free

group by free.p;


SELECT version FROM V$INSTANCE; --11.2.0.1.0

SELECT * from PRODUCT_COMPONENT_VERSION; -- Get detailed version

SELECT * from dba_data_files ;  --Get Physical file

SELECT * from V$SESSION Where Status='KILLED'; -- Get Oracle connected sessio list

SELECT * from V$SQL ;-- Get All Executed Query details

Tuesday, September 13, 2022

GRPC Client and Service Service/API Creation on Asp.net, C#


GRPC service is work when user/developer don't want make customer to ideal when during long data pulling from API/Rest server. on this case ideally on websites we shows a loader or ask for wait to customer. Tippically on webservice/ API/ Rest all client services will not respond untill server side process complete. but on gRPC there is an advantage we can get the data into chunk

On gRPC when data is iterating on server side still we can get the row by row/ chunk of data recevied from gRPC service and that application can shows on front end.

I learned the same on you tube "https://www.youtube.com/watch?v=CcbwRBT8vnI"

Sample Code i have prepared for my testing purpose and uploaded the same on my drive. Click here to download if readmade code you want.

Tuesday, September 6, 2022

Oracle DB Query tips

1.  Get Table Size and Rows Details

    select * from user_tables where table_name = 'TBL_XXXXXXXX'

2.