Monday, January 2, 2017

Domain Technical Platform Knowledge.


1. http://visualstudioshortcuts.com/2013/

2. http://www.java2s.com/Tutorial/CSharp/0280__Development/Catalog0280__Development.htm

3. https://www.codeproject.com/Articles/43357/Windows-Mobile-App-Development-Part-Creating-you

4. http://www.mobilepractices.com/2008/02/how-to-create-windows-mobile-smart.html

5. https://msdn.microsoft.com/en-us/library/ee504804(v=winembedded.60).aspx

6. https://www.microsoft.com/en-us/download/details.aspx?id=6135

7. https://www.youtube.com/watch?v=fRgXH_-5EHE

8. http://www.dotnetcurry.com/ShowArticle.aspx?ID=109&AspxAutoDetectCookieSupport=1

9. http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx

10. http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx

11. https://www.onlinebuff.com/article_step-by-step-3-tier-architecture-in-aspnet-using-c-example_45.html

12. http://www.semenoff.dk/en/Code-Corner/DHTML/movable_dhtml_behavior.aspx

13. http://www.c-sharpcorner.com/uploadfile/4d9083/create-and-implement-3-tier-architecture-in-asp-net/

14. http://www.c-sharpcorner.com/beginners/

15. http://www.c-sharpcorner.com/UploadFile/87ad51/3/

16. http://stackoverflow.com/questions/5430998/tutorial-videos-on-linq-and-nhibernate?rq=1

17. http://www.dimecasts.net/Casts/ByTag/Linq

18. https://www.youtube.com/playlist?list=PLOzPoXOQ-jqxWnJsia3oBpgPQLskechIF

19.  https://www.youtube.com/watch?v=qZ4cGLIfj1k&list=PL6n9fhu94yhWu3UKI0hYt2jvLB7_c8PHJ

=> https://www.youtube.com/watch?v=Cn1hFo7bs7A&list=PLDTj_bVPwcYwMIm2xW6uYLBsAvNMqKVjZ

=> https://www.youtube.com/watch?v=ldrmaA72PJg

=> https://www.youtube.com/user/MyPassionForDotNet/videos

=> https://www.youtube.com/user/dnfvideo/videos

=> https://www.youtube.com/user/BetterCoder/videos

20. Windows form life cycle demo.
      http://www.c-sharpcorner.com/uploadfile/mamta_m/windows-forms-events-lifecycle/

21. http://www.dotnetfunda.com/interviews/cat/92/windows-forms

22. https://msdn.microsoft.com/en-us/library/86faxx0d(v=vs.110).aspx

23. http://www.daveoncsharp.com/2009/06/windows-forms-event-sequence/

24. http://stackoverflow.com/questions/5499463/fire-form-keypress-event?rq=1

25. https://www.youtube.com/user/dare1indiandevil/videos

26. https://www.youtube.com/watch?v=x_9lfHjYtVg&list=PL0EE421AE8BCEBA4A

27. https://www.youtube.com/channel/UC8inCnD25Es0VLokfmhko5g/videos

28. https://www.youtube.com/watch?v=yqyXrDp6Id0&list=PL-EU0JUF-XD1saII7gONUxMIbk13XkmCV

Asp.net full episodes link

29. https://www.youtube.com/watch?v=3AYoipyqOkQ&list=PL6n9fhu94yhXQS_p1i-HLIftB9Y7Vnxlo

Linq collection videos
30. https://www.youtube.com/watch?v=z3PowDJKOSA&index=1&list=PL6n9fhu94yhWi8K02Eqxp3Xyh_OmQ0Rp6

31. http://www.dotnetfunda.com/interviews/cat/110/linq

32. https://www.youtube.com/watch?v=z3PowDJKOSA&list=PLf89Y6NTJiG6XUywMdXzNLn2XtvVO1E8B

33. https://www.youtube.com/watch?v=kFUn8_rdNqM&list=PLdbkZkVDyKZU5ZXqp5YP1TS3irQKHZilU&index=2

34. https://www.youtube.com/watch?v=jkghGK4bdtg&list=PL90AF0EFFEF782D27

35. https://msdn.microsoft.com/en-us/library/86faxx0d.aspx

36. http://csharp-video-tutorials.blogspot.in/2014/07/linq-tutorial.html

what is the diff between ref and out keyword.
37. https://www.youtube.com/watch?v=lYdcY5zulXA

38. Message Box in windows form in c#
https://www.dotnetperls.com/messagebox-show

39. For visual studio shortcut keys
http://www.dofactory.com/reference/visual-studio-shortcuts
a)Keep cursor on member of class and then press CTRL + R + E for generating its property.
b)To format the page in proper format CTRL + K + D this applies to jQuery file, c#, asp etc.
c)Ctrl +M+O -to open and collapse all regions
https://stackoverflow.com/questions/42843090/visual-studio-2017-collapsing-regions


40. For Asp.net page life cycle events
http://www.c-sharpcorner.com/UploadFile/8911c4/page-life-cycle-with-examples-in-Asp-Net/

41. What is view State and how it works.
http://www.c-sharpcorner.com/UploadFile/225740/what-is-view-state-and-how-it-works-in-Asp-Net53/

42. How to use progress in windows form.
Step-1:
drag and drop progress bar from ToolBox->All windows form control->Progress bar.

Step-2:
Now in code side
//for progress bar initialisation
progressBar.Minimum = 1;
progressBar.Value = 1;
progressBar.Step = 1;//for increamenting value.
progressBar.PerformStep();//used to increament progress bar as value set in progressBar.Step
progressBar.Maximum = maxCount;//last number.

Step-3:
Now start looping each time you loop perform PerformStep to increment progress bar.
progressBar.PerformStep();//for increamenting value as per looping.

43. How to consume a webservice into our asp.net web application.
http://www.c-sharpcorner.com/UploadFile/0c1bb2/consuming-web-service-in-Asp-Net-web-application/
http://dotnetmylife.blogspot.in/2013/10/how-to-use-web-service-in-windows-form.html

44. Your first web service
https://www.codeproject.com/articles/863/your-first-c-web-service

45. Rest Service
https://www.codeproject.com/articles/112470/developing-a-rest-web-service-using-c-a-walkthroug

46. Handling XmlDocument at running mode/writing nodes into xml doc
http://csharp.net-tutorials.com/xml/writing-xml-with-the-xmldocument-class/

Step-1:
Before reading any node from xml first we need to load it.
for getting solution folder path
XmlDocument xmlDoc;
string path = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
path = path .Substring(0, path.LastIndexOf("\\") + 1) + x;mlfileName.xml;
xmlDoc.Load(path );

Step-2:
Now read the key value of node
XmlNode xmlNode = xmlDoc.SelectSingleNode("configuration/appSettings/add[@key='" + sKey + "']");
            if (xmlNode == null)
            {
                throw new Exception(" Some error happend ");
            }
            else
            {
                return xmlNode.Attributes["value"].Value;
            }

How to add xml file into windows form project.


Step-3:
How to set the key value of a node
XmlNode xmlNode = xmlDoc.SelectSingleNode("configuration/appSettings/add[@key='" + sKey + "']");
xmlNode.Attributes["value"].Value = sValue;
xmlDoc.Save(path);

44. For Interchanging sql data type in between sql server and oracle
http://www.cnblogs.com/AnXinliang/p/5950737.html

45. Dotnet Bug in visual studio framework 4.0 related 2000 to 4000 characters while insert/update time in string variable.
http://stackoverflow.com/questions/9156019/ora-01461-can-bind-a-long-value-only-for-insert-into-a-long-column-occurs-when/29637314
Solution: 1) Direct put the text in query. 2)Using AnsiStringFixedLength.

46. Difference between string and ansi string.
 http://stackoverflow.com/questions/5229671/c-dbtype-string-versus-dbtype-ansistring

47. Asynchronous-vs-synchronous-execution
http://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean

48.  How bind into dropdown list from taking the value from enum and text from global resource file

49. Property of a datatable
http://stackoverflow.com/questions/20238951/how-select-data-dividual-character-uppercase-and-lowercase-in-datatable
Datatable searches are case insensitive by default. Set the CaseSensitive property on the datatable to True

http://stackoverflow.com/questions/5876037/linq-datatable-select-does-not-work-if-column-name-has-space-in-it
drCCPParameterTypesOrUnitsOrDesc = excelDataTableForCCPDesc.Select("[Parameter Name]='" + parameterName.Trim() + "'");

http://stackoverflow.com/questions/27259631/how-to-get-a-subset-datatable-from-another-datatable-filtered-by-few-column-valu?rq=1

http://stackoverflow.com/questions/6617804/how-to-convert-a-column-of-datatable-to-a-list

How to count how many rows are there in a data table.
====================================================================
Datatable dt=your code.
Int rows=dt.rows.count;

If you want to access each element in that table.

Use for loop for that.
For (int i=0;i<=dt.rows.count-1;i++)
(
For(int j=0;j<3;j++)
(
Textbox1.text=dt.rows[i].itemarray[j].tostring();
)
)

filter datatable->Data row[]->again back to table:
===================================================================
DataRow[] Abcd = availableBinTable.Select("Something NOT LIKE 'A%'");
DataTable temp=new DataTable();
if (Abcd != null && Abcd .Length > 0)
                {
                    temp= Abcd .CopyToDataTable();
                }

DataRow[] actualList = availableTable.Select("Condition1=' ' AND LGORT='" + storageLocation + "'");

If you just want to sort the table and keep the the data in another table:
===================================================================
DataView tempView= tempTable1.DefaultView;
tempView.Sort = "Col1 ASC, Col2 ASC";
DataTable tempTable2 = tempView.ToTable();

http://stackoverflow.com/questions/21036053/select-single-column-data-from-datatable-to-list

string.Join(",", dtExtWarehouseInfo.AsEnumerable().Select(s => s.Field<decimal>("FEXTERNALWAREHOUSEID")).Distinct().ToList());

How to check value exist in datatable column.
===================================================================
bool validValue = datatable.Select().ToList().Exists(tempRow => tempRow["ColumnName"].ToString().ToUpper() == value);

How to use ExecuteScalar in very safe zone(execute scaler is cheaper than datareader)
===================================================================
int myvalue = 0;
int.TryParse(Convert.ToString(db.ExecuteScalar(dbCmd, transaction)), out myvalue);

How to sum member of a list as per condition
===================================================================
receiveOrderInfoList.Where(x => x.NumberOfPack == 0 && x.NumberOfPack == 0).Select(x => x.PalletPackSize).Sum().ToString()

50. Automation testing using Visual studio.
1. https://www.youtube.com/watch?v=ONxwBDkXNj4&index=1&list=PL6tu16kXT9PrBqNFlv5sk6-63Br-Clmyd

2. https://www.youtube.com/channel/UCO1aucBAJgFR8odzfXOZ5uw

3. Create walkthroughs, onboarding guides, tooltips and product documentation to engage and support your users. For inline manual for our website.
    https://inlinemanual.com/

4. https://www.youtube.com/watch?v=P1ZqQFj1LPY

51. How Barcode Reader works with windows form in c#.
Reader work is reading barcodes and put the text to assigned textbox through async call back method. Here we have discussed its process

Step-1:
Assign the call back handler method for writing the scanned text to textBox in form constructor.

Step-2:
Initiate reader and start reading on form load.

Step-3:
Stop reading if navigating to next form.

Step-4:
Again start reading if returns to original form through form activation.

Step-5:
Stop reading and terminate reader while closing the form.

For examples
https://msdn.microsoft.com/en-us/library/aa446489.aspx
http://www.intermec.com/developer/CodeReferences/RoboHelp/NET_BarcodeReader/Events/BarcodeReader.BarcodeRead.htm


