|
-
Jun 27th, 2008, 03:59 AM
#1
Thread Starter
Addicted Member
A very noob question but need answers
Code:
Data.OleDb.OleDbType.VarChar, 50, txtGroupName.Text
Can someone tell me what does the 50 stands for?
-
Jun 27th, 2008, 04:04 AM
#2
Hyperactive Member
Re: A very noob question but need answers
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.
-
Jun 27th, 2008, 04:08 AM
#3
Re: A very noob question but need answers
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.
Last edited by alex_read; Jun 27th, 2008 at 04:15 AM.
-
Jun 27th, 2008, 04:08 AM
#4
Thread Starter
Addicted Member
Re: A very noob question but need answers
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...
-
Jun 27th, 2008, 04:12 AM
#5
Thread Starter
Addicted Member
Re: A very noob question but need answers
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?
-
Jun 27th, 2008, 04:18 AM
#6
Re: A very noob question but need answers
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("
-
Jun 27th, 2008, 04:49 AM
#7
Hyperactive Member
Re: A very noob question but need answers
 Originally Posted by alex_read
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|