Click here to Skip to main content
15,913,280 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionChange database file in crystal report Pin
Vincent Khoosiongleng30-Aug-05 20:17
sussVincent Khoosiongleng30-Aug-05 20:17 
AnswerRe: Change database file in crystal report Pin
Mark0631-Aug-05 13:16
Mark0631-Aug-05 13:16 
QuestionDiff between .dll and .exe Pin
Member 223436030-Aug-05 19:37
Member 223436030-Aug-05 19:37 
AnswerRe: Diff between .dll and .exe Pin
rwestgraham30-Aug-05 19:51
rwestgraham30-Aug-05 19:51 
QuestionError while trying to run project Pin
Member 223436030-Aug-05 19:33
Member 223436030-Aug-05 19:33 
AnswerRe: Error while trying to run project Pin
Dave Kreskowiak31-Aug-05 4:34
mveDave Kreskowiak31-Aug-05 4:34 
QuestionDatagrid -Last row always blank for add new record Pin
Member 223436030-Aug-05 19:19
Member 223436030-Aug-05 19:19 
AnswerRe: Datagrid -Last row always blank for add new record Pin
Mandar Patankar31-Aug-05 8:02
Mandar Patankar31-Aug-05 8:02 
what you need to do is add rows dynamically to the table source of the datagrid
for eg:- you have a material table as a datasource to your datagrid.Now you dynamically add rows to this table.The rows added are material detail selected by user.
the user selects specific material from the drop down combobox

here is a sample code snippet


Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
Dim drow As DataRow = material.NewRow

Dim drv As DataRowView = CType(cmbmatnam.SelectedItem, DataRowView)

Try
drow("column1") = drv("mat_id")
drow("Column2") = drv("mat_name")
drow("Column3") = drv("Rate")
drow("Column4") = drv("Quantity")
drow("Column6") = "Enter Quantity"
material.Rows.Add(drow)
material.AcceptChanges()

Catch ex1 As System.NullReferenceException
MessageBox.Show("There are No Materials In this Category")
Catch ex2 As System.Data.ConstraintException
MessageBox.Show("Material Is already Selected")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub

I hope this helps

Mandar Patankar
Microsoft Certified professional
Questiondiplay filename with datatime Pin
ybasha30-Aug-05 19:13
ybasha30-Aug-05 19:13 
AnswerRe: diplay filename with datatime Pin
_mubashir31-Aug-05 2:27
_mubashir31-Aug-05 2:27 
Questiondiplay filename with datatime Pin
ybasha30-Aug-05 19:13
ybasha30-Aug-05 19:13 
Questionwake on lan Pin
dap_qk30-Aug-05 17:28
dap_qk30-Aug-05 17:28 
AnswerRe: wake on lan Pin
Dave Kreskowiak30-Aug-05 18:11
mveDave Kreskowiak30-Aug-05 18:11 
GeneralRe: wake on lan Pin
dap_qk30-Aug-05 18:45
dap_qk30-Aug-05 18:45 
GeneralRe: wake on lan Pin
Dave Kreskowiak31-Aug-05 2:29
mveDave Kreskowiak31-Aug-05 2:29 
GeneralRe: wake on lan Pin
dap_qk31-Aug-05 14:47
dap_qk31-Aug-05 14:47 
QuestionDataSet Relations using Two Fields Pin
asalyon30-Aug-05 14:36
asalyon30-Aug-05 14:36 
QuestionDataSet Editing....... Pin
daviiie30-Aug-05 11:33
daviiie30-Aug-05 11:33 
AnswerRe: DataSet Editing....... Pin
Mark0630-Aug-05 12:07
Mark0630-Aug-05 12:07 
GeneralRe: DataSet Editing....... Pin
daviiie30-Aug-05 12:16
daviiie30-Aug-05 12:16 
GeneralRe: DataSet Editing....... Pin
daviiie30-Aug-05 12:22
daviiie30-Aug-05 12:22 
QuestionMsgBox Buttons in Arabic Pin
padmakumarg30-Aug-05 9:39
padmakumarg30-Aug-05 9:39 
AnswerRe: MsgBox Buttons in Arabic Pin
Dave Kreskowiak30-Aug-05 9:48
mveDave Kreskowiak30-Aug-05 9:48 
AnswerRe: MsgBox Buttons in Arabic Pin
MohammadAmiry30-Aug-05 20:27
MohammadAmiry30-Aug-05 20:27 
GeneralRe: MsgBox Buttons in Arabic Pin
Anonymous31-Aug-05 3:58
Anonymous31-Aug-05 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.