52. GAC links [how to install assembly into GAC in c#.net].
1. http://www.telerik.com/blogs/working-with-assemblies-in-the-global-assembly-cache

2. https://msdn.microsoft.com/en-us/library/ms973800.aspx

3. https://www.youtube.com/watch?v=x-KK7bmo1AM&list=PLyg4REiNOOXebabI9av3bo0OUYLu0Q8D4&index=18

4. https://www.youtube.com/watch?v=ckK4hgP6ZEE&list=PLyg4REiNOOXebabI9av3bo0OUYLu0Q8D4&index=73

5. https://www.youtube.com/watch?v=OYPq-kBQ3hQ&list=PLyg4REiNOOXebabI9av3bo0OUYLu0Q8D4&index=76

6. https://www.youtube.com/watch?v=tbycVZzubVs

7. https://www.youtube.com/watch?v=OYPq-kBQ3hQ

8. https://www.youtube.com/watch?v=ckK4hgP6ZEE

9. http://blackbearit.com/FreeDownloads.aspx

10. https://www.youtube.com/watch?v=ONxwBDkXNj4&feature=youtu.be&list=PL6tu16kXT9PrBqNFlv5sk6-63Br-Clmyd

11. https://www.codeproject.com/Tips/585817/Installing-a-DLL-into-the-Global-Assembly-Cache-GA

12. https://www.codeproject.com/Articles/4352/Demystifying-the-NET-Global-Assembly-Cache

13. https://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.71).aspx

14. https://msdn.microsoft.com/en-us/library/0a7zy9z5(v=vs.71).aspx

15. https://msdn.microsoft.com/en-us/library/0a7zy9z5(v=vs.110).aspx

16. https://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx

17. https://msdn.microsoft.com/en-us/library/dd153782(v=vs.110).aspx

18. http://stackoverflow.com/questions/997921/how-would-i-load-an-assembly-from-the-gac

19. https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

20. https://msdn.microsoft.com/en-us/library/6axd4fx6(v=vs.110).aspx

21. https://msdn.microsoft.com/en-us/library/b0b8dk77(v=vs.110).aspx

22. https://msdn.microsoft.com/en-us/library/51ket42z(v=vs.110).aspx

23. https://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx

24. https://msdn.microsoft.com/en-us/library/yf1d93sz(v=vs.110).aspx

25. https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

26. https://www.youtube.com/watch?v=FYmRrEYyhCM

27. https://www.youtube.com/watch?v=ruf4U9_Rbss&list=PL8598C97BA1D871C1

28. https://msdn.microsoft.com/en-us/library/26thfadc(v=vs.110).aspxhttps://msdn.microsoft.com/en-us/library/26thfadc(v=vs.110).aspx

29. https://msdn.microsoft.com/en-us/library/fzhhdwae(v=vs.110).aspx

30. http://www.c-sharpcorner.com/uploadfile/mahesh/understanding-message-box-in-windows-forms-using-C-Sharp/

31. https://msdn.microsoft.com/en-us/library/aa446489.aspx#barcode_scanners_netcf_topic5

32. https://www.youtube.com/watch?v=h56ouqWzc6M

33. http://asprise.com/document-scan-upload-image-browser/direct-to-server-php-asp.net-overview.html

34. https://msdn.microsoft.com/en-us/library/aa446550.aspx

35. https://www.youtube.com/user/BlackBearIT/videos

36. Technical bullet points about GAC.
      a) When you install any dll from your application into GAC and suppose the dll is getting reffered by some other application. Then after uninstallation of your application may be your dll still be there in GAC Because till it is getting referenced by some other application it will not remove the dll from GAC.

b)

37. What is strong name key in assembly
https://msdn.microsoft.com/en-us/library/6f05ezxy(v=vs.110).aspx
http://stackoverflow.com/questions/131181/what-is-a-snk-for

53. Application pool.

1. https://www.youtube.com/watch?v=JJmURky86-Q
 2. https://www.youtube.com/watch?v=idWaXXYOFDU
 3. https://www.youtube.com/watch?v=WlYxtGwKQqo&index=79&list=PL6n9fhu94yhXQS_p1i-          HLIftB9Y7Vnxlo

54. Setting environment for working in visual studio.

Installation for working with visual studio

step-1:
first install Visual studio.

step-2:

Then Sql Server.

55. Tracing of asp.net page.

1. https://www.youtube.com/watch?v=WlYxtGwKQqo&list=PL6n9fhu94yhXQS_p1i-                            HLIftB9Y7Vnxlo&index=79
 2. https://www.youtube.com/watch?v=SDygt1pZXss&list=PL6n9fhu94yhXQS_p1i-                                HLIftB9Y7Vnxlo&index=80
 3. https://www.youtube.com/watch?v=q8iGrvcKjmc&index=81&list=PL6n9fhu94yhXQS_p1i-              HLIftB9Y7Vnxlo
 4. Or By writing custom log in each catch block of exception to a particular location.

56. GuideLines for creating MaterPage.
Guidelines for creating Master page:
1. Files level coding.
file DAL.cs
=========================================================
file svc.cs
=========================================================
Object file.cs
=========================================================
IContractService.cs
=========================================================
BllFile.cs
=========================================================
WebService.asmx.cs
=========================================================
UserControl.ascx
UserControl.ascx.cs
UserControl.ascx.designer.cs
=========================================================
ExcelUploadHandler.ashx
=========================================================
ExcelDownloadHandler.ashx
=========================================================

page.aspx
page.aspx.cs
page.aspx.designer.cs

Jqueryfile.js

TabResource.resx

pageResource.resx

globalresourceforpage.resx

pageScriptResource.js

2. Excel Upload and Download maintain
     1.Keep sheet name in normal English text only.
     2.Column name for excel download we must keep as global resource.
     3.Messages for excel upload we must keep as global resource.
     4.For column separated by comma
    var abc = row["excelColumn"].ToString().Trim().TrimStart(',').TrimEnd(',');//this will       trim space and comma from begining and end

    string[] abcArray = abc.Split(',').Select(x =>x.Trim()).ToArray();//this will                 trim space for each complementary material

    abcArray= abcArray.Where(x => !string.IsNullOrEmpty(x)).ToArray();//this will remove         blank complementary material and concentrated material from the complementary material       array
   5.Validate your message perfectly for excel messages as well as logging exception. So it        should be nice to see the message.
   6.Method names should be properly spelled because it will help to understand them better.
   7.Beware of recalling DB calls unnecessarily try to explore the existing one and use for        other purpose. Minimize the db call as much as possible.
   8.When multiple sheets are there that have to be handled through different methods.
   9.for first and main condition think about it for all values to be validated, comparison  
     should be done if range is there.
  10.trim all excel columns and this is must to do.
  11.Check connection closing if it is used.
  12.Check DataReader is closed immediately after use and in finally block properly.
  13.check if needed language for setting thread culture.
  14.Maintain the transaction commit and rollback if it is used.
  15.Keep the creating and initializing db object inside try block.
  16.Set each column width for excel download 
     wSheet.Cells.ColumnWidth[0, (ushort)columnindex] = 6000;
     wSheet.Cells.ColumnWidth[1, (ushort)columnindex] = 9000;
  17.Add extra rows if records are less than 100. Bug in excel.
  18.If possible try to use same page Load query method for excel download also by passing        and putting page size 0.
  19.set the column string property for excel download
     wSheet.Cells[rowindex,columnindex]=newCell(value.Trim(),CellFormat.General.FormatString)
  20.Line numbers maintain correctly.
  21.Table name should look good.
  22.Setting thread culture while excel upload and download for diff language resource.  
  23.wSheet.Cells[rowindex, columnindex] = new Cell(complementaryMaterial.Trim(), "@");
           for making the excel column as text. 
    24. If (materialNumber.Length > 0 || stdRate > 0 || qualityMethod.Length > 0 ||                        complementaryMaterials.Length > 0 || complementaryIDHArray.Length > 0)
               for ignoring the blank row of excel.
  25.



  3. In user control backend maintain session by inheriting BasePage for working in different                     languages.
  4. For all new pages and new global resources you need to send designer page also.
  5. In WCF while fetching  total count  I was using one bool variable or count variable for setting            total count value only one time But there also we can optimize it. By remove these extra variable        by just putting one condition when initially total count of that object is zero then set total count.
  6. Getting Tab icons from css team.
  7. For a new brand page creates a new region or update  your code under the existing region
  8. For putting check on textBox first check whether it is empty and then check it is valid or not.
  9. After excel upload done reset the pageIndex and currentPage value and call pageLoad method.
10. Handle the button event on just Enter Click.
11. Add/Edit form name and control text member name should be proper and nice.
12. Disable the Add button and Excel Upload Control if the user has read and edit permission only.
13. Whenever you face problem with text length or size then go and check the db for length.

57. Magic of working with linq & list of object.

1. https://stackoverflow.com/questions/4765084/convert-a-list-of-objects-to-an-array-of-one-of-the-objects-properties/4765090#4765090

getting member array from list of object:
=======================================================================
int[] arrayvalues = kanbanBinInformation.ProductionLineWithResourceList.Select(x => x.PlineID).ToArray();

string[] arrayvalues = kanbanBinInformation.ProductionLineWithResourceList.Select(x => x.PlineID.ToString()).ToArray();

filtering an array of object based on its member
========================================================================
var abcList = (from r in mainList where r.Condition == "A" select r).ToList();
                    if (abcList.Count > 0)
                    {
                        grdTemp.DataSource = abcList;
                        grdTemp.DataBind();
                    }

Initializing a list with one member
========================================================================
List<int> aam = new List<int> { intValue };

Getting a list of distinct member from a filtered list based on its member
========================================================================
List<string> aam= AAmList.Where(i => i.m1 == 2).Select(j => j.m2).Distinct().ToList();


List<string> aam= AAmList.Where(i => i.m1 == 2).Select(j => j.m2).Distinct().Except(someValues).ToList();


How To Select first matched object from list of objects
========================================================================
AAM aam = aamList.Where(i => i.m1 == 23)).FirstOrDefault();


http://stackoverflow.com/questions/4937060/how-to-check-if-listt-element-contains-an-item-with-a-particular-property-valu

http://stackoverflow.com/questions/4351876/c-sharp-list-of-objects-how-do-i-get-the-sum-of-a-property

http://stackoverflow.com/questions/853526/using-linq-to-remove-elements-from-a-listt

How to exclude members of a list of objects which is available in another string list.
List<iPAS_PalletInfo.AvailableBinInfo> availableBinList = availableBinListInfo.FindAll(x => !storageTypeList.Contains(x.StorageType) && x.MaterialNumber == info.IDHID.PadLeft(18, '0'));

Best Title to search in google:
how to exclude members from list as per values in c#

http://stackoverflow.com/questions/14959824/convert-list-into-comma-separated-string

From List to comma separated string 
---------------------------------------------------------------------------------
With single quoted comma separated string
string list = "'" + string.Join("','", List) + "'";
only comma separated string
string list = string.Join(",", List);

http://stackoverflow.com/questions/7617771/converting-from-ienumerable-to-list

https://stackoverflow.com/questions/4104536/spliting-a-list-into-multiple-lists/4104566#4104566

string value = dtStorageType.AsEnumerable().Where(r => r.Field<string>("FBINLOCATION") == "'" + sourceLocation.Trim().ToUpper() + "'").Select(dr => dr.Field<string>("FSTORAGETYPE")).ToList().FirstOrDefault();

string parameterType = dtCCPParameterTypes.Select("FPARAMETERTYPEID='" + ccpForInsertUpdate.ParameterTypeID + "'").Select(dr => dr.Field<string>("FPARAMETERTYPENAME")).ToList().FirstOrDefault();

string parameterUnits = string.Join(",", dtCCPParameterUnits.AsEnumerable().Where(r => ccpForInsertUpdate.ParameterUnitIDList.Contains(Convert.ToInt32(r.Field<object>("FUOMID")))).Select(dr => dr.Field<string>("FPARAMETERUOMNAME")).ToList());

List<string> listOfMaterials = new List<string>();
                    for (int i = 0; i < materialList.Count(); i += 20)
                    {
                        listOfMaterials = materialList.Skip(i).Take(20).ToList();
                        qcDetailsTable = Ommu(listOfMaterials, plantCodeList, fromDate, toDate);

                        if (qcDetailsTable != null && qcDetailsTable.Rows.Count > 0)
                        {
                            foreach (DataRow dr in qcDetailsTable.Rows)
                            {
                                mainQcDetailsTable.ImportRow(dr);
                            }
                        }
                    }


https://www.dotnetperls.com/list-addrange..(Add Range)
TargetCollection[] targetCollection = values.
List<TargetCollection> targetValueList = new List<TargetCollection>();
targetValueList.AddRange(targetCollection);

How to convert a list or an array into single quoted comma separated strings
====================================================================
string resources = "'" + string.Join("','", resourceList.ToArray().Distinct()) + "'";

How to filter list with another list based on their properties
====================================================================
subscribeTagList = tagsList.TagInfoList.Where(x => !subscribeTagList.Any(y => y.TagID == x.TagID)).ToList();

