Add data to a gambas data grid

Quote from sam on July 4, 2022, 2:12 pmData grid Codes
This event is raised when the GridView needs the data stored in a specified cell.* Row is the cell row.
* Column is the cell column.PUBLIC SUB GridView1_Data(Row AS Integer, Column AS Integer)
GridView1.Data.Text = "Gambas " & Row & "," & Column
ENDAdding new records in a Gambas data grid
' Gambas class file
PRIVATE $hConn AS NEW
Connection
PRIVATE $res AS Result
'-------------------------------------------------
PUBLIC SUB Form_Open()
DIM iCount AS Integer
DIM hTable AS Table
DIM rTest AS result
DIM sql AS String
'define the gridview layout
GridView1.header =
GridView.Horizontal
GridView1.grid = TRUE
GridView1.Rows.count = 0
GridView1.Columns.count = 2
GridView1.Columns[0].text =
"ID"
GridView1.Columns[1].text = "Value"
GridView1.Columns[0].width =
55
GridView1.Columns[1].width = 55
WITH $hConn
.Type = "sqlite"
.host = User.home
.name = ""
END WITH
'delete an existing test.sqlite
IF Exist(User.home &
"/test.sqlite") THEN
KILL User.home & "/test.sqlite"
ENDIF
'create test.sqlite
$hConn.Open
$hConn.Databases.Add("test.sqlite")
$hconn.Close
'define the table sampleTable
$hconn.name = "test.sqlite"
$hConn.Open
hTable = $hConn.Tables.Add("sampleTable")
hTable.Fields.Add("s_seq", db.Integer)
hTable.Fields.Add("s_rndm", db.Integer)
hTable.PrimaryKey = ["s_seq"]
hTable.Update
'fill the table with generated data
$hconn.Begin
rTest = $hConn.Create("sampleTable")
FOR iCount = 1 TO 10000
rTest!s_seq = iCount
rTest!s_rndm = Int(Rnd(0, 100))
rTest.Update
NEXT
$hConn.Commit
'read the database
sql = "select s_seq as ID,
s_rndm as Value from sampleTable"
$res = $hconn.Exec(sql)
CATCH
$hConn.Rollback
Message.Error(DConv(Error.Text))
END
'-------------------------------------------------
PUBLIC SUB Form_Activate()
'change the rowcount of the
gridview from 0 to the number of records.
'This triggers the data
handling event
GridView1.Rows.Count = $res.Count
END
'-------------------------------------------------
PUBLIC SUB GridView1_Data(Row
AS Integer, Column AS Integer)
$res.moveTo(row)
GridView1.Data.text = Str($res[GridView1.Columns[column].text])
END
'-------------------------------------------------
PUBLIC SUB Form_Close()
Data grid Codes
This event is raised when the GridView needs the data stored in a specified cell.
* Row is the cell row.
* Column is the cell column.
PUBLIC SUB GridView1_Data(Row AS Integer, Column AS Integer)
GridView1.Data.Text = "Gambas " & Row & "," & Column
END
Adding new records in a Gambas data grid
' Gambas class file
PRIVATE $hConn AS NEW
Connection
PRIVATE $res AS Result
'-------------------------------------------------
PUBLIC SUB Form_Open()
DIM iCount AS Integer
DIM hTable AS Table
DIM rTest AS result
DIM sql AS String
'define the gridview layout
GridView1.header =
GridView.Horizontal
GridView1.grid = TRUE
GridView1.Rows.count = 0
GridView1.Columns.count = 2
GridView1.Columns[0].text =
"ID"
GridView1.Columns[1].text = "Value"
GridView1.Columns[0].width =
55
GridView1.Columns[1].width = 55
WITH $hConn
.Type = "sqlite"
.host = User.home
.name = ""
END WITH
'delete an existing test.sqlite
IF Exist(User.home &
"/test.sqlite") THEN
KILL User.home & "/test.sqlite"
ENDIF
'create test.sqlite
$hConn.Open
$hConn.Databases.Add("test.sqlite")
$hconn.Close
'define the table sampleTable
$hconn.name = "test.sqlite"
$hConn.Open
hTable = $hConn.Tables.Add("sampleTable")
hTable.Fields.Add("s_seq", db.Integer)
hTable.Fields.Add("s_rndm", db.Integer)
hTable.PrimaryKey = ["s_seq"]
hTable.Update
'fill the table with generated data
$hconn.Begin
rTest = $hConn.Create("sampleTable")
FOR iCount = 1 TO 10000
rTest!s_seq = iCount
rTest!s_rndm = Int(Rnd(0, 100))
rTest.Update
NEXT
$hConn.Commit
'read the database
sql = "select s_seq as ID,
s_rndm as Value from sampleTable"
$res = $hconn.Exec(sql)
CATCH
$hConn.Rollback
Message.Error(DConv(Error.Text))
END
'-------------------------------------------------
PUBLIC SUB Form_Activate()
'change the rowcount of the
gridview from 0 to the number of records.
'This triggers the data
handling event
GridView1.Rows.Count = $res.Count
END
'-------------------------------------------------
PUBLIC SUB GridView1_Data(Row
AS Integer, Column AS Integer)
$res.moveTo(row)
GridView1.Data.text = Str($res[GridView1.Columns[column].text])
END
'-------------------------------------------------
PUBLIC SUB Form_Close()
Quote from Guest on November 14, 2022, 10:41 pmDear,
I came across gambasindia.com and wanted to share this great free AI tool.
With this tool you write content 10 times faster and with much higher conversion rates.
You can use the tool for free via freeaiwriting.comThe AI can write blogs, advertising copy, youtube videos and even entire books.
We would love to hear your feedback.Kind regards,
Bram
Freeaiwriting.com
Dear,
I came across gambasindia.com and wanted to share this great free AI tool.
With this tool you write content 10 times faster and with much higher conversion rates.
You can use the tool for free via freeaiwriting.com
The AI can write blogs, advertising copy, youtube videos and even entire books.
We would love to hear your feedback.
Kind regards,
Bram
Freeaiwriting.com
Quote from Guest on January 9, 2023, 5:44 amDear,
I came across gambasindia.com and wanted to share this great free AI tool.
With this tool you write blogs and ads 10 times faster and with much higher conversion rates.
You can use the tool for free via freeaiwriting.comThe AI can write blogs, advertising copy, youtube videos and even entire books.
We would love to hear your feedback.Kind regards,
Joseph
Freeaiwriting.com
Dear,
I came across gambasindia.com and wanted to share this great free AI tool.
With this tool you write blogs and ads 10 times faster and with much higher conversion rates.
You can use the tool for free via freeaiwriting.com
The AI can write blogs, advertising copy, youtube videos and even entire books.
We would love to hear your feedback.
Kind regards,
Joseph
Freeaiwriting.com
Quote from Guest on January 25, 2023, 11:46 amhelp with coursework
[url="https://brainycoursework.com"]coursework website[/url]
coursework psychology
help with coursework
coursework website
coursework psychology
Quote from Guest on February 17, 2023, 6:47 amI came across gambasindia.com and wanted to share this amazing FREE AI video creator.
This AI tool will turn any text into a compelling video.Increase your reach
freeaivids.com automatically adds captions to your videos, quickly, easily and accurately.
No more expensive outsourcing or wasting hours trying to do it yourself.Sincerly,
Barbera Keller
I came across gambasindia.com and wanted to share this amazing FREE AI video creator.
This AI tool will turn any text into a compelling video.
Increase your reach
freeaivids.com automatically adds captions to your videos, quickly, easily and accurately.
No more expensive outsourcing or wasting hours trying to do it yourself.
Sincerly,
Barbera Keller
Quote from Guest on April 6, 2023, 11:35 amVery good stuff, Thanks!
[url=https://helpwithdissertationwriting.com/]buy dissertations online[/url] dissertation consulting services [url=https://dissertationwritingtops.com/]custom dissertation[/url] law dissertation help
Very good stuff, Thanks!
buy dissertations online dissertation consulting services custom dissertation law dissertation help
Quote from Guest on April 6, 2023, 11:35 amAmazing loads of beneficial info!
what makes a good college essay https://bestmasterthesiswritingservice.com write my essay for cheap https://argumentativethesis.com
Amazing loads of beneficial info!
what makes a good college essay https://bestmasterthesiswritingservice.com write my essay for cheap https://argumentativethesis.com
Quote from Guest on April 6, 2023, 7:43 pmGet ready to take gambasindia.com, your writing and creative abilities to the next level!
We're trilled to offer you 10.000 free words on our advanced Chatgt3 writing tool. (freeaiwriting.com)
With our tool you will create content 10 times faster and with proven formats it's like having a expert on every aspect of writing.
From longform content to conversion driven ad copies. Our clients see an average of 200% increase in their revenue.
And the best part? We've added AI art fo free to our tool.
So why wait? Explore our tool for free at freeaiwriting.com and start exploring the endless possibilities
for growing your businessSincerly,
Barbera Keller
Get ready to take gambasindia.com, your writing and creative abilities to the next level!
We're trilled to offer you 10.000 free words on our advanced Chatgt3 writing tool. (freeaiwriting.com)
With our tool you will create content 10 times faster and with proven formats it's like having a expert on every aspect of writing.
From longform content to conversion driven ad copies. Our clients see an average of 200% increase in their revenue.
And the best part? We've added AI art fo free to our tool.
So why wait? Explore our tool for free at freeaiwriting.com and start exploring the endless possibilities
for growing your business
Sincerly,
Barbera Keller
Quote from Guest on April 7, 2023, 12:41 amFactor well applied.!
buy thesis papers thesis binding service liverpool customer service thesis pdf thesis about food service
Factor well applied.!
buy thesis papers thesis binding service liverpool customer service thesis pdf thesis about food service
Quote from Guest on April 9, 2023, 6:13 pmExcellent facts. Cheers.
a website that writes essays for you someone do my essay for me how i grew as a writer essay
Excellent facts. Cheers.
a website that writes essays for you someone do my essay for me how i grew as a writer essay