Created
August 31, 2012 16:09
-
-
Save mbmccormick/3555204 to your computer and use it in GitHub Desktop.
Shit that annoys me.
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 int FetchMediumType(string device) | |
{ | |
SQLSelect select = new SQLSelect(Connection); | |
select.Columns("MediumType"); | |
select.From("dbo.Links"); | |
select.Distinct = true; | |
select.Where("FromPort", Op.Like, device) | |
.Or("ToPort", Op.Like, device); | |
return select.ExecuteScalar<int>(); | |
} | |
public int FetchMediumTypeFromString(string type) | |
{ | |
SQLSelect select = new SQLSelect(Connection); | |
select.Columns("PK"); | |
select.From("dbo.MediumType"); | |
select.Distinct = true; | |
select.Where("MediumType", Op.Equal, type); | |
return select.ExecuteScalar<int>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A region!? Bleh!