Welcome Guest! To enable all features please
Login or Register.
Welcome to the Modifications and Patches ForumThis is the only forum that allows file uploading (max 5 megs).
Please enhance the YAF community by posting your:
Modifications
Bug fixes/Patches
Smiles Packs
Avatars Packs
Themes
Updated Language Files
If you are posting a Theme please attach a screen shot of the theme. For all items explain WHICH version of YAF they are designed for.
Thanks!
-Jaben
Edited by user
2007-10-06T00:11:46Z
|
Reason: Not specified
How do you post a file?
First, create a new topic like usual and click "Post". Then, after your new topic has been created, you click the "Attach" button on your new post. From there, you can easily upload multiple files.
Where can I have file for translating from English?
Simply patch for data layer.
Simply patch for data layer.
A patch to begin separate data layer remnants from core code(harmless one).
On applying, the /YetAnotherForum.Net/ folder will be completly cleared from MS SQL database code. And
it's completly safe and tested.
After this all the DB related code should be separated at last:-d .
Edited by user
2009-01-26T04:48:36Z
|
Reason: Patch additions
Missing conversion hacks for other data layers
Lithuanian Language
my forum at web adress www.ravendev.lt/forum
Thanks for the contribution! :)
.....the man in black fled across the desert..........and the gunslinger followed.....
from my forum you can get image files with Lithuanian language
The proposed patch to make all data layers almost safe proof compatable in future.
It's for MS SQL data layer, but the only difference is in the DBAccess.cs file and class CoolCoverter.
For
MySQL it reads for any data layer like this^
public static class CoolConverter
{
public static int VerifyInt32(object value)
{
if (value == DBNull.Value) return 0;
return Convert.ToInt32(value);
}
public static bool VeryfyBool(object value)
{
if (value == DBNull.Value || value.ToString() == "0") return false;
if ( value.ToString() == "1") return true;
return Convert.ToBoolean(value);
}
}
For
postgreSQL it's like this
public static class CoolConverter
{
public static int VerifyInt32(object o)
{
//if (o == DBNull.Value || o =="f" ) o = 0;
// if (o == "t") o = 1;
return Convert.ToInt32(o);
}
public static bool VeryfyBool(object o)
{
if (o.ToString() == "t") { return true; }
if (o.ToString() == "f") { return false; }
return false;
}
}
For
MS SQL Server it's simply
public static class CoolConverter
+ {
+ public static int VerifyInt32(object o)
+ {
+ return (int)o;
+ }
+ public static bool VeryfyBool(object o)
+ {
+ return (bool)o;
+ }
+ }
In the last case it's much more faster than using Convert.ToInt32 or Convert.ToBool :wink:
Edited by user
2009-02-17T07:38:23Z
|
Reason: Not specified
On little thing... I have to change the name to "SqlDataLayerConverter".
CoolConverter just isn't proper naming for the class.
Thank you for all your help though, bbobb.
On little thing... I have to change the name to "SqlDataLayerConverter".
CoolConverter just isn't proper naming for the class.
No matter, it was a temporary example class name anyway. I wait while it appears and verify data layers again to avoid any possible bugs.
Thanks that you found time for it:)
No, I was wrong.
The class for MSSQL
public static class SqlDataLayerConverter
+ {
+ public static int VerifyInt32(object o)
+ {
+ return (int)o;
+ }
+ public static bool VeryfyBool(object o)
+ {
+ return (bool)o;
+ }
+ }
doesn't work, because unboxing doesn't work safe in the case though it's fast.
Convert.To... should be used anyway:cry:
This makes boxing of DataRow value which is already filled by a value.
I was somehow completly sure that it should work.
And it's impossible to make dynamic conversion class without code deep changing in many places.
Sorry.
Edited by user
2009-02-19T13:45:11Z
|
Reason: Not specified
Interestingly, I haven't applied the conversion code yet. So I'll just hold off for now. I did apply the data layer centralization changes.
Forum Jump
- You cannot post new topics in this forum.
- You cannot reply to topics in this forum.
- You cannot delete your posts in this forum.
- You cannot edit your posts in this forum.
- You cannot create polls in this forum.
- You cannot vote in polls in this forum.
Important Information:
The YAF.NET Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close