Can someone tell me what does the 50 stands for?Code:Data.OleDb.OleDbType.VarChar, 50, txtGroupName.Text
Printable View
Can someone tell me what does the 50 stands for?Code:Data.OleDb.OleDbType.VarChar, 50, txtGroupName.Text
If you re-type that line of code in vb .net, once you type the first comma, a small box should pop up telling you what is required after the comma and what it means!! E.g the first comma after VarChar.
It's size, which you can read up on here: http://msdn.microsoft.com/en-us/libr...eter.size.aspx
As above you could have read that within the IDE using the intellisense features.
Anyhow when you setup and design a database, often you will put a maximum number of characters limit upon the fields, or columns of the database tables being designed. For instance a UK postcode maybe "SW12 1WS" - a maximum of 8 characters (this is an example, don't take that 8 for granted) so a PostCode database field you might setup with 8 as it's size, or maximum amount of characters to accept.
If you then performed an INSERT into your database table with this field in, and specfied a value of 0123456789 for the PostCode field, the database engine will correctly determine from your table field's size property that this value isn't acceptable as being a valid post code, and throw an exception rather than saving the value/completing execution of the INSERT statement.
i am using visual studio, but it doesn't seem to pop out a small box. it only pops out for the varchar but as soon as i hit the first comma, nothing came out...
it says 'Gets or sets the maximum size, in bytes, of the data within the column'
In bytes, as in the range of values?
If so, then how do you put for currency and integer? To any amount?
I've expanded that previous answer to help explain a little further.
Quite right that statement on it's own won't give you the valid syntax to produce an intellisense popup - I had imagined (as I guess Mojo did) that you had the full line of code rather than that shortened sample. In order to get the intellisense there you can enter: "Dim anOLEDBParameter as new OLEDBParameter("
Apologies, that should help you a bit more!Quote:
Originally Posted by alex_read