2 Replies - 5422 Views - Last Post: 22 September 2010 - 09:41 AM Rate Topic: -----

#1 mjw85  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 52
  • Joined: 01-October 07

Boolean checkbox, return value as parameter

Posted 22 September 2010 - 08:46 AM

I currently have a check box that I need to pass into a database to be stored. I need to pass it as a parameter, but am really confused on doing so. I know that it will return a value of true or false, but am lost from there. Is is stored as a VarChar2 in Oracle.
ANY help is appreciated, thanks!
:dozingoff:


 DataColumn dtcCheck = new DataColumn("PRIORITY");
dtcCheck.DataType = System.Type.GetType("System.Boolean");
dtcCheck.DefaultValue = false;   DataTableName.Columns.Add(dtcCheck);


Don't know if I need something like...
if (dtcCheck.Checked)
 {
     value = true;
 }
     else
{
     value = false;
        }
        return value;




Whereas my parameter within Visual Basic looks like:
               cmdInsert.Parameters.Add("p_Priority", OracleDbType.Varchar2, strPriority, ParameterDirection.Input);



Seems like it shouldn't be so difficult, but has me completely lost :surrender:

Thanks!


Is This A Good Question/Topic? 0
  • +

Replies To: Boolean checkbox, return value as parameter

#2 Robin19  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 271
  • View blog
  • Posts: 550
  • Joined: 07-July 10

Re: Boolean checkbox, return value as parameter

Posted 22 September 2010 - 09:27 AM

dtcCheck.Checked already returns true of false. I would just use that.

This post has been edited by Robin19: 22 September 2010 - 09:28 AM

Was This Post Helpful? 1
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5476
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: Boolean checkbox, return value as parameter

Posted 22 September 2010 - 09:41 AM

return dtChecked.Checked;
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1