last round of warning squashing. calling it a day now.

This commit is contained in:
Dr Scofield
2008-06-27 23:03:39 +00:00
parent 20940951b2
commit 748f72326d
73 changed files with 722 additions and 530 deletions

View File

@@ -1686,27 +1686,27 @@ namespace OpenSim.Data.SQLite
/// </summary>
/// <param name="dt">Data Table</param>
/// <returns></returns>
private static string defineTable(DataTable dt)
{
string sql = "create table " + dt.TableName + "(";
string subsql = String.Empty;
foreach (DataColumn col in dt.Columns)
{
if (subsql.Length > 0)
{
// a map function would rock so much here
subsql += ",\n";
}
subsql += col.ColumnName + " " + sqliteType(col.DataType);
if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
{
subsql += " primary key";
}
}
sql += subsql;
sql += ")";
return sql;
}
// private static string defineTable(DataTable dt)
// {
// string sql = "create table " + dt.TableName + "(";
// string subsql = String.Empty;
// foreach (DataColumn col in dt.Columns)
// {
// if (subsql.Length > 0)
// {
// // a map function would rock so much here
// subsql += ",\n";
// }
// subsql += col.ColumnName + " " + sqliteType(col.DataType);
// if (dt.PrimaryKey.Length > 0 && col == dt.PrimaryKey[0])
// {
// subsql += " primary key";
// }
// }
// sql += subsql;
// sql += ")";
// return sql;
// }
/***********************************************************************
*
@@ -2083,32 +2083,32 @@ namespace OpenSim.Data.SQLite
/// <param name="type">a Type</param>
/// <returns>an sqliteType</returns>
/// <remarks>this is something we'll need to implement for each db slightly differently.</remarks>
private static string sqliteType(Type type)
{
if (type == typeof (String))
{
return "varchar(255)";
}
else if (type == typeof (Int32))
{
return "integer";
}
else if (type == typeof (Int64))
{
return "integer";
}
else if (type == typeof (Double))
{
return "float";
}
else if (type == typeof (Byte[]))
{
return "blob";
}
else
{
return "string";
}
}
// private static string sqliteType(Type type)
// {
// if (type == typeof (String))
// {
// return "varchar(255)";
// }
// else if (type == typeof (Int32))
// {
// return "integer";
// }
// else if (type == typeof (Int64))
// {
// return "integer";
// }
// else if (type == typeof (Double))
// {
// return "float";
// }
// else if (type == typeof (Byte[]))
// {
// return "blob";
// }
// else
// {
// return "string";
// }
// }
}
}