Skip to main content

Posts

WPF Devexpress Datagrid checkbox binding

We can easily bind the checkbox on devexpress datagrid <dxgcore:GridColumn Width="20" AllowEditing="True" Binding="{Binding Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="R" Visible="{Binding CheckboxSelection}" VisibleIndex="6"> <dxgcore:GridColumn.CellTemplate> <DataTemplate> <dxe:CheckEdit HorizontalAlignment="Center" VerticalAlignment="Center" Command="{Binding Path=View.DataContext.IsCheckedCommand}" CommandParameter="{Binding RowData.Row}" IsChecked="{Binding RowData.Row.IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ...

Visual Studio copy dll from project folder to bin folder on build solution

If we want to copy from project folder DLL (3rd party or other type)  to Bin folder during build the solution we can easily map that option. right click on you solution -> Properties -> Buld Events and follow the format for your folder C:\Windows\System32\xcopy /d /y "$(ProjectDir)PackagedDLL\FAX\*.*" "$(TargetDir)" In my case FAX is my folder name.

T-SQL update table from join table value

If you want to update your table from join table value you can try with this: UPDATE r SET r.l_auto_refill = 1 ,r.d_start_date = p.dDispDate ,r.n_frequency = p.nDispDaysSupply ,r.d_next_fill = DATEADD(DAY, p.ndispdayssupply, p.ddispdate) FROM rx r INNER join profile AS p ON r.[rxno_PK] = p.rxno_FK where r.rxno_PK = '000010578126'

T-SQL get one records from multiple same record based on max value for join

Let's say you have same type 6 record, into this record when you will picked data you will pick only one record which has highest value. SELECT * FROM rx r INNER join (SELECT distinct t1.* FROM profile t1 LEFT OUTER JOIN profile t2 ON (t1.rxno_FK = t2.rxno_FK AND t1.nrefillno < t2.nrefillno ) WHERE t2.dispid_PK IS NULL) AS p ON r.[rxno_PK] = p.rxno_FK

sql get all table names with primary key columns

If you want to get all table name with table primary key coloumn you can use the sql query. SELECT i.name AS IndexName, OBJECT_NAME(ic.OBJECT_ID) AS TableName, COL_NAME(ic.OBJECT_ID,ic.column_id) AS ColumnName FROM sys.indexes AS i INNER JOIN sys.index_columns AS ic ON i.OBJECT_ID = ic.OBJECT_ID AND i.index_id = ic.index_id WHERE i.is_primary_key = 1

data-tech FaxMan,FaxMan Jr and interfax alternative for sending fax

Last couple of day i spend time on sending Fax in C#. i just find out 2 service provider can send fax. data-tech's FaxMan or FaxMan Jr  http://www.data-tech.com/products/fax.aspx  and 3rd party web api https://www.interfax.net/en data-tech Fax SDK is not working on windows 10 and interfax API is not free for sending fax. You easily send fax using Faxcomlib. for details please check the sample. https://code.msdn.microsoft.com/C-Send-Fax-using-fax-Modem-357aca81 Thank you.

Common T-SQL

Recently i have completed  online training program on T-SQL from Edx. I just share in my blog that will cover all basic T-SQL. -- Display all columns for all customers SELECT * FROM SalesLT.Customer; -- Display customer name fields SELECT Title, FirstName, MiddleName, LastName, Suffix FROM SalesLT.Customer; -- Display title and last name with phone number SELECT Salesperson, Title + ' ' + LastName AS CustomerName, Phone FROM SalesLT.Customer; -- Customer Companies SELECT CAST(CustomerID AS varchar) + ': ' + CompanyName AS CustomerCompany FROM SalesLT.Customer; --Sales Order Revisions SELECT SalesOrderNumber + ' (' + STR(RevisionNumber, 1) + ')' AS OrderRevision, CONVERT(nvarchar(30), OrderDate, 102) AS OrderDate FROM SalesLT.SalesOrderHeader; -- Get middle names if known SELECT FirstName + ' ' + ISNULL(MiddleName + ' ', '')+ LastName AS CustomerName FROM Sales...