i am a beginner, i don't how to give command
how to display a msgbox that " ID already exist " for a given textbox
should i use getfocus if so how????? or is there another way???????/
|
Go4Expert Member
|
|
| 24Feb2011,00:02 | #2 |
|
[quote=ranchani;79805]i am a beginner, i don't how to give command
how to display a msgbox that " ID already exist " for a given textbox should i use getfocus if so how????? or is there another way??????? in vb |
|
Invasive contributor
|
![]() |
| 24Feb2011,11:22 | #3 |
|
1. Please try and edit your previous post rather than...Just posting a new one..
2. use the quote tags properly.. 3. Please clear you question...You want a alert box or a simple error text... |
|
Go4Expert Member
|
|
| 24Feb2011,20:04 | #4 |
|
Invasive contributor
|
![]() |
| 24Feb2011,20:56 | #5 |
|
Go4Expert Member
|
|
| 25Feb2011,20:38 | #6 |
|
no i want only in vb
|
|
Contributor
|
|
| 26Feb2011,17:48 | #7 |
|
Hi,
You can use MsgBox function,have you tried that ?
shabbir
like this
|
|
Go4Expert Member
|
|
| 26Feb2011,21:14 | #8 |
|
yeah but i not sure where to give the statement and i hav tried everything
|
|
Contributor
|
|
| 26Feb2011,21:43 | #9 |
|
Quote:
Originally Posted by ranchani Sorry to say, if you had tried everything you would have solved that problem.I do'nt think that you have tried everything. |
|
Go4Expert Member
|
|
| 27Feb2011,00:17 | #10 |
|
Code:
Imports System.Data
Imports System.Data.OleDb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack = True Then
Reset()
End If
End Sub
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
Dim con As New OleDbConnection
Dim com As New OleDbCommand
Dim sqlString, STID, STNAME, AGE, ADMNO, FNAME, MNAME, BATCH, ADDRESS, PHNO, MOBNO, EMAIL As String
STID = TextBox1.Text
STNAME = TextBox2.Text
AGE = TextBox3.Text
ADMNO = TextBox4.Text
FNAME = TextBox5.Text
MNAME = TextBox6.Text
BATCH = TextBox7.Text
ADDRESS = TextBox8.Text
PHNO = TextBox9.Text
MOBNO = TextBox10.Text
EMAIL = TextBox13.Text
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Varsha\My music\Visual Studio 2005\WebSites\PSA\App_Data\student.mdb")
con.Open()
sqlString = "insert into Table1 values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox13.Text & "')"
com = New OleDbCommand(sqlString, con)
com.ExecuteNonQuery()
MsgBox("Data is successfully entered")
con.Close()
End Sub
|


