Проектирование схемы БД в среде ERwin. Проблема избыточности данных. Проблема обновления данных. Проблема удаления данных., страница 14

checkcommand.Parameters.Add(New Data.OracleClient.OracleParameter("app1", System.Data.DbType.Int32, 10))

checkcommand.Parameters.Add(New Data.OracleClient.OracleParameter("num", System.Data.DbType.Int32, 10))         checkcommand.Parameters("num").Direction = ParameterDirection.Output         checkcommand.Parameters("app1").Value = TextBox3.Text

checkcommand.Connection.Open()

Try

checkcommand.ExecuteNonQuery()

Catch ex As Exception

End Try

'deletecommand.Connection.Close()

If checkcommand.Parameters("num").Value > 0 Then

Dim da As Data.OracleClient.OracleDataAdapter

'   Dim da1 As Data.OracleClient.OracleDataAdapter

Dim sel As String = "select

app.app,app.cdate,app.acc,app.tarifid,app.msysdn,app.stat,tarif.name_tarif,status_app.name_stat from app,tarif,status_app where app.tarifid=tarif.tarifid and app.stat=status_app.stat and msysdn like :param1"

' Dim sel1 As String = "select tarif,name_tarif from tarif"             da = New Data.OracleClient.OracleDataAdapter(sel, con)             'da1 = New Data.OracleClient.OracleDataAdapter(sel1, con)

da.SelectCommand.Parameters.Add(New Data.OracleClient.OracleParameter("param1", System.Data.OracleClient.OracleType.VarChar, 50))

da.SelectCommand.Parameters("param1").Value = TextBox3.Text             ds = New DataSet             da.Fill(ds, "APP")

'da1.Fill(DataSet21, "TARIF")

DropDownList1.DataSource = ds

DropDownList1.DataValueField = "ACC"

DropDownList1.DataTextField = "ACC"

DropDownList1.DataBind()

DropDownList2.DataSource = ds

DropDownList2.DataValueField = "TARIFID"

DropDownList2.DataTextField = "NAME_TARIF"

DropDownList2.DataBind()

DropDownList3.DataSource = ds

DropDownList3.DataValueField = "STAT"

DropDownList3.DataTextField = "NAME_STAT"

DropDownList3.DataBind()

TextBox2.Text = DataBinder.Eval(ds, "Tables[APP].DefaultView.[0].APP")             TextBox2.DataBind()

TextBox4.Text = DataBinder.Eval(ds, "Tables[APP].DefaultView.[0].CDATE")             TextBox4.DataBind()

TextBox1.Text = DataBinder.Eval(ds, "Tables[APP].DefaultView.[0].MSYSDN")             TextBox1.DataBind()

Else

TextBox1.Text = ""

TextBox2.Text = ""

TextBox4.Text = ""

End If

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim tar As String

If TextBox2.Text = "" Then

Response.Redirect("choose_app.aspx")

Else

Button1.Enabled = False

Button2.Enabled = False

Button3.Enabled = False

Button7.Enabled = False

Button4.Enabled = True

Button5.Enabled = True

Button9.Enabled = False

Button10.Enabled = False

Button11.Enabled = False

Button12.Enabled = False             DropDownList2.Enabled = True             tar = DropDownList2.SelectedValue

Dim ds As DataSet

Dim con As Data.OracleClient.OracleConnection

con = New Data.OracleClient.OracleConnection("user id=dev;data source=katestr;password=developer")

Dim da As Data.OracleClient.OracleDataAdapter             Dim sel As String = "select * from tarif"

da = New Data.OracleClient.OracleDataAdapter(sel, con)             ds = New DataSet

da.Fill(ds, "APP")

DropDownList2.DataSource = ds

DropDownList2.DataBind()

DropDownList2.SelectedValue = tar

End If

Return

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

If DropDownList1.Enabled = False Then

Dim ds As DataSet

Dim con As Data.OracleClient.OracleConnection

con = New Data.OracleClient.OracleConnection("user id=dev;data source=katestr;password=developer")

Dim checkcommand As Data.OracleClient.OracleCommand             Dim check As String = "DEV.WEB_UPDATE_APP"             checkcommand = New Data.OracleClient.OracleCommand(check, con)             checkcommand.CommandType = CommandType.StoredProcedure