Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


cmd.ExecuteTable("table1",500) error


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2008, 07:23 AM
Senior Member
 
Join Date: Jul 2007
Posts: 147
Awards Showcase
Beta Tester 
Total Awards: 1
Default cmd.ExecuteTable("table1",500) error

When I insert this into the program it kicks out this error

error description:
arithmetic operation resulted in an overflow

This is it's environment.

PHP Code:
Sub App_Start
    Form1
.Show
    Con
.New1    
    Cmd
.New1("",con.Value)
    
Con.Open("Data Source = " AppPath "\Northwind.sl3")    
    
cmd.CommandText="CREATE TABLE if not exists table1 (col1,col2)"
    
cmd.ExecuteNonQuery
    cmd
.AddParameter("value1")
    
cmd.AddParameter("value2")    
    
cmd.CommandText "INSERT INTO [table1] (col1,col2) VALUES (@value1,@value2)"
    
Con.BeginTransaction
    cmd
.SetParameter("value2","SomeValue")
    For 
0 To 10
        cmd
.SetParameter("value1",i)
        
cmd.ExecuteNonQuery
    Next
    cmd
.ExecuteTable("table1",500)
    
Con.EndTransaction
    Con
.Close
    cmd
.Dispose
    Con
.Dispose
End Sub 
Any help appreciated.
__________________
Using 6.30
dennishea
Reply With Quote
  #2 (permalink)  
Old 06-15-2008, 09:41 AM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 155
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Default

This is my little help
Code:
Form1.Show
AddTable ("Form1", "TableView", 30, 30, 200, 200)
Con.New1    
Cmd.New1("",con.Value)
Con.Open("Data Source = " & AppPath & "\Northwind.sl3")    
cmd.CommandText="CREATE TABLE if not exists table1 (col1,col2)"
cmd.ExecuteNonQuery
cmd.AddParameter("value1")
cmd.AddParameter("value2")    
cmd.CommandText = "INSERT INTO [table1] (col1,col2) VALUES (@value1,@value2)"
Con.BeginTransaction
cmd.SetParameter("value2","SomeValue")
For i = 0 To 10
      cmd.SetParameter("value1",i)
      cmd.ExecuteNonQuery
Next
Con.EndTransaction
cmd.CommandText="select * from table1"
cmd.ExecuteTable("TableView",0)
Con.Close
cmd.Dispose
Con.Dispose
__________________
Gianni Maione
Reply With Quote
  #3 (permalink)  
Old 06-15-2008, 03:54 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

Small explanation:
ExecuteTable executes the command's query and puts the result in a table control.
The two arguments that it receives are the name of the table control and maximum rows to return (or 0 to return all rows).
Reply With Quote
  #4 (permalink)  
Old 06-15-2008, 04:17 PM
Senior Member
 
Join Date: Jul 2007
Posts: 147
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Gianni Maione

First thanks for your help. I added your changes and that got rid of errors but I was still coming up with a blank table. It then struck me that addtable was buried under the one I already had. When I made mine invisible all was well. My only remaining question is I created mine at design time and it still isn't showing data and yours being added at run time is. What am I missing for design time to work and what is the difference between the two? Thanks again for your help.
__________________
Using 6.30
dennishea
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Error saving file" N1c0_ds Bug Reports 0 09-14-2008 01:25 AM
"Error loading program" on 29th Feb 08 WZSun Bug Reports 2 03-01-2008 06:43 AM
Problem with Serial. ("before loop" error) jesb4ppc Questions & Help Needed 3 02-15-2008 06:41 PM
calling the device's "Programs" or "settings" screens HarleyM Questions & Help Needed 0 12-05-2007 03:59 AM
Error message: "Not correct version of dll" BjornF Questions & Help Needed 5 09-17-2007 04:16 PM


All times are GMT. The time now is 03:34 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0