How to update multiple property in a list
====================================================================
DeleteOrSubscribeOrUnsubscribeList.Where(x => x.OpcServerTagInfo.TagID == tagIDValue && x.LineNumber != maxLineNumber).ToList().ForEach(i => { i.OverridenLineNumber = maxLineNumber; i.IsIgnoreOperation = true; });

How to select multiple field from a list and store it in a another list:
https://stackoverflow.com/questions/1202981/select-multiple-fields-from-list-in-linq
A=>a,b members
List A = List B.Where(x => x.IsSelected == true).Select(x => new A() { a= x.ConsumabelPackageID, b= x.UsageCount }).ToList();

58. Exploring on Web.config and web.sitemap

1. http://stackoverflow.com/questions/4731403/configuring-wcf-with-services-tag
2. http://stackoverflow.com/questions/2584680/wcf-define-multiple-services-in-a-single-app-config-file


59. Exploring on IIS.

1. http://www.codeproject.com/Articles/42724/Beginner-s-Guide-Exploring-IIS-With-ASP-NET

2. http://iis-7.blogspot.in/2012/09/iis-interview-questions.html

3. http://www.dotnetfunda.com/interviews/cat/122/iis

4. http://www.interviewwiz.com/iis-interview-questions-answers/

5. https://technet.microsoft.com/en-us/library/cc754702(v=ws.10).aspx

6. http://www.surfray.com/blog/2009/08/11/iis-log-file-formats-overview/

7. https://blogs.msdn.microsoft.com/carlosag/2010/03/25/analyze-your-iis-log-files-favorite-log-parser-queries/

8. http://www.symantec.com/connect/articles/forensic-log-parsing-microsofts-logparser

9. https://gallery.technet.microsoft.com/Log-Parser-Studio-cd458765

10. https://blogs.msdn.microsoft.com/mmcintyr/2009/07/20/analyzing-iis-log-files-using-log-parser-part-1/

11. http://iisexplore.blogspot.in/2014/09/how-to-use-domain-name-instead-of.html

12. https://sourceforge.net/projects/iislogviewer/ -----for log viewer software.

13. https://www.iis.net/configreference/system.applicationhost/sites/sitedefaults/logfile

14. https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=24659

15. http://www.surfray.com/blog/2009/08/11/iis-log-file-formats-overview/

16. http://www.loganalyzer.net/log-analyzer/w3c-extended.html

17. http://www.iis.net/learn/manage/provisioning-and-managing-iis/configure-logging-in-iis

18. https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/989a6b5c-               289c-4a7c-95b5-175ee4c27159.mspx?mfr=true
19. http://mahedee.net/web-gardening-in-iis-7-configure-step-by-step/

20. http://stackoverflow.com/questions/4890245/how-to-add-asp-net-4-0-as-application-pool-on-iis-7-windows-7

21. http://www.gotknowhow.com/articles/how-to-install-iis7-and-enable-aspnet
      How to register asp.net in windows 10.
      http://stackoverflow.com/questions/39659281/register-asp-net-in-iis-10

22. https://msdn.microsoft.com/en-us/library/k6h9cz8h(v=vs.100).aspx

23. How to register your IIS
http://www.aspsnippets.com/Articles/Installing-and-registering-ASPNet-with-IIS-and-add-ASPNet-40-Application-Pool-in-IIS.aspx

24. Video tutorial on IIS
 https://www.youtube.com/watch?v=mhbl_acCqF8&list

25. Video tutorial on IIS and fixing issues under IIS.
https://www.youtube.com/watch?v=mhbl_acCqF8&index=7&list=PLESZpcGTq87GPJKJCUrWyAurc8mi9CvdZ

26. Error Or Success Https Result codes

27.  
IIS Error types
https://support.microsoft.com/en-us/help/942055/-http-error-500.19-error-when-you-open-an-iis-7.0-webpage

60. c# interview Questions

http://www.f5debug.net/post/2012/09/17/350-Interview-Questions-and-Answers-on-Net-Framework-OOPS-ASPNet-CNet-SQL-Server-WCF-in-one-place.aspx

http://www.aspdotnet-suresh.com/2015/04/csharp-interview-questions-and-answers-for-experienced-freshers-with-examples.html

61. How to Bind Data to ComboBox from Database in Windows Form || How to Set Default Select Item in ComboBox using C#.Net.

http://dotnetsridhar.blogspot.in/2012/04/binding-combobox-in-windows.html

62. How to use StreamWriter and FileStream

string txtFile = path + "//" + fileName + "_tempError.txt";
                    using (FileStream errorFileStream = new FileStream(txtFile, FileMode.Create, FileAccess.Write))
                    {
                        using (StreamWriter errorStreamWriter = new StreamWriter(errorFileStream))
                        {
                            errorStreamWriter.Write(ex.Message);
                            errorStreamWriter.Close();
                        }
                        errorFileStream.Close();
                    }

63. Culture Names [C#]

http://www.csharp-examples.net/culture-names/
https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx
http://www.lingoes.net/en/translator/langcode.htm

64. How to use Enum

From Char to Enum
====================================
EnumMember  val= (EnumMember)Convert.ToChar(Data read from datareader or data table in string);

From string to Enum
====================================
EnumMember  val = (EnumMember )Enum.Parse(typeof(EnumMember), string val);

from enum to string
====================================
string val=EnumMember.EnumValue.toString();

from enum to char
====================================
char abc=(char)EnumMember.EnumValue;

How to pass enum value from js to service side:
 [DataContract]
 public enum ZodiacType
 {
     [EnumMember]
     ZoomOut = 'P',
     [EnumMember]
     ZoomIn = 'Q',
     [EnumMember]
     Other = 'O'

 }
for Above enum structure if we want to pass the enum value from js to service side then the solution is either the entire word like ZoomOut or ascii code of P has to pass.

65. How to read from Excel into DataTable.

string path = System.Configuration.ConfigurationManager.AppSettings["DemoExcelFile"].TrimEnd('/');

                string filePath = path + "\\VendorEmail.xlsx";



                string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source='" + filePath + "'; Extended Properties='Excel 8.0;HDR=Yes'";



                System.Data.DataSet dtExcelDataSet;

                System.Data.OleDb.OleDbDataAdapter oledbObject;

                OleDbConnection olDbObjConn = new OleDbConnection(connectionString);

                oledbObject = new System.Data.OleDb.OleDbDataAdapter("select * from [VENDOR EMAIL ID$]", connectionString);

                dtExcelDataSet = new System.Data.DataSet();

                oledbObject.Fill(dtExcelDataSet);



                DataTable excelDataTable = dtExcelDataSet.Tables[0];

                excelDataTable = excelDataTable.Rows.Cast<DataRow>().Where(row => !row.ItemArray.All(field => field is System.DBNull || string.Compare((field as string).Trim(), string.Empty) == 0)).CopyToDataTable();// for removing blank rows from excel table

66. WireFrames Link

http://www.c-sharpcorner.com/technologies/project-management

http://www.c-sharpcorner.com/UploadFile/ansh06031982/working-with-wireframes/

http://www.c-sharpcorner.com/UploadFile/84c85b/agile-net-development/

67. How to crop image from existing image.

http://www.aspdotnet-suresh.com/2015/05/jquery-ajax-crop-and-upload-image-with-preview-example-in-aspnet-using-csharp-vbnet.html

68. How to create ThumBNail from the existing Image path With How to do Zip Uploading.


private void UploadAnyImageFiles(string fileName, string thumbnailPath, string zipFolder, HttpContext context)
        {
            try
            {
                var file = context.Request.Files[0];
                ZipInputStream zins = new ZipInputStream(file.InputStream);
                ZipEntry ze = zins.GetNextEntry();
                while (ze != null)
                {
                    if (!ze.IsDirectory)
                    {
                        if (!Directory.Exists(zipFolder + Path.GetDirectoryName(ze.FileName)))
                        {
                            Directory.CreateDirectory(zipFolder + Path.GetDirectoryName(ze.FileName));
                        }
                        ze.CompressionMethod = CompressionMethod.BZip2;
                        FileStream fs = File.Create(zipFolder + ze.FileName);

                        byte[] writeData = new byte[ze.UncompressedSize];
                        int iteration = 0;
                        while (true)
                        {
                            int size = 2048;
                            size = zins.Read(writeData, (int)Math.Min(ze.UncompressedSize, (iteration * 2048)), (int)Math.Min(ze.UncompressedSize - (int)Math.Min(ze.UncompressedSize, (iteration * 2048)), 2048));
                            if (size > 0)
                            {
                                fs.Write(writeData, (int)Math.Min(ze.UncompressedSize, (iteration * 2048)), size);
                            }
                            else
                            {
                                break;
                            }
                            iteration++;
                        }
                        fs.Close();
                        string path = zipFolder + Path.GetDirectoryName(ze.FileName);

                        string[] actualFileName = ze.FileName.Split('/');
                        path = path + "\\" + actualFileName[actualFileName.Length - 1];
                        using (System.Drawing.Image Img = System.Drawing.Image.FromFile(path))
                        {
                            Size ThumbNailSize = NewBrandImageSize(Img.Height, Img.Width, 300);
                            using (System.Drawing.Image ImgThnail = new Bitmap(Img, ThumbNailSize.Width, ThumbNailSize.Height))
                            {
                                if (!System.IO.Directory.Exists(thumbnailPath))
                                    System.IO.Directory.CreateDirectory(thumbnailPath);

                                ImgThnail.Save(thumbnailPath + actualFileName[actualFileName.Length - 1], Img.RawFormat);
                                ImgThnail.Dispose();
                            }
                            Img.Dispose();
                        }
                    }
                    ze = zins.GetNextEntry();
                }
                zins.Close();
                context.Response.Write(true);
            }
            catch (Exception ex)
            {
                context.Response.ContentType = "text/plain";
                context.Response.Write(ex.Message);
            }
            finally
            {
                context.Response.End();
            }

        }


69. Take care of fileSize while uploading through Uploader in c#

Case 1: Change the web config for increasing size of file
http://www.telerik.com/blogs/upload-large-files-asp-net-radasyncupload
http://stackoverflow.com/questions/4548305/maximum-value-of-maxrequestlength

Case2: If we want to upload zip file
http://community.sharpdevelop.net/forums/p/6873/23543.aspx


Case3: Property of webConfig
https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.71).aspx

Case4: Default limits in web config
https://msdn.microsoft.com/en-us/library/ms689462(VS.90).aspx

70. How to call a server side method using Scriplet from aspx page

src="<%= UserProfileImage() %>"

71. Download content in Excel file

Step-1:

 delegate void DownLoadStagingAreaMaterialInfoExcel(Database db, StagingAreaFilter stagingAreaFilter, string fileName);

Step-2:

