0

How can I reproduce

SELECT CAST(ID AS varchar(20)) AS IdAsString
FROM Table

Using Subsonic 2.2?

Stewart Alan
  • 1,521
  • 5
  • 23
  • 45

2 Answers2

0

Once you've generated classes from the database, something like this:

TableCollection tc = new TableCollection ();
TableCollection.Load();
string s = "";
foreach (Table t in tc) {
    s += " " + t.ID.ToString();
}

I'm assuming you want the whole table, otherwise you'd probably have the ID to start with. You can also use

TableCollection.WHERE("OtherColumn", 23).Load();

to retrict the table records returned.

Ben McIntyre
  • 1,972
  • 17
  • 28
0
DAL.DB.Select(
    string.Format("CAST({0} AS varchar(20)) AS IdAsString", DAL.Table.Columns.ID)
    )
.From<DAL.Table>()
...
marapet
  • 54,856
  • 12
  • 170
  • 184