لا أدري ما الأمر .. لقد هذا الكود يشتغل معي %100 ويحفظ جميع البيانات .. والآن لايحفظ شيء ولا يعطيني أي رسالة خطأ .. الحقيقة .. أكاد أجن
وهذا هو كود insetr
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim InsertCommand As SqlCommand = New SqlCommand
cn.Open()
InsertCommand.Connection = cn
InsertCommand.CommandText = "INSERT INTO phone([namee], [nophone], [nomobile], [city])VALUES(@namee, @nophone, @nomobile, @city)"
With InsertCommand.Parameters
.Clear()
.AddWithValue("@namee", txtName.Text.Trim())
.AddWithValue("@nophone", txtNO.Text.Trim())
.AddWithValue("@nomobile", txtMobile.Text)
.AddWithValue("@city", txtCity.Text)
End With
InsertCommand.ExecuteNonQuery()
cn.Close()
InsertCommand.Dispose()
InsertCommand = Nothing
Catch EE As Exception
Response.Write(EE.Message)
Response.End()
End Try
txtName.Text = ""
txtNO.Text = ""
txtMobile.Text = ""
txtCity.Text = ""
End Subأرجو المساعدة