public string GetStagingAreaMaterialInfoForExcel(StagingAreaFilter stagingAreaFilter)
        {
            string fileName = "StagingAreaMaterialInfo_Excel" + DateTime.Now.ToString("ddMMhhmmssffff");
            Database db = DatabaseFactory.CreateDatabase("ApplicationConnection");
            DownLoadStagingAreaMaterialInfoExcel materialInfoForExcel = new DownLoadStagingAreaMaterialInfoExcel(GetMaterialInfoForSatgingArea);
            AsyncCallback cb = new AsyncCallback(send);
            IAsyncResult ar = materialInfoForExcel.BeginInvoke(db, stagingAreaFilter, fileName, cb, null);
            return fileName;
        }

        private void GetMaterialInfoForSatgingArea(Database db, StagingAreaFilter stagingAreaFilter, string fileName)
        {
            string languageCode = "en-US";
            if (stagingAreaFilter.LanguageCode.Trim().Length > 0)
            {
                languageCode = stagingAreaFilter.LanguageCode.Trim();
            }
            Common.SetCurrentThreadCulture(db, languageCode);

            string logFilePath = ConfigurationManager.AppSettings["LogFileLocation"].TrimEnd('\\');
            Workbook workBook = new Workbook();
            Worksheet workSheet = new Worksheet(Language_Resources.Staging_Resource.stagingAreaMaterials);
            workBook.Worksheets.Add(workSheet);
            int rowIndex = 0;
            int columnIndex = 0;

            try
            {
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.idhid);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.idhDesc);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.binName);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.packSize);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.totalQty);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.unit);
                columnIndex++;
                workSheet.Cells[rowIndex, columnIndex] = new Cell(Language_Resources.Staging_Resource.reservedQty);

                string completeFileName = fileName + ".xls";
                string targetFilePath = logFilePath + "\\" + completeFileName;

                GetContentForStagingAreaMaterialInfoForExcel(db, stagingAreaFilter, targetFilePath, workSheet, workBook);
               
                string txtFilePath = logFilePath + "\\" + fileName + "_tempSuccess.txt";
                using (FileStream fileStrm = new FileStream(txtFilePath, FileMode.Create, FileAccess.Write))
                {
                    using (StreamWriter sw = new StreamWriter(fileStrm))
                    {
                        sw.Write("Excel file successfully created");
                        sw.Close();
                    }
                    fileStrm.Close();
                }

            }
            catch (Exception ex)
            {
                string filePath = logFilePath + "\\" + fileName + "_tempError.txt";
                using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
                {
                    using (StreamWriter sr = new StreamWriter(fs))
                    {
                        sr.Write(ex.Message);
                        sr.Close();
                    }
                    fs.Close();
                }
                Common.LogException(ex, "StagingService", "Failed to export staging area material info to excel file", "iPAS_PreWeighService", System.Reflection.MethodBase.GetCurrentMethod().Name, "SiteID:" + stagingAreaFilter.SiteID);
                throw new FaultException(ex.Message);
            }

        }


        private void GetContentForStagingAreaMaterialInfoForExcel(Database db, StagingAreaFilter stagingAreaFilter, string targetFilePath, Worksheet workSheet, Workbook workBook)
        {

            IDataReader dataReaderStagingAreaInfo = null;
            int rowIndex = 1;
            int columnIndex = 0;
            string idhID = string.Empty;
            string idhDesc = string.Empty;
            string storageBin = string.Empty;
            string packSize = string.Empty;
            string totalQty = string.Empty;
            string unit = string.Empty;
            string reservedQty = string.Empty;
            try
            {
                dataReaderStagingAreaInfo = StagingDAL.GetStagingAreaInfo(db, stagingAreaFilter.SiteID, 0, 0, null, stagingAreaFilter.IdhSearch, stagingAreaFilter.DescriptionSearch, stagingAreaFilter.StaginBinSearch);

                while (dataReaderStagingAreaInfo.Read())
                {
                    columnIndex = 0;
                    idhID = Common.GetSafeString(dataReaderStagingAreaInfo, "FMATNR");
                    idhDesc = Common.GetSafeString(dataReaderStagingAreaInfo, "FIDHDESC");
                    storageBin = Common.GetSafeString(dataReaderStagingAreaInfo, "FSTORAGEBIN");
                    packSize = Common.GetSafeDecimal(dataReaderStagingAreaInfo, "FPACKSIZE").ToString();
                    totalQty = Common.GetSafeDecimal(dataReaderStagingAreaInfo, "FTOTALQTY").ToString();
                    unit = Common.GetSafeString(dataReaderStagingAreaInfo, "FUOM");
                    reservedQty = Common.GetSafeDecimal(dataReaderStagingAreaInfo, "FRESERVEDQTY").ToString();

                    workSheet.Cells[rowIndex, columnIndex] = new Cell(idhID.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(idhDesc.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(storageBin.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(packSize.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(totalQty.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(unit.Trim());
                    columnIndex++;
                    workSheet.Cells[rowIndex, columnIndex] = new Cell(reservedQty.Trim());
                    rowIndex++;
                }

                dataReaderStagingAreaInfo.Close();

                if (rowIndex <= 50)
                {
                    int row = 100 - rowIndex;
                    for (int i = 0; i <= row; i++)
                    {
                        columnIndex = 25;
                        workSheet.Cells[rowIndex, columnIndex] = new Cell("");
                        rowIndex++;
                    }
                }
                workSheet.Cells.ColumnWidth[0, (ushort)columnIndex] = 8000;
                workBook.Save(targetFilePath);
            }
            catch (Exception ex)
            {
                throw new FaultException(ex.Message);
            }
            finally
            {
                if (dataReaderStagingAreaInfo != null && !dataReaderStagingAreaInfo.IsClosed)
                {
                    dataReaderStagingAreaInfo.Close();
                }
            }
        }

72. For video and Pages in Html

<head>
<script type="text/javascript">
var image1 = new Image()
image1.src = "http://www.planwallpaper.com/static/images/canberra_hero_image_JiMVvYU.jpg"
var image2 = new Image()
image2.src = "http://www.planwallpaper.com/static/images/images_1_05GM1zY.jpg"
var image3 = new Image()
image3.src = "http://192.168.1.107/iPAS_ImageUploader/PackageProductImages/2/1831573/1455859837059_12376216_10154212105857289_3062536329473909072_n.mp4"
</script>
</head>
<body>
<p><img src="images/pentagg.jpg" width="500" height="300" name="slide" /></p>
<script type="text/javascript">
        var step=1;
        function slideit()
        {
            document.images.slide.src = eval("image"+step+".src");
            if(step<2)
                step++;
            else
                step=1;
            setTimeout("slideit()",2500);
        }
        slideit();
</script>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" loop/>
<video width="320" autoplay height="240" controls>
  <source src="http://192.168.1.107/iPAS_ImageUploader/PackageProductImages/2/1831573/1455859837059_12376216_10154212105857289_3062536329473909072_n.mp4" type="video/mp4">

</video>
<video width="320" autoplay height="240" controls loop>
  <source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
</video>
</body>

73. To support all kind of language support for script resource.

<add key="SupportLanguages" value="zh-CN,id-ID,ko-KR"/> in front end

74. Nice article for backend with sql server.

https://www.codeproject.com/Articles/837599/Using-Csharp-to-connect-to-and-query-from-a-SQL-da

75. How to write inline if condition.

if (value == null) value  = string.Empty;

76. How to create an installer for web application.

http://www.aspdotnet-suresh.com/2017/03/create-installer-setup-file-for-aspnet-web-application.html?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+aspdotnet-suresh+%28Aspdotnet-Suresh.Com+Recent+Articles%29

77. How to loop through panel controls.

        foreach (Control c in ShowContainerTypesPanel.Controls)
            {
                if (c is Button)
                {
                    if (c.Tag != btnContainer.Tag)
                    {
                        c.BackColor = SystemColors.Control;
                    }
                }

            }


77. Explore Dotnet more.

http://www.csharpstar.com/visual-studio-key-board-shortcuts/

78. How  to use Code Snippets (c#) and Surround with in visual studio.
By typing the control and then 2 times continuous pressing TAB.
ex: try, if, foreach etc.
https://msdn.microsoft.com/en-us/library/z4c5cc9b(v=vs.90).aspx
https://msdn.microsoft.com/en-us/library/6hf704tz.aspx


79. Exception Handling in c#.

how to use tryParse and differences between them.
https://www.codeproject.com/Tips/845439/Difference-between-int-Parse-Convert-ToInt-and-int
http://www.c-sharpcorner.com/article/exception-handling-in-C-Sharp/
http://stackoverflow.com/questions/136035/catch-multiple-exceptions-at-once
http://stackoverflow.com/questions/5563397/catch-two-exceptions-in-the-same-catch-block


80. delegates in c#.

http://www.c-sharpcorner.com/uploadfile/rekhasingh1610/delegates-in-C-Sharp/
https://www.codeproject.com/Articles/109000/C-Delegates-Step-by-Step
https://www.codeproject.com/Articles/85296/important-uses-of-Delegates-and-Events


81. How to trim single qoute.
row["TABLE_NAME"].ToString().Trim('\'')--trim single quote

82. How to filter data table when coulmn name is having space.
excelDataTableForCCPDesc.Select("[Parameter Name]='" + parameterName.Trim() + "'");

83.How to use DropDown List in c#
drpPLCTags.DataSource = tags;
drpPLCTags.DataTextField = "ResourceCode";
drpPLCTags.DataValueField = "ResourceID";

drpPLCTags.DataBind();

string tagID = tags.Where(O => O.ResourceID == parameterInfo.TagID).First().ResourceID.ToString();
drpPLCTags.ClearSelection();

drpPLCTags.Items.FindByValue(tagID).Selected = true;

drpPLCTags.Items.Insert(0, new ListItem(Language_Resources.ProductionArea_Resource.noTagItems, "0"));

84. How to check decimal entry in windows form in c#
private void partBagQtyTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (Char.IsControl(e.KeyChar))
            {
            }
            else if (Char.IsNumber(e.KeyChar) || e.KeyChar == '.')
            {
                TextBox tb = sender as TextBox;
                int iCursorPosLeft = tb.SelectionStart;
                int iCursorPosRight = tb.SelectionStart + tb.SelectionLength;
                string sResult = tb.Text.Substring(0, iCursorPosLeft) + e.KeyChar + tb.Text.Substring(iCursorPosRight);
                string[] sParts = sResult.Split('.');
                if (sParts.Length > 1)
                {
                    if (sParts[1].Length > 3 || sParts.Length > 2)
                    {
                        e.Handled = true;
                    }
                    else if (sParts[0].Length >= 10 && sParts[1].Length > 3 && e.KeyChar != '.')
                    {
                        e.Handled = true;
                    }
                }
                else
                {
                    if (sParts[0].Length >= 11)
                    {
                        e.Handled = true;
                    }
                }
            }
            else if (!char.IsNumber(e.KeyChar) && e.KeyChar != '.')
            {
                e.Handled = true;
            }
        }

How to get the method name,Line Number and column name from stack trace in which exceptions has been occured[this works only if we have pdb file in production system]
=============================================================
StringBuilder sbResult = new StringBuilder();
                System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(ex, true);
                int lastIndex = stackTrace.GetFrames().Length - 1;

                if (lastIndex >= 0)
                    sbResult.AppendLine(", Trace: Method Name: " + stackTrace.GetFrame(lastIndex).GetMethod() + ", Line number: " + stackTrace.GetFrame(lastIndex).GetFileLineNumber() + ", Column number: " + stackTrace.GetFrame(lastIndex).GetFileColumnNumber());

                //System.Reflection.MethodBase.GetCurrentMethod().Name

How to pics are loading in case of web and handheld?
------------------------------------------------------------------------
Web-through image path.
Handheld-through base 64 conversion of image then send to handheld.



How to Minify the JS in best possible way inside the project:

===============================================
1. using Microsoft Ajax Minifier
https://www.nuget.org/packages/AjaxMin/

 <!-- Minify all JavaScript/CSS files that were embedded as resources -->
  <UsingTask TaskName="AjaxMin" AssemblyFile="$(MSBuildProjectDirectory)\bin\AjaxMinTask.dll" />
  <!-- Step-1:Removing any existing Minified Files (Cleaning) -->
  <Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
    <RemoveDir Directories="$(MSBuildProjectDirectory)\MScripts\Scripts\" ContinueOnError="True" />
    <RemoveDir Directories="$(MSBuildProjectDirectory)\MScripts\ScriptResources\" ContinueOnError="True" />
    <CallTarget Targets="CopyJSAndCSS" />
  </Target>
  <!-- Step-2:Copying JS/CSS files to MinifiedJS\Scripts location making them ready for minification -->
  <Target Name="CopyJSAndCSS">
    <ItemGroup>
      <SourceFilesToCopy Include="$(MSBuildProjectDirectory)\Scripts\*.js;$(MSBuildProjectDirectory)\Scripts\*.min.js">
      </SourceFilesToCopy>
      <SourceFilesScriptResourceCopy Include="$(MSBuildProjectDirectory)\ScriptResources\*.js">
      </SourceFilesScriptResourceCopy>
    </ItemGroup>
    <Copy SourceFiles="@(SourceFilesToCopy)" DestinationFiles="@(SourceFilesToCopy->'$(MSBuildProjectDirectory)\MScripts\Scripts\%(RecursiveDir)%(FileName)%(Extension)')" />
    <Copy SourceFiles="@(SourceFilesScriptResourceCopy)" DestinationFiles="@(SourceFilesScriptResourceCopy->'$(MSBuildProjectDirectory)\MScripts\ScriptResources\%(RecursiveDir)%(FileName)%(Extension)')" />
    <CallTarget Targets="MinifyFiles" />
  </Target>
  <!-- Step-3:MINIFY JS & CSS -->
  <Target Name="MinifyFiles">
    <ItemGroup>
      <JSFilesToMinify Include="$(MSBuildProjectDirectory)\MScripts\Scripts\*.js" Exclude="$(MSBuildProjectDirectory)\MScripts\Scripts\*.min.js">
      </JSFilesToMinify>
      <JSScriptFilesToMinify Include="$(MSBuildProjectDirectory)\MScripts\ScriptResources\*.js">
      </JSScriptFilesToMinify>
    </ItemGroup>
    <AjaxMin JSSourceFiles="@(JSFilesToMinify)" JSSourceExtensionPattern="\.js$" JSTargetExtension=".js">
    </AjaxMin>
    <AjaxMin JSSourceFiles="@(JSScriptFilesToMinify)" JSSourceExtensionPattern="\.js$" JSTargetExtension=".js">
    </AjaxMin>
    <!--<CallTarget Targets="DeleteOrigFiles" />-->

  </Target>

2. Using Gulp Installation.
https://www.youtube.com/watch?v=1NzZg77VqdY


Step-1:
Install Latest Version of Node.js on the system.

node -v
Npm -v

Step-2:
Install gulp using npm syntax

npm install -g gulp

To check Gulp Version
gulp -v

No to apply Gulp to project follow below steps
Gulp is having so many functionality like bundling([clubbing content of css or js files into one]),minifying,watching etc.

To demonstrate this lets go to project folder through cmd prompt.

npm init

npm install --save-dev gulp
npm install --save-dev gulp-uglify
npm install --save-dev gulp-concat

var gulp = require('gulp'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify');

gulp.task('scripts', function () {
    return gulp.src('scripts/*.js').pipe(concat('all.js')).pipe(gulp.dest('scripts'))
});

gulp.task('BundlingAndMinifying', function () {
    return gulp.src(['scripts/ram.js', 'scripts/raju.js', 'scripts/rallu.js']).pipe(concat('Ball.js')).pipe(uglify()).pipe(gulp.dest('scripts'))
});


3. Using ScriptBundle in ASP.NET
============================
Download nuget package manager
https://marketplace.visualstudio.com/items?temName=NuGetTeam.NuGetPackageManager

http://www.tutorialsteacher.com/mvc/scriptbundle-mvc



In Handler .ashx.cs file at last to throw exception we should write in content instead of throwing exception.

http://ajaxmin.codeplex.com/
https://www.youtube.com/watch?v=gmxoC7HkylE
https://www.youtube.com/watch?v=UCgpxct9eLQ
https://www.youtube.com/watch?v=oriQyM9NMUY
https://www.youtube.com/watch?v=gmxoC7HkylE
https://www.youtube.com/watch?v=YpfATz2w-Uw
https://www.lynda.com/ASP-NET-tutorials/Bundling-minification/170334/191111-4.html
debugging with fidler

https://channel9.msdn.com/Events/MIX/MIX11/HTM08



Http response status code
=======================
HttpStatusCode 
    // Summary:
    //     Contains the values of status codes defined for HTTP.
    public enum HttpStatusCode
    {
        //
        // Summary:
        //     Equivalent to HTTP status 100. System.Net.HttpStatusCode.Continue indicates that
        //     the client can continue with its request.
        Continue = 100,
        //
        // Summary:
        //     Equivalent to HTTP status 101. System.Net.HttpStatusCode.SwitchingProtocols indicates
        //     that the protocol version or protocol is being changed.
        SwitchingProtocols = 101,
        //
        // Summary:
        //     Equivalent to HTTP status 200. System.Net.HttpStatusCode.OK indicates that the
        //     request succeeded and that the requested information is in the response. This
        //     is the most common status code to receive.
        OK = 200,
        //
        // Summary:
        //     Equivalent to HTTP status 201. System.Net.HttpStatusCode.Created indicates that
        //     the request resulted in a new resource created before the response was sent.
        Created = 201,
        //
        // Summary:
        //     Equivalent to HTTP status 202. System.Net.HttpStatusCode.Accepted indicates that
        //     the request has been accepted for further processing.
        Accepted = 202,
        //
        // Summary:
        //     Equivalent to HTTP status 203. System.Net.HttpStatusCode.NonAuthoritativeInformation
        //     indicates that the returned metainformation is from a cached copy instead of
        //     the origin server and therefore may be incorrect.
        NonAuthoritativeInformation = 203,
        //
        // Summary:
        //     Equivalent to HTTP status 204. System.Net.HttpStatusCode.NoContent indicates
        //     that the request has been successfully processed and that the response is intentionally
        //     blank.
        NoContent = 204,
        //
        // Summary:
        //     Equivalent to HTTP status 205. System.Net.HttpStatusCode.ResetContent indicates
        //     that the client should reset (not reload) the current resource.
        ResetContent = 205,
        //
        // Summary:
        //     Equivalent to HTTP status 206. System.Net.HttpStatusCode.PartialContent indicates
        //     that the response is a partial response as requested by a GET request that includes
        //     a byte range.
        PartialContent = 206,
        //
        // Summary:
        //     Equivalent to HTTP status 300. System.Net.HttpStatusCode.MultipleChoices indicates
        //     that the requested information has multiple representations. The default action
        //     is to treat this status as a redirect and follow the contents of the Location
        //     header associated with this response.
        MultipleChoices = 300,
        //
        // Summary:
        //     Equivalent to HTTP status 300. System.Net.HttpStatusCode.Ambiguous indicates
        //     that the requested information has multiple representations. The default action
        //     is to treat this status as a redirect and follow the contents of the Location
        //     header associated with this response.
        Ambiguous = 300,
        //
        // Summary:
        //     Equivalent to HTTP status 301. System.Net.HttpStatusCode.MovedPermanently indicates
        //     that the requested information has been moved to the URI specified in the Location
        //     header. The default action when this status is received is to follow the Location
        //     header associated with the response.
        MovedPermanently = 301,
        //
        // Summary:
        //     Equivalent to HTTP status 301. System.Net.HttpStatusCode.Moved indicates that
        //     the requested information has been moved to the URI specified in the Location
        //     header. The default action when this status is received is to follow the Location
        //     header associated with the response. When the original request method was POST,
        //     the redirected request will use the GET method.
        Moved = 301,
        //
        // Summary:
        //     Equivalent to HTTP status 302. System.Net.HttpStatusCode.Found indicates that
        //     the requested information is located at the URI specified in the Location header.
        //     The default action when this status is received is to follow the Location header
        //     associated with the response. When the original request method was POST, the
        //     redirected request will use the GET method.
        Found = 302,
        //
        // Summary:
        //     Equivalent to HTTP status 302. System.Net.HttpStatusCode.Redirect indicates that
        //     the requested information is located at the URI specified in the Location header.
        //     The default action when this status is received is to follow the Location header
        //     associated with the response. When the original request method was POST, the
        //     redirected request will use the GET method.
        Redirect = 302,
        //
        // Summary:
        //     Equivalent to HTTP status 303. System.Net.HttpStatusCode.SeeOther automatically
        //     redirects the client to the URI specified in the Location header as the result
        //     of a POST. The request to the resource specified by the Location header will
        //     be made with a GET.
        SeeOther = 303,
        //
        // Summary:
        //     Equivalent to HTTP status 303. System.Net.HttpStatusCode.RedirectMethod automatically
        //     redirects the client to the URI specified in the Location header as the result
        //     of a POST. The request to the resource specified by the Location header will
        //     be made with a GET.
        RedirectMethod = 303,
        //
        // Summary:
        //     Equivalent to HTTP status 304. System.Net.HttpStatusCode.NotModified indicates
        //     that the client's cached copy is up to date. The contents of the resource are
        //     not transferred.
        NotModified = 304,
        //
        // Summary:
        //     Equivalent to HTTP status 305. System.Net.HttpStatusCode.UseProxy indicates that
        //     the request should use the proxy server at the URI specified in the Location
        //     header.
        UseProxy = 305,
        //
        // Summary:
        //     Equivalent to HTTP status 306. System.Net.HttpStatusCode.Unused is a proposed
        //     extension to the HTTP/1.1 specification that is not fully specified.
        Unused = 306,
        //
        // Summary:
        //     Equivalent to HTTP status 307. System.Net.HttpStatusCode.TemporaryRedirect indicates
        //     that the request information is located at the URI specified in the Location
        //     header. The default action when this status is received is to follow the Location
        //     header associated with the response. When the original request method was POST,
        //     the redirected request will also use the POST method.
        TemporaryRedirect = 307,
        //
        // Summary:
        //     Equivalent to HTTP status 307. System.Net.HttpStatusCode.RedirectKeepVerb indicates
        //     that the request information is located at the URI specified in the Location
        //     header. The default action when this status is received is to follow the Location
        //     header associated with the response. When the original request method was POST,
        //     the redirected request will also use the POST method.
        RedirectKeepVerb = 307,
        //
        // Summary:
        //     Equivalent to HTTP status 400. System.Net.HttpStatusCode.BadRequest indicates
        //     that the request could not be understood by the server. System.Net.HttpStatusCode.BadRequest
        //     is sent when no other error is applicable, or if the exact error is unknown or
        //     does not have its own error code.
        BadRequest = 400,
        //
        // Summary:
        //     Equivalent to HTTP status 401. System.Net.HttpStatusCode.Unauthorized indicates
        //     that the requested resource requires authentication. The WWW-Authenticate header
        //     contains the details of how to perform the authentication.
        Unauthorized = 401,
        //
        // Summary:
        //     Equivalent to HTTP status 402. System.Net.HttpStatusCode.PaymentRequired is reserved
        //     for future use.
        PaymentRequired = 402,
        //
        // Summary:
        //     Equivalent to HTTP status 403. System.Net.HttpStatusCode.Forbidden indicates
        //     that the server refuses to fulfill the request.
        Forbidden = 403,
        //
        // Summary:
        //     Equivalent to HTTP status 404. System.Net.HttpStatusCode.NotFound indicates that
        //     the requested resource does not exist on the server.
        NotFound = 404,
        //
        // Summary:
        //     Equivalent to HTTP status 405. System.Net.HttpStatusCode.MethodNotAllowed indicates
        //     that the request method (POST or GET) is not allowed on the requested resource.
        MethodNotAllowed = 405,
        //
        // Summary:
        //     Equivalent to HTTP status 406. System.Net.HttpStatusCode.NotAcceptable indicates
        //     that the client has indicated with Accept headers that it will not accept any
        //     of the available representations of the resource.
        NotAcceptable = 406,
        //
        // Summary:
        //     Equivalent to HTTP status 407. System.Net.HttpStatusCode.ProxyAuthenticationRequired
        //     indicates that the requested proxy requires authentication. The Proxy-authenticate
        //     header contains the details of how to perform the authentication.
        ProxyAuthenticationRequired = 407,
        //
        // Summary:
        //     Equivalent to HTTP status 408. System.Net.HttpStatusCode.RequestTimeout indicates
        //     that the client did not send a request within the time the server was expecting
        //     the request.
        RequestTimeout = 408,
        //
        // Summary:
        //     Equivalent to HTTP status 409. System.Net.HttpStatusCode.Conflict indicates that
        //     the request could not be carried out because of a conflict on the server.
        Conflict = 409,
        //
        // Summary:
        //     Equivalent to HTTP status 410. System.Net.HttpStatusCode.Gone indicates that
        //     the requested resource is no longer available.
        Gone = 410,
        //
        // Summary:
        //     Equivalent to HTTP status 411. System.Net.HttpStatusCode.LengthRequired indicates
        //     that the required Content-length header is missing.
        LengthRequired = 411,
        //
        // Summary:
        //     Equivalent to HTTP status 412. System.Net.HttpStatusCode.PreconditionFailed indicates
        //     that a condition set for this request failed, and the request cannot be carried
        //     out. Conditions are set with conditional request headers like If-Match, If-None-Match,
        //     or If-Unmodified-Since.
        PreconditionFailed = 412,
        //
        // Summary:
        //     Equivalent to HTTP status 413. System.Net.HttpStatusCode.RequestEntityTooLarge
        //     indicates that the request is too large for the server to process.
        RequestEntityTooLarge = 413,
        //
        // Summary:
        //     Equivalent to HTTP status 414. System.Net.HttpStatusCode.RequestUriTooLong indicates
        //     that the URI is too long.
        RequestUriTooLong = 414,
        //
        // Summary:
        //     Equivalent to HTTP status 415. System.Net.HttpStatusCode.UnsupportedMediaType
        //     indicates that the request is an unsupported type.
        UnsupportedMediaType = 415,
        //
        // Summary:
        //     Equivalent to HTTP status 416. System.Net.HttpStatusCode.RequestedRangeNotSatisfiable
        //     indicates that the range of data requested from the resource cannot be returned,
        //     either because the beginning of the range is before the beginning of the resource,
        //     or the end of the range is after the end of the resource.
        RequestedRangeNotSatisfiable = 416,
        //
        // Summary:
        //     Equivalent to HTTP status 417. System.Net.HttpStatusCode.ExpectationFailed indicates
        //     that an expectation given in an Expect header could not be met by the server.
        ExpectationFailed = 417,
        //
        // Summary:
        //     Equivalent to HTTP status 426. System.Net.HttpStatusCode.UpgradeRequired indicates
        //     that the client should switch to a different protocol such as TLS/1.0.
        UpgradeRequired = 426,
        //
        // Summary:
        //     Equivalent to HTTP status 500. System.Net.HttpStatusCode.InternalServerError
        //     indicates that a generic error has occurred on the server.
        InternalServerError = 500,
        //
        // Summary:
        //     Equivalent to HTTP status 501. System.Net.HttpStatusCode.NotImplemented indicates
        //     that the server does not support the requested function.
        NotImplemented = 501,
        //
        // Summary:
        //     Equivalent to HTTP status 502. System.Net.HttpStatusCode.BadGateway indicates
        //     that an intermediate proxy server received a bad response from another proxy
        //     or the origin server.
        BadGateway = 502,
        //
        // Summary:
        //     Equivalent to HTTP status 503. System.Net.HttpStatusCode.ServiceUnavailable indicates
        //     that the server is temporarily unavailable, usually due to high load or maintenance.
        ServiceUnavailable = 503,
        //
        // Summary:
        //     Equivalent to HTTP status 504. System.Net.HttpStatusCode.GatewayTimeout indicates
        //     that an intermediate proxy server timed out while waiting for a response from
        //     another proxy or the origin server.
        GatewayTimeout = 504,
        //
        // Summary:
        //     Equivalent to HTTP status 505. System.Net.HttpStatusCode.HttpVersionNotSupported
        //     indicates that the requested HTTP version is not supported by the server.
        HttpVersionNotSupported = 505
    }



https://www.w3schools.com/tags/ref_httpmessages.asp

Log4Net C# tutorial links
---------------------------------
https://www.youtube.com/watch?v=2lAdQ_QwNww

http://logging.apache.org/log4net/release/config-examples.html
https://www.codeproject.com/Articles/140911/log-net-Tutorial

How to install windows service through cmd
-------------------------------------------------------------
https://www.aspsnippets.com/Articles/How-to-install-and-uninstall-Windows-Service-using-InstallUtilexe-from-Command-Prompt-Line-in-C-and-VBNet.aspx

InstallUtil /i C:\Users\Mudassar\Projects\WindowsService\bin\Debug\WindowsService.exe



How to download and install from internet src folder location
---------------------------------------------------------------
string currentversion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
string downloadPath = "http://145.168.1.154/OP/";

string localPath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;//current loaded file pa
localPath = localPath.Substring(0, localPath.LastIndexOf("\\") + 1);//taking till folder path
string filePath = localPath+ fileName;//qualified file path

//Downloading File.
string fileUrl = downloadPath + fileName;

HttpWebRequest httpFilerequest = (HttpWebRequest)WebRequest.Create(fileUrl);
httpFilerequest.Timeout = 10000;
HttpWebResponse httpFileresponse = (HttpWebResponse)httpFilerequest.GetResponse();
using (Stream fileReceiveStream = httpFileresponse.GetResponseStream())
{
    using (Stream file = File.OpenWrite(filePath))//filePath is location where to write the file
    {
        byte[] buffer = new byte[8 * 1024];
        int len;
        while ((len = fileReceiveStream.Read(buffer, 0, buffer.Length)) > 0)
        {
            file.Write(buffer, 0, len);
        }
        file.Close();
    }
    fileReceiveStream.Close();
}

//Starting file installation.
Process proc = Process.Start("wceload.exe", "\"" + Path.Combine(localPath, fileName) + "\"");

proc.WaitForExit();

How to get the local ip adrress of the machine in c#.
-----------------------------------------------------------------
string localIP = string.Empty;
using (Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, 0))
     {
          socket.Connect("8.8.8.8", 65530);
          IPEndPoint endPoint = socket.LocalEndPoint as IPEndPoint;
          localIP = endPoint.Address.ToString();
     }

C# Remoting application .NET Remoting with an easy example
------------------------------------------------------------------------------------
http://csharp.net-informations.com/remoting/remoting-application.htm
https://www.codeproject.com/Articles/14791/NET-Remoting-with-an-easy-example
http://www.c-sharpcorner.com/uploadfile/GemingLeader/serialization-vs-marshaling/

How to convert one object into another object
-----------------------------------------------------------
CheckboxList[] pLines = userProductionLineCollection.Select(item => new CheckboxList() { Key = item.ProductionID, Value = item.ProductionLineName }).ToArray();

returnObject = unSubscribeTagList.Where(x => x.TagUUID > 0).Select(x => new OPCTagStatus() { TagUUID = x.TagUUID, Status = true }).ToList();

How to pass an object into a timer event
-------------------------------------------------------------------
https://stackoverflow.com/questions/9977393/how-do-i-pass-an-object-into-a-timer-event

How to read from webconfig in c#
---------------------------------------------------------------
reading session timeout value  from web config
Configuration conf = WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath);
                SessionStateSection section = (SessionStateSection)conf.GetSection("system.web/sessionState");
                int sessionTimeoutInMinute = (int)section.Timeout.TotalMinutes;

Http Context in c#
--------------------------------------------
https://www.youtube.com/watch?v=qCO99QbKKIQ
https://www.youtube.com/watch?v=O8ln_DR41Zk
https://www.youtube.com/watch?v=-BJ8RrCOcvw&list=PLdg_n0qTEJTWCc6-rdVf3CMs7waXB2wkG
https://www.youtube.com/watch?v=eR8kdVzRvhY
https://www.youtube.com/watch?v=zUZ0aqeETsY
https://www.youtube.com/watch?v=lCn_IXctSLI
https://www.youtube.com/watch?v=qU72WThLu80
https://www.youtube.com/watch?v=aTLklOahMEs
https://www.youtube.com/watch?v=lpBzHCUgtFc
http://www.c-sharpcorner.com/UploadFile/dacca2/httpcontext-class-in-Asp-Net/
http://www.dotnetfunda.com/articles/show/2585/understand-httpcontext-class-in-aspnet-csharp


Google drive handling through c#
----------------------------------------------------------------------
https://www.youtube.com/watch?v=7gNeCjRuNAM

When to use another project wcf side method call when transaction involved:
first of all one project wcf method can be called from another project wcf method just by adding service references
Another note here only is in between transaction don't call any another project service side method which involves transaction there. So we can after the main method work done and just before commit we can call another project wcf service method. So that if main method throws any exception then it wont execute other wcf service method The issue is another project wcf service method can't be reverted.

When you want to parent form method on closing of child form:
way-1:
keep a static method in parent method so while calling child method call that static method.
way-2:
while calling child method set a bool parameter as true once closing child form and showing parent form automatically parent form activate method will be called there only put you method by using bool value once work over set this bool value to false.

Handling Word document in c# using spire.doc:
We can control almost everything under ms-office by this tool
https://www.e-iceblue.com/Tutorials/Spire.Doc/Getting-started/Spire.Doc-Quick-Start.html
https://www.c-sharpcorner.com/UploadFile/65794e/using-spire-doc-introduction/
https://www.c-sharpcorner.com/UploadFile/1e050f/convert-word-document-to-pdf-using-spire-doc/
https://archive.codeplex.com/?p=freeword
https://www.e-iceblue.com/Introduce/free-doc-component.html#.WsxljS5ubIU
https://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html#.WsxlrC5ubIU

How to use Bar Progress bar in windows form:
/*Progress bar initialisation*/
progressBarMigrationPackageType.Minimum = 1;
progressBarMigrationPackageType.Value = 1;
progressBarMigrationPackageType.Step = 1;
progressBarMigrationPackageType.PerformStep();
progressBarMigrationPackageType.Maximum = dtDispatchPackageTypes.Rows.Count + 5;
progressBarMigrationPackageType.PerformStep();

progressBarMigrationPackageType.Value = 1;
transaction.Rollback();

How to create own snippet and import it to visual studio for using it with all other project:
https://www.c-sharpcorner.com/UploadFile/8af3e0/how-to-create-code-snippet-using-C-Sharp/
https://www.c-sharpcorner.com/article/create-custom-code-snippet-in-visual-studio-2015/

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <Header>
    <Title>SqlInsert</Title>
    <Author>OM</Author>
    <Shortcut>SqlIns</Shortcut>
    <Description>SqlInsertion</Description>
    <SnippetTypes>
      <SnippetType>SurroundsWith</SnippetType>
      <SnippetType>Expansion</SnippetType>
    </SnippetTypes>
  </Header>
  <Snippet>
    <Declarations>
      <Literal>
        <ID>message</ID>
        <Default>my function</Default>
      </Literal>
    </Declarations>
    <Code Language="CSharp">
      <![CDATA[StringBuilder sqlCmdBuilder = new StringBuilder();
            sqlCmdBuilder.Append("  ");
            sqlCmdBuilder.Append("  ");
            sqlCmdBuilder.Append("  ");

            DbCommand dbCmd = db.GetSqlStringCommand(sqlCmdBuilder.ToString());
            dbCmd.CommandType = CommandType.Text;

            db.AddInParameter(dbCmd, ":", DbType.Int32, );
            db.AddInParameter(dbCmd, ":", DbType.AnsiString, );
            db.AddInParameter(dbCmd, ":", DbType.AnsiString, );
            db.AddInParameter(dbCmd, ":", DbType.AnsiString, );]]>
    </Code>
  </Snippet>
</CodeSnippet>

How to validate a decimal number with db column range:
public static bool ValidateDecimalDBColumnRange(decimal inputValue, int precision, int scale) { inputValue = Math.Round(inputValue, scale); int digit = (Int32)inputValue; if ((digit.ToString().Length > (precision - scale))) { return false; } return true; }

How to use global resources:
1. data-content='<%$ Resources:BinUtilizationDashboard_Resource, downLoadBinUtilization %>'
2. <%=GetGlobalResourceObject("BinUtilizationDashboard_Resource", "reset")%>
3. Language_Resources.AdjustmentPhase_Resource.save
4. How to read from global resource file by passing key and read value
status = (string)HttpContext.GetGlobalResourceObject("ExternalWarehouseKit_Resource", "created");

How to load enum items to dropdown:
drpDeviceTypes.AppendDataBoundItems = true;
drpDeviceTypes.DataSource = Enum.GetNames(typeof(iPAS.ipas_PlantService.DeviceType)).
Select(o => new { Text = o, Value = (int)(Enum.Parse(typeof(iPAS.ipas_PlantService.DeviceType), o)) });
drpDeviceTypes.DataTextField = "Text";
drpDeviceTypes.DataValueField = "Value";
drpDeviceTypes.DataBind();

Allow only integer code in C# win form:
-----------------------------------------------------------------------
1. if (Char.IsControl(e.KeyChar)) { } else if (Char.IsNumber(e.KeyChar)) { TextBox tb = sender as TextBox; int iCursorPosLeft = tb.SelectionStart; int iCursorPosRight = tb.SelectionStart + tb.SelectionLength; string sResult = tb.Text.Substring(0, iCursorPosLeft) + e.KeyChar + tb.Text.Substring(iCursorPosRight); if (sResult.Length <= 6) e.Handled = false; else e.Handled = true; } else if (!char.IsNumber(e.KeyChar)) e.Handled = true;


2. Regex regex = new Regex("[0-9]|\b");
            e.Handled = !(regex.IsMatch(e.KeyChar.ToString()));

How to convert a comma separated string into single quote comma separated string in c#:
1. String.Join(",", Array.ConvertAll(Jaddoo.Split(','), z => "'" + z + "'"))
2. "'" + string.Join("','", listVariable) + "'"


RestService_Webconfig_Changes :
<system.serviceModel> <services> <service name="Project.RestServiceExperiment" behaviorConfiguration="RestServiceExperiment_ServiceBehavior"> <endpoint address="" behaviorConfiguration="RestServiceExperiment_EndpointBehaviour" binding="webHttpBinding" bindingConfiguration="RestServiceExperiment_WebHttpBinding" contract="Project.IRestServiceExperiment"/> </service> </services> <bindings> <webHttpBinding> <binding name="RestServiceExperiment_WebHttpBinding" crossDomainScriptAccessEnabled="true"></binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="RestServiceExperiment_EndpointBehaviour"> <webHttp helpEnabled="true" /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="RestServiceExperiment_ServiceBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>

The contract difference between normal WCF and Rest Service:
Normal:
[WebInvoke(UriTemplate = "ReturningName?name={name}", Method = "GET", RequestFormat = WebMessageFormat.Xml)]
Rest_Service:
[WebInvoke(UriTemplate = "ReturningName", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]

Note:While calling from postman dont forget to keep header key as content type and value as application/json.

How to use dependency list filter in c# using epplus:
ExcelRange rangeProduceList = worksheet1.Cells["$B$2:$B$3"];           // ws is the worksheet name                    
                    worksheet1.Names.Add("ProduceList", rangeProduceList);
                    worksheet1.Cells[1, 2].Value = "Produce List";
                    worksheet1.Cells[2, 2].Value = "Fruit";
                    worksheet1.Cells[3, 2].Value = "Vegetable";

                    ExcelRange tblRangeProduceList = worksheet1.Cells["$B$1:$B$3"];           // ws is the worksheet name   
                    ExcelTable tblProduceList = worksheet1.Tables.Add(tblRangeProduceList, "tblProduceList");
                    tblProduceList.ShowHeader = true;

                    ExcelRange rangeFruitList = worksheet1.Cells["$C$2:$C$3"];           // ws is the worksheet name                    
                    worksheet1.Names.Add("Fruit", rangeFruitList);
                    worksheet1.Cells[1, 3].Value = "Fruit list";
                    worksheet1.Cells[2, 3].Value = "Apple";
                    worksheet1.Cells[3, 3].Value = "Banana";

                    ExcelRange tblRangeFruitList = worksheet1.Cells["$C$1:$C$3"];           // ws is the worksheet name  
                    ExcelTable tblFruitList = worksheet1.Tables.Add(tblRangeFruitList, "tblFruitList");
                    tblFruitList.ShowHeader = true;

                    ExcelRange rangeVegetableList = worksheet1.Cells["$D$2:$D$3"];           // ws is the worksheet name                    
                    worksheet1.Names.Add("Vegetable", rangeVegetableList);
                    worksheet1.Cells[1, 4].Value = "Vegetable List";
                    worksheet1.Cells[2, 4].Value = "Bhatua Saag";
                    worksheet1.Cells[3, 4].Value = "Mulli";

                    ExcelRange tblRangeVegetableList = worksheet1.Cells["$D$1:$D$3"];           // ws is the worksheet name 
                    ExcelTable tblVegetableList = worksheet1.Tables.Add(tblRangeVegetableList, "tblVegetable");
                    tblVegetableList.ShowHeader = true;

                    worksheet1.Cells[1, 6].Value = "Product Type Select";
                    ExcelRange tblRangeProductSelect = worksheet1.Cells["$F$1:$F$3"];           // ws is the worksheet name 
                    ExcelTable tblProductSelect = worksheet1.Tables.Add(tblRangeProductSelect, "tblProductSelect");
                    tblProductSelect.ShowHeader = true;

                    worksheet1.Cells[1, 7].Value = "Product Select";
                    ExcelRange tblRangeProductFilter = worksheet1.Cells["$G$1:$G$3"];           // ws is the worksheet name 
                    ExcelTable tblProductFilter = worksheet1.Tables.Add(tblRangeProductFilter, "tblProductFilter");
                    tblProductFilter.ShowHeader = true;

                    var val1 = worksheet1.DataValidations.AddListValidation(ExcelRange.GetAddress(1, 6, ExcelPackage.MaxRows, 6));
                    val1.Formula.ExcelFormula = "=ProduceList";

                    var val2 = worksheet1.DataValidations.AddListValidation(ExcelRange.GetAddress(1, 7, ExcelPackage.MaxRows, 7));

                    val2.Formula.ExcelFormula = "=INDIRECT($F$1:$F$" + ExcelPackage.MaxRows.ToString() + ")";

worksheetTemp.Column(2).Hidden = true;
worksheetTemp.Column(3).Hidden = true;
worksheetTemp.Column(4).Hidden = true;

How to use address as dynamic range of cells for Indirect function excel:
val2.Formula.ExcelFormula = "=INDIRECT("+ ExcelRange.GetAddress(rowIndex, materialCategoryColumnIndex, ExcelPackage.MaxRows, materialCategoryColumnIndex) + ")";

Excel functionality link with or without epplus:
http://www.contextures.com/xlDataVal02.html#sheets
https://www.codeproject.com/Articles/680421/Create-Read-Edit-Advance-Excel-Report-in

How to get excel file from FTP server:
http://www.dotnetfunda.com/forums/show/9710/download-an-excelxslfile-from-server-through-ftp


Password Policy check in c#:
if (!Regex.IsMatch(password, @"[a-zA-Z]")) // password contains at least one character. if (!Regex.IsMatch(password, @"(?=.*[$@$!%*#?&])")) // password contains at least one special character if (!Regex.IsMatch(password, @"[(?=.*\d)]")) // password contains at least one digit

Using Cast with Array:
EnumObject[] movementTypes = Enum.GetValues(typeof(EnumObject)).Cast<EnumObject>().Where(T => (T != EnumObject.EnumMember)).ToArray();


GetTime Formated:
public static string GetTimeFormat(int value, string timeFormat)
        {
            DateTime date;
            if (DateTime.TryParseExact(value.ToString().PadLeft(6, '0'), "HHmmss", CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
            {
                if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.Contains("de-DE"))
                    return date.ToString(timeFormat, CultureInfo.InvariantCulture);
                else
                    return date.ToString(timeFormat);
            }
            return value.ToString();

        }

CROSS-THREAD OPERATION NOT VALID: CONTROL ACCESSED FROM A THREAD OTHER THAN THE THREAD IT WAS CREATED ON :
Here timer method was not able to update label text value from windows form:
private void processOrderArchieveTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            label2.Invoke(new Action(UpdateLabel));
        }

        private void UpdateLabel()
        {
            label2.Text = (++currentRequestNumber).ToString();
        }

Sending Email Through SMTP C#:
private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string fromAddress = "frommailID";
                string fromDisplayName = "DisplayText";
                string smtpServer = "smtpServer";
                string mailPassword = "fromMailIDPWD";

                SmtpClient smtpClient = new SmtpClient(smtpServer);
                smtpClient.UseDefaultCredentials = false;
                smtpClient.Port = 2525;
                System.Net.NetworkCredential nc = new System.Net.NetworkCredential(fromAddress, mailPassword);
                smtpClient.Credentials = nc;

                try
                {
                    MailMessage objMailMsg = new MailMessage();
                    objMailMsg.Subject = "Test";
                    objMailMsg.Body = "Test";
                    objMailMsg.IsBodyHtml = false;

                    objMailMsg.To.Add("ReceiverMailID");

                    MailAddress objMailAddress = new MailAddress(fromAddress, fromDisplayName);
                    objMailMsg.From = objMailAddress;
                 
                    smtpClient.Send(objMailMsg);
                    objMailMsg.Dispose();
                }
                catch (Exception ex)
                {
                }
            }
            catch (Exception ex)
            {
            }
        }

Linq Code:
IEnumerable<int> list = dataRows.Select(x => { int res = 0; int.TryParse(x["ColumnID"].ToString(), out res); return res; }).Distinct().Where(x => x != 0);


 #region Attach Excel as an embedded object into PPT

                                    P.GraphicFrame graphicFrameForEmbeddedExcel = slidePart.Slide.CommonSlideData.ShapeTree.AppendChild(new P.GraphicFrame());

                                    string idForVML = GetUniqueXmlItemID();
                                    VmlDrawingPart vmlDrawingPartForEmbeddedExcel = slidePart.AddNewPart<VmlDrawingPart>(idForVML);
                                    GenerateVmlDrawingPart1Content(vmlDrawingPartForEmbeddedExcel);

                                    ImagePart imagePartForEmbeddedExcel = vmlDrawingPartForEmbeddedExcel.AddNewPart<ImagePart>("image/x-wmf", idForVML);
                                    GenerateEmbeddedPackagePart(imagePartForEmbeddedExcel, @"C:\Users\BarnwOm\Documents\My Received Files\image5.wmf");

                                    string idForEmbeddedExcel = GetUniqueXmlItemID();
                                    EmbeddedPackagePart embeddedPackagePartForEmbeddedExcel = slidePart.AddNewPart<EmbeddedPackagePart>("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", idForEmbeddedExcel);
                                    GenerateEmbeddedPackagePart(embeddedPackagePartForEmbeddedExcel, @"C:\Users\BarnwOm\Documents\My Received Files\XMLConvertionToPPT.xlsx");

                                    string idForExcelIcon = GetUniqueXmlItemID();
                                    slidePart.AddPart(imagePartForEmbeddedExcel, idForExcelIcon);

                                    P.NonVisualGraphicFrameProperties nonVisualGraphicFrameProperties2 = new P.NonVisualGraphicFrameProperties();

                                    P.NonVisualDrawingProperties nonVisualDrawingProperties229 = new P.NonVisualDrawingProperties() { Id = (UInt32Value)21U, Name = "Object 20" };

                                    D.NonVisualDrawingPropertiesExtensionList nonVisualDrawingPropertiesExtensionList2 = new D.NonVisualDrawingPropertiesExtensionList();

                                    D.NonVisualDrawingPropertiesExtension nonVisualDrawingPropertiesExtension2 = new D.NonVisualDrawingPropertiesExtension() { Uri = "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}" };

                                    OpenXmlUnknownElement openXmlUnknownElement2 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<a16:creationId xmlns:a16=\"http://schemas.microsoft.com/office/drawing/2014/main\" id=\"{8E4C840D-E290-4808-BB9E-AECEC56C63EC}\" />");

                                    nonVisualDrawingPropertiesExtension2.Append(openXmlUnknownElement2);

                                    nonVisualDrawingPropertiesExtensionList2.Append(nonVisualDrawingPropertiesExtension2);

                                    nonVisualDrawingProperties229.Append(nonVisualDrawingPropertiesExtensionList2);

                                    P.NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties2 = new P.NonVisualGraphicFrameDrawingProperties();
                                    D.GraphicFrameLocks graphicFrameLocks2 = new D.GraphicFrameLocks() { NoChangeAspect = true };

                                    nonVisualGraphicFrameDrawingProperties2.Append(graphicFrameLocks2);

                                    ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties229 = new ApplicationNonVisualDrawingProperties();

                                    ApplicationNonVisualDrawingPropertiesExtensionList applicationNonVisualDrawingPropertiesExtensionList2 = new ApplicationNonVisualDrawingPropertiesExtensionList();

                                    ApplicationNonVisualDrawingPropertiesExtension applicationNonVisualDrawingPropertiesExtension2 = new ApplicationNonVisualDrawingPropertiesExtension() { Uri = "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}" };

                                    P14.ModificationId modificationId2 = new P14.ModificationId() { Val = (UInt32Value)3087638950U };
                                    modificationId2.AddNamespaceDeclaration("p14", "http://schemas.microsoft.com/office/powerpoint/2010/main");

                                    applicationNonVisualDrawingPropertiesExtension2.Append(modificationId2);

                                    applicationNonVisualDrawingPropertiesExtensionList2.Append(applicationNonVisualDrawingPropertiesExtension2);

                                    applicationNonVisualDrawingProperties229.Append(applicationNonVisualDrawingPropertiesExtensionList2);

                                    nonVisualGraphicFrameProperties2.Append(nonVisualDrawingProperties229);
                                    nonVisualGraphicFrameProperties2.Append(nonVisualGraphicFrameDrawingProperties2);
                                    nonVisualGraphicFrameProperties2.Append(applicationNonVisualDrawingProperties229);

                                    Transform transform2 = new Transform();
                                    D.Offset offset226 = new D.Offset() { X = 10508260L, Y = 5416105L };
                                    D.Extents extents226 = new D.Extents() { Cx = 914400L, Cy = 771525L };

                                    transform2.Append(offset226);
                                    transform2.Append(extents226);

                                    D.Graphic graphic2 = new D.Graphic();

                                    D.GraphicData graphicData2 = new D.GraphicData() { Uri = "http://schemas.openxmlformats.org/presentationml/2006/ole" };

                                    AlternateContent alternateContent2 = new AlternateContent();
                                    alternateContent2.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");

                                    AlternateContentChoice alternateContentChoice2 = new AlternateContentChoice() { Requires = "v" };
                                    alternateContentChoice2.AddNamespaceDeclaration("v", "urn:schemas-microsoft-com:vml");

                                    OleObject oleObject3 = new OleObject() { ShapeId = "_x0000_s1026", Name = "Worksheet", ShowAsIcon = true, Id = idForEmbeddedExcel, ImageWidth = 914400, ImageHeight = 771480, ProgId = "Excel.Sheet.12" };
                                    OleObjectEmbed oleObjectEmbed3 = new OleObjectEmbed();

                                    oleObject3.Append(oleObjectEmbed3);

                                    alternateContentChoice2.Append(oleObject3);

                                    AlternateContentFallback alternateContentFallback2 = new AlternateContentFallback();

                                    OleObject oleObject4 = new OleObject() { Name = "Worksheet", ShowAsIcon = true, Id = idForEmbeddedExcel, ImageWidth = 914400, ImageHeight = 771480, ProgId = "Excel.Sheet.12" };
                                    OleObjectEmbed oleObjectEmbed4 = new OleObjectEmbed();

                                    P.Picture picture6 = new P.Picture();

                                    P.NonVisualPictureProperties nonVisualPictureProperties6 = new P.NonVisualPictureProperties();
                                    P.NonVisualDrawingProperties nonVisualDrawingProperties230 = new P.NonVisualDrawingProperties() { Id = (UInt32Value)0U, Name = "" };
                                    P.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties6 = new P.NonVisualPictureDrawingProperties();
                                    P.ApplicationNonVisualDrawingProperties applicationNonVisualDrawingProperties230 = new P.ApplicationNonVisualDrawingProperties();

                                    nonVisualPictureProperties6.Append(nonVisualDrawingProperties230);
                                    nonVisualPictureProperties6.Append(nonVisualPictureDrawingProperties6);
                                    nonVisualPictureProperties6.Append(applicationNonVisualDrawingProperties230);

                                    P.BlipFill blipFill6 = new P.BlipFill();
                                    D.Blip blip6 = new D.Blip() { Embed = idForExcelIcon };

                                    D.Stretch stretch6 = new D.Stretch();
                                    D.FillRectangle fillRectangle5 = new D.FillRectangle();

                                    stretch6.Append(fillRectangle5);

                                    blipFill6.Append(blip6);
                                    blipFill6.Append(stretch6);

                                    P.ShapeProperties shapeProperties201 = new P.ShapeProperties();

                                    D.Transform2D transform2D195 = new D.Transform2D();
                                    D.Offset offset227 = new D.Offset() { X = 10508260L, Y = 5416105L };
                                    D.Extents extents227 = new D.Extents() { Cx = 914400L, Cy = 771525L };

                                    transform2D195.Append(offset227);
                                    transform2D195.Append(extents227);

                                    D.PresetGeometry presetGeometry165 = new D.PresetGeometry() { Preset = D.ShapeTypeValues.Rectangle };
                                    D.AdjustValueList adjustValueList297 = new D.AdjustValueList();

                                    presetGeometry165.Append(adjustValueList297);

                                    shapeProperties201.Append(transform2D195);
                                    shapeProperties201.Append(presetGeometry165);

                                    picture6.Append(nonVisualPictureProperties6);
                                    picture6.Append(blipFill6);
                                    picture6.Append(shapeProperties201);

                                    oleObject4.Append(oleObjectEmbed4);
                                    oleObject4.Append(picture6);

                                    alternateContentFallback2.Append(oleObject4);

                                    alternateContent2.Append(alternateContentChoice2);
                                    alternateContent2.Append(alternateContentFallback2);

                                    graphicData2.Append(alternateContent2);

                                    graphic2.Append(graphicData2);

                                    graphicFrameForEmbeddedExcel.Append(nonVisualGraphicFrameProperties2);
                                    graphicFrameForEmbeddedExcel.Append(transform2);
                                    graphicFrameForEmbeddedExcel.Append(graphic2);

                                    #endregion



        // Generates content of vmlDrawingPart1.
        private void GenerateVmlDrawingPart1Content(VmlDrawingPart vmlDrawingPart1)
        {
            System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(vmlDrawingPart1.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
            writer.WriteRaw("<xml xmlns:v=\"urn:schemas-microsoft-com:vml\"\r\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\r\n xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\"\r\n xmlns:oa=\"urn:schemas-microsoft-com:office:activation\">\r\n <o:shapelayout v:ext=\"edit\">\r\n  <o:idmap v:ext=\"edit\" data=\"1\"/>\r\n </o:shapelayout><v:shapetype id=\"_x0000_t75\" coordsize=\"21600,21600\" o:spt=\"75\"\r\n  o:preferrelative=\"t\" path=\"m@4@5l@4@11@9@11@9@5xe\" filled=\"f\" stroked=\"f\">\r\n  <v:stroke joinstyle=\"miter\"/>\r\n  <v:formulas>\r\n   <v:f eqn=\"if lineDrawn pixelLineWidth 0\"/>\r\n   <v:f eqn=\"sum @0 1 0\"/>\r\n   <v:f eqn=\"sum 0 0 @1\"/>\r\n   <v:f eqn=\"prod @2 1 2\"/>\r\n   <v:f eqn=\"prod @3 21600 pixelWidth\"/>\r\n   <v:f eqn=\"prod @3 21600 pixelHeight\"/>\r\n   <v:f eqn=\"sum @0 0 1\"/>\r\n   <v:f eqn=\"prod @6 1 2\"/>\r\n   <v:f eqn=\"prod @7 21600 pixelWidth\"/>\r\n   <v:f eqn=\"sum @8 21600 0\"/>\r\n   <v:f eqn=\"prod @7 21600 pixelHeight\"/>\r\n   <v:f eqn=\"sum @10 21600 0\"/>\r\n  </v:formulas><v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>\r\n  <o:lock v:ext=\"edit\" aspectratio=\"t\"/>\r\n </v:shapetype><v:shape id=\"_x0000_s1026\" type=\"#_x0000_t75\" style=\'position:absolute;left:827pt;top:426pt;width:72pt;height:60pt\'>\r\n  <v:fill on=\"f\"/>\r\n  <v:stroke on=\"f\"/>\r\n  <v:imagedata o:relid=\"rId1\" o:title=\"\" grayscale=\"f\" bilevel=\"f\"/>\r\n  <o:lock v:ext=\"edit\" aspectratio=\"t\" position=\"f\" selection=\"f\" grouping=\"f\"/>\r\n </v:shape></xml>");
            writer.Flush();
            writer.Close();
        }

        public static void GenerateEmbeddedPackagePart(OpenXmlPart part, string embeddedDocumentPath)
        {
            byte[] embeddedDocumentBytes;

            // The following code will generate an exception if an invalid filename is passed.
            using (FileStream fsEmbeddedDocument = File.OpenRead(embeddedDocumentPath))
            {
                embeddedDocumentBytes = new byte[fsEmbeddedDocument.Length];
                fsEmbeddedDocument.Read(embeddedDocumentBytes, 0, embeddedDocumentBytes.Length);
            }

            using (BinaryWriter writer = new BinaryWriter(part.GetStream()))
            {
                writer.Write(embeddedDocumentBytes);
                writer.Flush();
            }
        }

        /// <summary>
        /// Gets a Unique ID for an XML Item, for reference purposes
        /// </summary>
        /// <returns>A GUID string with removed dashes</returns>
        public static string GetUniqueXmlItemID()
        {
            return "r" + System.Guid.NewGuid().ToString().Replace("-", "");
        }



Open Office XML Good links:
Make a copy of the document on how you wanted to get through code and then use Open XML SDK Tool 2.5 for Microsoft Office for writing code. This tool reflects code. which you can simply copy-paste.
https://stackoverflow.com/questions/44074387/how-to-insert-video-in-pptx-using-open-xml-sdk
https://ankushbhatia.wordpress.com/2011/03/04/how-to-insert-a-hyperlink-in-excel-using-open-xml-sdk-2-0/
https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/ee355229(v=office.12)?redirectedfrom=MSDN

"C:\Program Files (x86)\Open XML SDK\V2.5\tool\OpenXmlSdkTool.exe"

// Generates content of imagePart5.
private void GenerateImagePart5Content(ImagePart imagePart5)
  {
            System.IO.Stream data = File.OpenRead(@"C:\Users\BarnwOm\Documents\My Received Files\image5.wmf");
            imagePart5.FeedData(data);
            data.Close();
 }

// Generates content of embeddedPackagePart1.
  private void GenerateEmbeddedPackagePart1Content(EmbeddedPackagePart embeddedPackagePart1)
   {
            System.IO.Stream data = File.OpenRead(@"C:\Users\BarnwOm\Documents\My Received Files\XMLConvertionToPPT.xlsx");
            embeddedPackagePart1.FeedData(data);
            data.Close();
   }

#How to covert any excel to datatable.
string connectionString = string.Empty;
            if (fileExtension == ".xls")
            {
                connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
            }
            else if (fileExtension == ".xlsx")
            {
                connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\"";
            }

            OleDbConnection MyConnection = new OleDbConnection(connectionString);
            OleDbDataAdapter MyCommand = new OleDbDataAdapter("select * from [Sheet2$]", MyConnection);
            DataSet ds = new DataSet();
            MyCommand.Fill(ds);
            MyConnection.Close();
            DataTable configsTbl = ds.Tables[0];

#Coloring of a cell using open office xml c#
https://stackoverflow.com/questions/15791732/openxml-sdk-having-borders-for-cell?noredirect=1&lq=1

#WorkbookStylesPart
https://stackoverflow.com/questions/11116176/cell-styles-in-openxml-spreadsheet-spreadsheetml/11118442#11118442

#How to export the excel log using excel int browser:
string attachment = "log_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
                    //string attachment = "attachment; filename=log_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";

                    ClosedXML.Excel.XLWorkbook wbook = new ClosedXML.Excel.XLWorkbook();
                    wbook.Worksheets.Add(dataTable, "dataTableName");
                    // Prepare the response
                    HttpResponse httpResponse = Response;
                    httpResponse.Clear();
                    httpResponse.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                    //Provide you file name here
                    httpResponse.AddHeader("content-disposition", "attachment;filename=\"" + attachment + "\"");

                    // Flush the workbook to the Response.OutputStream
                    using (MemoryStream memoryStream = new MemoryStream())
                    {
                        wbook.SaveAs(memoryStream);
                        memoryStream.WriteTo(httpResponse.OutputStream);
                        memoryStream.Close();
                    }

                    httpResponse.End();



Alternate for handlist Html into list of nested content object:
1. Spire.doc in dotnet
vs
2. what type of tags content can come in nested format?
Current code is supporting linear tags processing. Not nested support.

EO.pdf extraction convertHtml ->extracted output to excel to ppt.

list of parent child tags.
list of parent child tag data and its type.

loop through parent to next child.

and how we will utilize the this list to feed this parent child tag data into excel or ppt.

Some Text
Start of some tag
Then some data
end of the tag
start of some tag
Then Some data
start of some other tag
Then Some Data
close of current tag
close of outer tag

List of
.Normal Text or Normal Text Tag(Like pieces of paragraphs)
.Tag Type Contents(nested or one level tags).

individual enity would be same
like Tag Type and its Tag Data.

List Of objects = plain Text + Complex List Tag Data

One Node Object Architecture:
Tag Type
TagData
level
Order
Children

Split the same level tags into multiple orders of same level.

Directory Level coding in c#
https://www.c-sharpcorner.com/article/directories-in-c-sharp/

2 comments:

  1. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. unique name generator

    ReplyDelete
  2. https://github.com/scalad/MathML2Word/blob/f988737bcb495c869d98ecea40f667ba8498967e/OpenXMLSDKToolV25.msi

    ReplyDelete

Things to carry while travelling

 Kapda 1)3 jeans. 2)5 chaddi. 3)4 short pant. 4)1 taulia. 5)1 Topi. 6)1 paijama. 7)3 T-shirt. 8)3 Shirt. 9)Ganji 5. 10)1 inner ware mota. Fr...