473,466 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save data from grid in a database table

17 New Member
Friends,

Five rows available in a grid. I want to save these rows in a database in five records. Make this saving with single click (command button). Anybody help me.

Thanks!
Suresh
Jun 11 '07 #1
4 1898
vagaisuresh
17 New Member
dear friends

anybody help me?

suresh
Jun 25 '07 #2
maaaryam
3 New Member
dear friends

anybody help me?

suresh
hi suresh,
chk this...
define Connection string Name
define Recordset Name
on command button clik event
set connection string
open a record set to a database Table
recordsetName.addnew (Mode)

recordsetName.field(1)=msflexgrid.textmatrix(rowNo ,ColNo)
recordsetName.field(2)=msflexgrid.textmatrix(rowNo ,ColNo)
recordset.updateBatch
upto 5 records
Jun 27 '07 #3
vagaisuresh
17 New Member
hi suresh,
chk this...
define Connection string Name
define Recordset Name
on command button clik event
set connection string
open a record set to a database Table
recordsetName.addnew (Mode)

recordsetName.field(1)=msflexgrid.textmatrix(rowNo ,ColNo)
recordsetName.field(2)=msflexgrid.textmatrix(rowNo ,ColNo)
recordset.updateBatch
upto 5 records
Friend,

Thanks for the same. Can you please give me a example code?

Thanks!
Suresh
Jul 16 '07 #4
shaileshb
27 New Member
hi

pls chk this

dim rs as new adodb.recordset
dim mRow as integer
rs.open "Select * From Categories", con, adOpenDynamic, adLockOptimistic

'suppose u r using MSHFlexGrid1 Grid Control having 4 columns

With MSHFlexGrid1
For mRow = 1 To .Rows - 1
rs.AddNew
Rs.Fields(0).Value = .TextMatrix(mRow,0)
Rs.Fields(1).Value = .TextMatrix(mRow,1)
Rs.Fields(2).Value = .TextMatrix(mRow,2)
Rs.Fields(3).Value = .TextMatrix(mRow,3)
rs.Update
Next mRow
End With

set rs = nothing
Jul 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike N. | last post by:
Hello to all: First let me apologize for the length of this question, I've made an attempt to include as much information as is needed to help with the question. I am having problems putting...
3
by: Snake | last post by:
I have a vb .net program which fills a data grid upon form load from an acccess database. This works great. Now, I have to add a combo box and use it to alter the underlying sql statement and...
1
by: Sunny | last post by:
Hi, I am using Databases in my applications, i have a table with an average of 3.5 million records, i am trying to show the search results in a DataGrid from that table, but the results take a very...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
5
by: Brian P. Hammer | last post by:
I have data from multiple SQL tables, some of the tables will only have one row, while others multiple rows. I load a bunch of data from the various tables and add them to a third party grid. With...
4
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new...
9
by: Dadio | last post by:
Hi! I have to take some strings from a file and put them in a record... The various strings in the file are written on this way: string1|string2|string3|string4|string5| This is the program...
4
by: Mike | last post by:
I encountered this problem for the first time today while trying to add some columns to a query from a linked DBASEIII file. The new columns that I added on the design grid do not show up on the...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.