var LeftJoin = from t1 in Table1
join t2 in table2
on t1.ID equals t2.ID into JoinedT
from T2 in JoinedT .DefaultIfEmpty()
select new
{
T1 = T1.Name,
T2 = description
};
to make the same to Right join just invert the side of the Join
Tuesday, September 22, 2009
Left Join, Right Join Using LINQ
Friday, September 18, 2009
cracking a router
Just crunch the numbers. The dictionary to store all 9 character passwords with all printable characters in is basically impossible to store:
or would take too long to compute on the fly. So unless you have the solution to free & clean energy and aren't sharing AND the CIA/NSA etc know you're hiding it, you have nothing to worry about, apply standard password policies and save yourself a lot of wasted time.
The end goal here is: A friend of mine has invited me to see how secure his WEP network is, with a dictionary-word-based router password.
I just think it's a waste of time to begin with alphanumeric plus symbols when many networks will merely use lower-case alphabetic passwords.
Certainly it's faster to go through dictionary words and then try them with numerical suffixes, versus a brute-force.
http://forums.remote-exploit.org/newbie-area/18312-best-method-crack-router-password.html
Thursday, September 17, 2009
triggers with a computed column insertion
the error was resolved with the following trigger code:
CREATE TRIGGER insertanotaVario
on NotaIngreso
SET IDENTITY_INSERT Nota ON
select (idnota,notadescripcion, curso1, curso2, curso3)
FROM INSERTED
SET IDENTITY_INSERT Nota OFF
// Note: do not add the field that is the average calculated from the column(computed column).
Tuesday, September 8, 2009
Decimal vs Float (Single) or Double
If you are working with currency, though, this could get you into a lot of trouble.
Here’s why.
When you store a number into a float, you are not storing an exact number. This is because the number you are storing is an approximation of the number you entered. When you store a number, the integer portion of the number gets priority and the fractional part gets entered as close as is possible given the size of the type you are storing it as.
That is, a Double will be able to save the information more accurately than the Float, but neither of them will store the information precisely.
And that’s just storing a number we enter directly. What happens if we need to multiply or divide that number?
For simplicity, let’s just say we need to divide a dollar by three. How would that get stored accurately into a float or a double? The answer is that it won’t. It will store as many threes on the right side of the decimal as possible.
This is what the Decimal data type was created for. A decimal data type deals with the data more like we would if we were dealing with the problem with paper and pencil. In effect, a decimal data type is similar to an integer that has a decimal point.
taked from : http://blog.dmbcllc.com/2008/10/14/decimal-vs-float-single-or-double/
Monday, September 7, 2009
Posteando en StackOverflow
I want to convert my float field into a decimal field; I want a precision of 11,2 in my decimal field, but when I tried to change the type of my field(example: Amount) I get an error: "Arithmetic overflow error converting float to data type numeric. The statement has been terminated." My field is decimal(11,2) at the table, and my max and min values are: 1,603,837,393.70 < -- > -1,688,000,000.00(amount).
select Id,AccountId, cast(Amount as decimal(12,2)) as Amount,
cast(AmountB as decimal(12,2)) as AmountB
FROM myTable
Esta fue la respuesta.
But a value of "1,603,837,393.70" would require decimal(12,2) - 12 digits in all, 2 after the decimal point.
Maybe you misinterpreted the way the decimal(11,2) works? This would mean total of 11 digits - 9 to the left, 2 to the right of the decimal point.
See the MSDN docs for decimal and numeric types:
decimal[ (p[ , s] )] and numeric[ (p[, s] )]
p (precision)
The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point.
Friday, September 4, 2009
con un poco de paciencia....

hoy me encontre esta imagen , que tome antes de salir de ICASA.... ah como pasa el tiempo.
Brayan Recinos Corado
Ingenieria de Software
Unidad de Servicios Compartidos
( (+502) 66209720 Ext. 113176
* brayanrecinos@icasa.com.gt
traduciendo de vb for aplications a t-sql (ver. 1)
qry = " SELECT GLProcessEntry.ProcessEntryId, GLAccount.MethodId, GLAccount.AccountId, GLAccount.OffSetAccountId,GLProcessEntryDetail.CcyAmount, "
qry = qry & " GLProcessEntryDetail.CADAmount, PeriodCcyRate.Quote, Round([CCyAmount]*[Quote]-[CADAmount],2) AS EntryAmount "
qry = qry & " FROM CfgCieMethodQuoteStatus,GLAccount,GLProcessEntry,GLProcessEntryDetail,PeriodCcyRate "
qry = qry & " WHERE GLProcessEntry.ProcessEntryId = GLProcessEntryDetail.ProcessEntryId "
qry = qry & " AND GLAccount.CieId = GLProcessEntry.CieId "
qry = qry & " AND GLAccount.AccountId = GLProcessEntryDetail.AccountId "
qry = qry & " AND GLAccount.CCy = PeriodCcyRate.Ccy "
qry = qry & " AND GLProcessEntry.PeriodId = PeriodCcyRate.PeriodId "
qry = qry & " AND CfgCieMethodQuoteStatus.QuoteStatusId = PeriodCcyRate.QuoteStatusId "
qry = qry & " AND CfgCieMethodQuoteStatus.MethodId = GLAccount.MethodId "
qry = qry & " AND CfgCieMethodQuoteStatus.CieId = GLAccount.CieId "
qry = qry & " AND GLProcessEntry.ProcessEntryId=" & ProcessEntryId
qry = qry & " AND GLAccount.MethodId=" & MethodId
If MethodId = 1 Then
qry = qry & " AND GLPRocessEntryDetail.AmountTypeId = 0 "
qry = qry & " AND ((Round([CCyAmount]*[Quote]-[CADAmount],2))<>0)"
Else
qry = qry & " AND GLPRocessEntryDetail.AmountTypeId = 1 "
qry = qry & " AND ((Round([CCyAmount]*[Quote]-[CADAmount],2))<>0)"
End If
------
la traduccion al t- sql
SELECT GLProcessEntry.ProcessEntryId, GLAccount.MethodId, GLAccount.AccountId, GLAccount.OffSetAccountId,GLProcessEntryDetail.CcyAmount,
GLProcessEntryDetail.CADAmount, PeriodCcyRate.Quote, Round([CCyAmount]*[Quote]-[CADAmount],2) AS EntryAmount
FROM CfgCieMethodQuoteStatus
INNER JOIN PeriodCcyRate on CfgCieMethodQuoteStatus.QuoteStatusId = PeriodCcyRate.QuoteStatusId
INNER JOIN GLAccount ON CfgCieMethodQuoteStatus.MethodId =GLAccount.MethodId
INNER JOIN GLProcessEntryDetail ON GLAccount.AccountId=GLProcessEntryDetail.AccountId
INNER JOIN RefCompany ON RefCompany.CieId = CfgCieMethodQuoteStatus.CieId
INNER JOIN RefDivision ON GLAccount.DivisionId = RefDivision.DivisionId
INNER JOIN GLProcessEntry ON GLProcessEntry.PeriodId = PeriodCcyRate.PeriodId
AND GLProcessEntry.ProcessEntryId = GLProcessEntryDetail.ProcessEntryId
WHERE GLPRocessEntryDetail.AmountTypeId = 0
and GLProcessEntry.ProcessEntryId = 169
AND GLAccount.MethodId = 1
and GLProcessEntryDetail.CADAmount = 0
