Click here to Skip to main content
15,903,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
pls send code for how to add data filled in the textboxes to the dbgrid
Posted
Comments
Aniket Yadav 11-Feb-12 4:20am    
Will you please tell me the structure of your grid
Bhags1992 11-Feb-12 8:29am    
the first field is accessories_id,second is acc_name,3rd field is cost which is in label format

1 solution

If You Provide The Exact Grid Structure Then I would Have Given U The clue but for now
Try This
VB
dbgrid.Rows = dbgrid.Rows + 1
dbgrid.TextMatrix(0, 0) = Trim(txtText1.Text)
dbgrid.TextMatrix(0, 1) = Trim(txtText2.Text)
dbgrid.TextMatrix(0, 2) = Trim(txtText3.Text)
 
Share this answer
 
Comments
Bhags1992 11-Feb-12 4:43am    
im creating project on catering mgmt in that whichever food i choice from list or textbox that i have to show is in the dbgrid
Aniket Yadav 11-Feb-12 4:45am    
can you post a sample code of it? so that i can study and give a solution
Bhags1992 11-Feb-12 8:24am    
i m not made any code for it
Bhags1992 11-Feb-12 9:56am    
but i m geting error subscript out of range on this line dbgrid.TextMatrix(0, 2) = Trim(txtText3.Text)
Aniket Yadav 11-Feb-12 23:48pm    
In the dbgrid.TextMatrix(0,2): 0 is the 0th Row and 2 is the 2nd Column.
So if you have only one column then just do the following.
dbgrid.TextMatrix(0,1) = Trim(txtText1.Text)
dbgrid.TextMatrix(1,1) = Trim(txtText2.Text)
dbgrid.TextMatrix(2,1) = Trim(txtText3.Text) And So on

Hope This Will Solve Ur Problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900