Help Frams Bouma

N

Nick

I've recently been using your LLBL code generator as an assist to
stubbing out my classes and I noticed that you use Sqltypes as your
property return types. If I leave these as is do I have to cast my
values from string toSqlString and from DataTime to SqlDate and from
int to SqlInt32 etc......Isn't that a lot of casting to be doing? I'm
very curious about how to properly use these types. We are developing
a very data intensive web app and any optimization we can get is
beneficial. I'm assuming that if I retrive a string value from a web
control text box, I'm going to have to convert on the way in and on
the way out.
could you elaborate on this for me (or someone) Very intersting, I've
read just about every ado.net book out there and no one does this. Are
they all mising the Boat? Dave, William? what gives guys?
Thanks
Nick
 
F

Frans Bouma

Nick said:
I've recently been using your LLBL code generator as an assist to
stubbing out my classes and I noticed that you use Sqltypes as your
property return types. If I leave these as is do I have to cast my
values from string toSqlString and from DataTime to SqlDate and from
int to SqlInt32 etc......Isn't that a lot of casting to be doing? I'm
very curious about how to properly use these types.

You don't have to cast. It depends on the language you use what you
have to do. In C# it's easy:

string s = "test";
MyClass m = new MyClass();

// Foo is an SqlString property
m.Foo = s; // Foo will get the value "test"

In VB.NET you have to do something more because VB.NET doesn't support
operator overloading

Dim s as string = "test"

Dim m as new MyClass()
m.Foo = new SqlString(s)
We are developing
a very data intensive web app and any optimization we can get is
beneficial. I'm assuming that if I retrive a string value from a web
control text box, I'm going to have to convert on the way in and on
the way out.

No.

To store a value in a generated class, see above.
To read it:

string s = m.Foo.Value;

:)
could you elaborate on this for me (or someone) Very intersting, I've
read just about every ado.net book out there and no one does this. Are
they all mising the Boat? Dave, William? what gives guys?

Btw, you can mail me directly when it comes to llblgen questions :)

HTH

FB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top