datatypes

SQL Server, where clauses comparisons with different types & default casting behaviour

Right... this one had me baffled for a while today so maybe one of you SQL Server bright sparks can shed some light on this behaviour. We have a table Phones. In it, the phone numbers are stored as nvarchars and it contains numbers in International format, in only numeric format... so a US number +1-(212)-999-9999 is stored as 121299999...

Php PDO::bindParam data types.. how does it work?

Hi guys, im wondering what the declaration of the data type in the bind parameter (or value) is used for... I mean, i thougth that if i define a param like int, PDO::PARAM_INT, the param must be converted in int, something like $delete->bindParam(1, $kill, PDO::PARAM_INT); //should works like $delete->bindParam(1, (int)$kill); or at ...

PostgreSQL and C# Datatypes

I search type convertion table between PostgreSQL and C# but I could not find. I'll research empty cell on above table if I have time. But if you know the web page which has these infomation,I'm very appropriate to your help. Postgre Type --->C# Type bigint --->Int64 bigserial ---> bit [ (n) ] --->Byte[] bit varying [ (n) ] --->Byte...

Can I convert long to int?

I want to convert long to int. If the value of long > int.MaxValue, I am happy to let it wrap around. What is the best way? ...

Where are the .Net data types stored?

Hi, Where are the .Net data types stored? ...

How do languages such as Python overcome C's Integral data limits?

While doing some random experimentation with a factorial program in C, Python and Scheme. I came across this fact: In C, using 'unsigned long long' data type, the largest factorial I can print is of 65. which is '9223372036854775808' that is 19 digits as specified here. In Python, I can find the factorial of a number as large as 999 w...

Is char guaranteed to be exactly 8-bit long in C?

That's all. Didn't find any similar topic so bear with me it there is. ...

Is there any reason not to use Aliases in the System namespace?

Hi, I've always been used to using String instead of string and Int32 instead of int. Mainly because everything is a class, so I like to keep consistent and treat so called 'primitives' just like every other class/object. I just saw an article on coding standards where it mentioned "Always use C# predefined types rather than the aliase...

How do you define money type in F#

Can you suggest a best way to define money type in F#? ...

Is it a good idea to use an integer column for storing US ZIP codes in a database?

From first glance, it would appear I have two basic choices for storing ZIP codes in a database table: Text (probably most common), i.e. char(5) or varchar(9) to support +4 extension Numeric, i.e. 32-bit integer Both would satisfy the requirements of the data, if we assume that there are no international concerns. In the past we've ...

PHP value won't exceed 127

Here's part of the code on my form: <br><input type="checkbox" checked="yes" name="country[]" value="1" />Asia/Pacific Region <br><input type="checkbox" checked="yes" name="country[]" value="2" />Europe <br><input type="checkbox" checked="yes" name="country[]" value="3" />Andorra ... <br><input type="checkbox" checked="yes" name="countr...

Stack of elements

How do I insert elements of different data types into a single stack in Java? ...

Any reason to use byte/short etc.. in C#?

Over the int type? A lot of code either uses int with double/floats. I know there is the likes of .NET mobile versions so byte/short comes into their own but for desktop apps is there any point? When I did C++ work (Games programming) I was very aware of each data type I was using though I don't have this feeling in C#/Java work. Wou...

Clong overflow in VB6

Hi, I'm having an overflow error in VB 6.0 when using the Clong datatype because of really big values. How to overcome this? Is there anything else available higher than the Clong datatype? ...

Converting System.types to SMO.DataTypes

I have a project that creates a table from a DataTable to a SQL table via SMO. The datatypes of the columns do not convert currently from System.Type to SMO.DataType. I can do this via a Case statement but I was hoping for a cleaner solution. Maybe something involving TypeDescriptor.GetConverter(targetDataType). This works between Sys...

What data type is recommended for ID columns?

I realize this question is very likely to have been asked before, but I've searched around a little among questions on StackOverflow, and I didn't really find an answer to mine, so here goes. If you find a duplicate, please link to it. For some reason I prefer to use Guids (uniqueidentifier in MsSql) for my primary key fields, but I rea...

Make mysql_fetch_assoc automatically detect return data types?

When using mysql_fetch_assoc in PHP, how can I make it return the correct data types? Right now it appears to convert everything to strings, I'd prefer if it left the Ints as Ints, and somehow designated the Date/Time as either Object or somehow different than strings. The reason for this is that I am using PHP as a backend to a Flex ap...

Convert Bytes to bits

Hi, I'm working with java. I have a byte array (8 bits in each position of the array) and what I need to do is to put together 2 of the values of the array and get a value. I'll try to explain myself better; I'm extracting audio data from a audio file. This data is stored in a byte array. Each audio sample has a size of 16 bits. If t...

Iphone datatype

How to convert NSString to Integer... i mean. NSString *one=@"1"; i want to get this value like this.. int t=1; is it possible..? pls help me thanks and regards... by raju ...

Is it possible to write a generic function in .NET that only accepts numerical types?

Suppose I want to write a function like the following (as usual, a trivial example for illustrative purposes): Public Function calcSqSum(Of T)(ByVal list As IEnumerable(Of T)) As T Dim sumSq As T For Each item As T In list sumSq += (item * item) Next Return sumSq End Function As you can probably guess, this f...