Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to display successful message after i saved and when not able to save an unsuccessful message should display in vb
please help me fast i am nw in vb
Posted
Updated 31-Dec-13 7:13am
v2
Comments
CHill60 31-Dec-13 6:52am    
So what is your problem? Do you not know how to display a message or do you not know how to detect if there was a problem? Use the Improve question link to post the code that you are having a problem with and also include which platform you are using.
Sergey Alexandrovich Kryukov 31-Dec-13 13:15pm    
Not only this is not a question, but discussing the problem makes no sense as you did not specify application type or UI library/framework you want to use.
—SA
shakeer mp 1-Jan-14 23:56pm    
When i insert a data
i want to display a message as
do you want to save
as YES or NO
if i press Yes
i can save otherwise no

Try:
VB
MessageBox.Show("It Worked!")


If you are working with a web site however, try:
VB
Response.Write("<br />It Worked!<br />")
As the first method will only appear to work in development and will fail in production.
 
Share this answer
 
You should write code according to that situation, here a sample. Customize it.
VB
Private Sub SomeMethodorEvent() 
Try  
 If IsDataSaved() Then   'Funtion which saves data   
  lblError.Text = "Data has been saved successfully"  
 Else   
  lblError.Text = "Data not saved"  
 End If 
Catch ex As Exception  
 LogError(ex)  'Some funtion to save actual error details
 lblError.Text = "Data not saved" 
End Try
End Sub
Private Function IsDataSaved() As Boolean 
 'Data saving code
End Function


EDIT
-------------
Check this tutorial
C# MessageBox.Show[^]
 
Share this answer
 
v2
Comments
shakeer mp 2-Jan-14 2:19am    
When i insert a data
i want to display a message as
do you want to save
as YES or NO
if i press Yes
i can save otherwise no

i need like this
when i use messagebuttons it will be saving when i press no
thatraja 2-Jan-14 2:25am    
Check my updated answer

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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