filmov
tv
Complete CRUD Operation in Asp Net using VB With SQL Server Step by Step | ProgrammingGeek
Показать описание
How to Perform CRUD Operation in VB.Net With SQL Windows Form
#CompleteCRUDOperationInAspNetUsingVBWithSQL #CRUDAspNetVBWithSQL #InsertDeleteUpdateSearchInVB #crud #aspnet #sql #crudsql #sqlcrud #vbnet
Just follow these steps-
1. Create a new Asp.Net project.
2. Design the project with Label, TextBox, DropdownList, radiobuttonlist, checkbox and button control.
3. Create database and table in SQL Server.
4. Connect sql server with visual studio.
5. Write code to execute CRUD operation Insert, Delete, Update and Search.
Prerequisites.
You should have installed SQL server and visual studio. you can use SQL server integrated with visual studio instead of SQL Server management studio.
This tutorial also covered-
2. Creating SQL server database and table in SQL server.
4. Calling method in button click_event.
5. Using method in page_load event.
6. Place connectionSting out of event.
7. Initializing connectionSting in all event.
8. How to load data in GridView.
9. How to get data from SQL server database to textBox and dropdownList.
Code sample-
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim productid As Integer = txtproductID.Text
Dim itemname As String = txtitemname.Text
Dim specification As String = txtspecification.Text
Dim unit As String = Dropunit.SelectedValue
Dim color As String = Radiocolor.SelectedValue
Dim insertdate As DateTime = txtdate.Text
Dim opening As Double = txtopeningqty.Text
Dim status As String = ""
If Checkregular.Checked = True Then
status = "Regular"
Else
status = "Irregular"
End If
connect.Open()
Dim command As New SqlCommand("Insert into ProductInfo_Tab values ('" & productid & "','" & itemname & "','" & specification & "','" & unit & "','" & color & "','" & insertdate & "','" & opening & "','" & status & "')", connect)
command.ExecuteNonQuery()
MsgBox("Successfully Inserted", MsgBoxStyle.Information, "Message")
connect.Close()
ListProduct()
End Sub
Private Sub ListProduct()
Dim command As New SqlCommand("select * from ProductInfo_Tab", connect)
Dim sd As New SqlDataAdapter(command)
Dim dt As New DataTable
sd.Fill(dt)
GridView1.DataSource = dt
GridView1.DataBind()
End Sub
------
This channel covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, please subscribe and keep in touch.
Visit my page in Facebook
------
Комментарии