This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
– Microsoft SQL Server T-SQL date and datetime formats | |
– Date time formats – mssql datetime | |
– MSSQL getdate returns current system date and time in standard internal format | |
SELECT convert(varchar, getdate(), 100) – mon dd yyyy hh:mmAM (or PM) | |
– Oct 2 2008 11:01AM | |
SELECT convert(varchar, getdate(), 101) – mm/dd/yyyy - 10/02/2008 | |
SELECT convert(varchar, getdate(), 102) – yyyy.mm.dd – 2008.10.02 | |
SELECT convert(varchar, getdate(), 103) – dd/mm/yyyy | |
SELECT convert(varchar, getdate(), 104) – dd.mm.yyyy | |
SELECT convert(varchar, getdate(), 105) – dd-mm-yyyy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DataGridViewRow dgrr = dgv.Rows.Cast<DataGridViewRow>().First<DataGridViewRow>(r => r.Cells[ColumnText].Value.ToString() == "Condition"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TypeSwitch.Do( | |
sender, | |
TypeSwitch.Case<Button>(() => textBox1.Text = "Hit a Button"), | |
TypeSwitch.Case<CheckBox>(x => textBox1.Text = "Checkbox is " + x.Checked), | |
TypeSwitch.Default(() => textBox1.Text = "Not sure what is hovered over")); | |
static class TypeSwitch { | |
public class CaseInfo { | |
public bool IsDefault { get; set; } | |
public Type Target { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Switch(foo) | |
.Case<Fizz> | |
(action => { doingSomething = FirstMethodCall(); }) | |
.Case<Buzz> | |
(action => { return false; }) | |
public class Switch | |
{ | |
public Switch(Object o) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public DataTable GetDelivery() | |
{ | |
try | |
{ | |
db_ProductionSystemEntities Context = this.GetContext(); | |
//var Records = Context.T_DELIVERY | |
// .Include("T_CUST_INFO") | |
// .Include("T_SHIPPING_COMPANY"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using System.Linq; | |
using System.Collections; | |
using System.Collections.Specialized; | |
using System.Data.SqlClient; | |
using System.Windows.Forms; | |
using System.Collections.Generic; | |
using CSP_db_production_EntityDataAccess.Access; | |
using CSP_db_production_Utility.DataGridUtility; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace CSP_PGP_Fileprocessor_util | |
{ | |
static class TypeSwitch | |
{ | |
public class CaseInfo { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Records = context.Customers.Join(context.TransactionExchangeMoneys | |
, x => x.Cust_ID | |
, y => y.PayBy | |
, (x, y) => new { x, y }) | |
.Join(context.Products | |
, t=> t.y.ProductID | |
, p => p.ProductID | |
, (t,p) => new {t,p}) | |
.GroupBy(r => new { r.t.x.Cust_ID,r.t.x.UserNames ,r.t.x.EmailAddress_First,r.t.x.ShopName}) | |
.Select(g => new UserAndMoneyPaid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Context = new CSPRedemptionEntities(); | |
var List = from cp in Context.CouponPools | |
join cb in Context.CouponBatches | |
on new { CouponBatch_id = cp.CouponBatch_id } equals | |
new { CouponBatch_id = cb.id } | |
join m in Context.Members | |
on new { RedeempBy_id = cp.RedeemBy.Value } equals | |
new { RedeempBy_id = m.id} into MemberLeft | |
from x in MemberLeft.DefaultIfEmpty() | |
where cp.CouponBatch_id == CouponBatch_id && cp.Campaign_id == Campaign_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var objCtx = ((System.Data.Entity.Infrastructure.IObjectContextAdapter)Context).ObjectContext; | |
objCtx.ExecuteStoreCommand("TRUNCATE TABLE [ServiceArgs]"); |
OlderNewer