-
checkbox with SQL server
Can you tell me how to use the checkbox so that I can insert a value of -1 into the table when it is selected and 0 when not? I have tried the following:
.dbEditUpdateFlds="field=regComplete|type=checkbox +B"
If I make the field type nvarchar I get the following: true when the checkbox is selected and 0 when it's not. I get an error if I change the type to `bit'
Bob
-
you mean a true/false? the 0/-1 is different for Access and SQL. that is why you can set it in dbBooltext.
FK
-
I have added the line .dbBoolText="Droptrue=-1|Dropfalse=0" and changed the field type to `bit'. The zero goes in fine but when I select the checkbox I get the error:
`Invalid column name true' etc
-
`Invalid column name true'
This msg does not look right!
Give me a few lines of code...
FK
-
Frank
Give me a couple of days and I'll send you a Northwind sample
-
I found this example in my folder. Try it !
FK
<script language='vb' runat='server'>
Sub Page_Load(Source as Object, E as EventArgs)
Dim Mydb As New Tornado.Z()
With Mydb
.dbQP = "U=2| M=Grid| S=plain| D=fkw;northwind;sa;sa| Q=SELECT * From products| TextHolder=Title=Bit Field Demo|ni=b5,update|bm=products;0| gdf=0,1,2,3,discontinued"
.dbEditUpdateflds="Fi=0|ty=RONOUPDATE, fi=Discontinued| ty=CheckBox"
.dbBoolText="DropTrue=1|DropFalse=0"
.ASPdbNET()
End With
End Sub
</script>
-
Frank
I think my dll may be out of date or something - when I run your sample and update the checkbox I get:
System.Data.OleDb.OleDbException: Invalid column name 'true'. at System.Data.OleDb.OleDbDataReader.NextResults(IMul tipleResults imultipleResults, OleDbConnection connection, OleDbCommand command) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at Tornado.Edit.Action_Edit_Execute_SQL(String sql, String which, Int32 recs)
-
that must be the reason.. go download the latest...
-
Downloaded latest dll and used your sample code - it's working fine. Thanks
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
|
|