Thursday, June 18, 2026

Check Before Executing Update Query with Inner Join

 

 In this query we are updating MRP of OpeningStock table from taking MRP from TEMP_PLU_MRP table. 

1. Before executing the query don't forget to check TEMP_PLU_MRP must have distinct PLU_Codes.

2. It is already considered that PLUMaster is having unique PLUs.  

3. Always run select query with same conditions like.. 

 

4. Avoid unnecessary writes by using this condition..

 

Tuesday, September 16, 2025

Show or hide an element

 

How to show or hide an element:

In order to show or hide an element, manipulate the element's style property. In most cases, you probably just want to change the element's display property:

 
element.style.display = 'none';               // Hide
element.style.display = 'block';              // Show
element.style.display = 'inline';             // Show
element.style.display = 'inline-block';   // Show

 

 

Alternatively, if you would still like the element to occupy space (like if you were to hide a table cell), you could change the element's visibility property instead:

 
element.style.visibility = 'hidden';      // Hide
element.style.visibility = 'visible';     // Show

Thursday, February 13, 2025

Save C# DataTable SQL Server Table

Save C# DataTable SQL Server Table

 
1.    Create User Defined Data Table Type 
 
CREATE TYPE tbl_data AS TABLE
(
    InvoiceDate        NVARCHAR(50),
    InvoiceNo           VARCHAR(20),
    SKUCode           VARCHAR(10),
    ItemName          VARCHAR(50),
    Category            VARCHAR(50),
    SubCategory      VARCHAR(50) NULL,
    Qty                     INT  
 
2. Pass data stored in DataTable to a stored procedure as a parameter of type DataTable.
 
3. In stored procedure 

INSERT INTO INV_DATA (InvoiceDate, InvoiceNo, SKUCode, ItemName, Category, SubCategory, Qty)
SELECT                             InvoiceDate, InvoiceNo, SKUCode, ItemName, Category, SubCategory, Qty
FROM             @data
  

How to make an HTTP get request with parameters

 

Method-1

In a GET request, pass parameters as part of the query string.

 

                    string url = "http://inventory.com?invoice=12345";
 
Method-2
 
WebClient webClient = new WebClient();
webClient.QueryString.Add("param1", "value1");
webClient.QueryString.Add("param2", "value2");
string result = webClient.DownloadString("http://theurl.com"); 

Wednesday, December 18, 2024

Textbox Accepting Decimal Values

 

<asp:TextBox ID="TextBox1" runat="server" 
TextMode="Number" step="0.01" Width="140px" min="0"></asp:TextBox>