diff options
author | Jeff Ames | 2008-06-26 20:25:57 +0000 |
---|---|---|
committer | Jeff Ames | 2008-06-26 20:25:57 +0000 |
commit | f8ccf00f1cd8b99a2012558ded7de01ffcff7e35 (patch) | |
tree | 0aa16acb4bd909a9c746557ae068180ba681bbf0 /OpenSim/Data/MSSQL/MSSQLManager.cs | |
parent | Apply patch from bug #1606 -- Documentation for Data/Null, Data/Base. Thanks... (diff) | |
download | opensim-SC_OLD-f8ccf00f1cd8b99a2012558ded7de01ffcff7e35.zip opensim-SC_OLD-f8ccf00f1cd8b99a2012558ded7de01ffcff7e35.tar.gz opensim-SC_OLD-f8ccf00f1cd8b99a2012558ded7de01ffcff7e35.tar.bz2 opensim-SC_OLD-f8ccf00f1cd8b99a2012558ded7de01ffcff7e35.tar.xz |
Apply patch from bug #1609 -- Documentation for Data/MSSQL. Thanks kerunix_Flan!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLManager.cs | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 3221b3a..a170a87 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs | |||
@@ -108,12 +108,23 @@ namespace OpenSim.Data.MSSQL | |||
108 | // return regions; | 108 | // return regions; |
109 | //} | 109 | //} |
110 | 110 | ||
111 | /// <summary> | ||
112 | /// | ||
113 | /// </summary> | ||
114 | /// <param name="dt"></param> | ||
115 | /// <param name="name"></param> | ||
116 | /// <param name="type"></param> | ||
111 | protected static void createCol(DataTable dt, string name, Type type) | 117 | protected static void createCol(DataTable dt, string name, Type type) |
112 | { | 118 | { |
113 | DataColumn col = new DataColumn(name, type); | 119 | DataColumn col = new DataColumn(name, type); |
114 | dt.Columns.Add(col); | 120 | dt.Columns.Add(col); |
115 | } | 121 | } |
116 | 122 | ||
123 | /// <summary> | ||
124 | /// | ||
125 | /// </summary> | ||
126 | /// <param name="dt"></param> | ||
127 | /// <returns></returns> | ||
117 | protected static string defineTable(DataTable dt) | 128 | protected static string defineTable(DataTable dt) |
118 | { | 129 | { |
119 | string sql = "create table " + dt.TableName + "("; | 130 | string sql = "create table " + dt.TableName + "("; |
@@ -137,9 +148,12 @@ namespace OpenSim.Data.MSSQL | |||
137 | return sql; | 148 | return sql; |
138 | } | 149 | } |
139 | 150 | ||
140 | 151 | /// <summary> | |
141 | // this is something we'll need to implement for each db | 152 | /// Type conversion function |
142 | // slightly differently. | 153 | /// </summary> |
154 | /// <param name="type">a type</param> | ||
155 | /// <returns>a sqltype</returns> | ||
156 | /// <remarks>this is something we'll need to implement for each db slightly differently.</remarks> | ||
143 | public static string SqlType(Type type) | 157 | public static string SqlType(Type type) |
144 | { | 158 | { |
145 | if (type == typeof(String)) | 159 | if (type == typeof(String)) |
@@ -375,6 +389,11 @@ namespace OpenSim.Data.MSSQL | |||
375 | return retval; | 389 | return retval; |
376 | } | 390 | } |
377 | 391 | ||
392 | /// <summary> | ||
393 | /// | ||
394 | /// </summary> | ||
395 | /// <param name="reader"></param> | ||
396 | /// <returns></returns> | ||
378 | public AssetBase getAssetRow(IDataReader reader) | 397 | public AssetBase getAssetRow(IDataReader reader) |
379 | { | 398 | { |
380 | AssetBase asset = new AssetBase(); | 399 | AssetBase asset = new AssetBase(); |
@@ -446,7 +465,7 @@ namespace OpenSim.Data.MSSQL | |||
446 | /// <summary> | 465 | /// <summary> |
447 | /// Execute a SQL statement stored in a resource, as a string | 466 | /// Execute a SQL statement stored in a resource, as a string |
448 | /// </summary> | 467 | /// </summary> |
449 | /// <param name="name"></param> | 468 | /// <param name="name">the ressource string</param> |
450 | public void ExecuteResourceSql(string name) | 469 | public void ExecuteResourceSql(string name) |
451 | { | 470 | { |
452 | SqlCommand cmd = new SqlCommand(getResourceString(name), (SqlConnection)dbcon); | 471 | SqlCommand cmd = new SqlCommand(getResourceString(name), (SqlConnection)dbcon); |
@@ -454,6 +473,10 @@ namespace OpenSim.Data.MSSQL | |||
454 | cmd.Dispose(); | 473 | cmd.Dispose(); |
455 | } | 474 | } |
456 | 475 | ||
476 | /// <summary> | ||
477 | /// | ||
478 | /// </summary> | ||
479 | /// <returns>The actual SqlConnection</returns> | ||
457 | public SqlConnection getConnection() | 480 | public SqlConnection getConnection() |
458 | { | 481 | { |
459 | return (SqlConnection)dbcon; | 482 | return (SqlConnection)dbcon; |
@@ -491,6 +514,11 @@ namespace OpenSim.Data.MSSQL | |||
491 | } | 514 | } |
492 | } | 515 | } |
493 | 516 | ||
517 | /// <summary> | ||
518 | /// | ||
519 | /// </summary> | ||
520 | /// <param name="name"></param> | ||
521 | /// <returns></returns> | ||
494 | private string getResourceString(string name) | 522 | private string getResourceString(string name) |
495 | { | 523 | { |
496 | Assembly assem = GetType().Assembly; | 524 | Assembly assem = GetType().Assembly; |