Profil bloqué
-
Modifié par iLAnaStein le 5/03/2012 à 10:21
Bonjour,
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim j As Integer
j = 0
Dim rwh As GridViewRow
rwh = GridView1.HeaderRow
Dim DT As New System.Data.DataTable
Dim req As String
Dim MyConnection As OracleConnection
Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.99.66)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=AGR)));" _
+ "User Id=agresso;Password=agresso;"
MyConnection = New OracleConnection
MyConnection.ConnectionString = oradb
MyConnection.Open()
For Each rw As GridViewRow In GridView1.Rows
'Response.Write(rw.RowIndex)
For j = 1 To rw.Cells.Count - 1
'Response.Write("Site : " & rwh.Cells(j).Text & "|")
'Response.Write("Rayon : " & rw.Cells(0).Text & "|")
'Response.Write("Taux : " & rw.Cells(j).Text & "|")
'Response.Write(rw.Cells(0).Text & "|")
' Response.Write(GridView1.RowHeaderColumn(
'Response.Write(rw.RowIndex)
If rwh.Cells(j).Text.StartsWith("F") Then
Else
req = "update interface.tauxprovtmp set taux=" & rw.Cells(j).Text & " where rayon like '" & rw.Cells(0).Text & "' and site_agresso like '" & rwh.Cells(j).Text & "' and societe='" & Session("client") & "' and type='COOP'"
Dim cmdrayon As New OracleConnection(req, MyConnection)
cmdrayon.ExecuteNonQuery()
cmdrayon.Dispose()
End If
Next
Next
Label1.Visible = True
Label1.Text = "Les Taux COOP ont été intégrés avec succès"
End Sub
Par défaut Problème Dans Ce CODE
Code :
Sélectionner tout - Visualiser dans une fenêtre à part
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim j As Integer
j = 0
Dim rwh As GridViewRow
rwh = GridView1.HeaderRow
Dim DT As New System.Data.DataTable
Dim req As String
Dim MyConnection As OracleConnection
Dim oradb As String = "Data Source=(DESCRIPTION=" _
+ "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.99.66)(PORT=1521)))" _
+ "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=AGR)));" _
+ "User Id=agresso;Password=agresso;"
MyConnection = New OracleConnection
MyConnection.ConnectionString = oradb
MyConnection.Open()
For Each rw As GridViewRow In GridView1.Rows
'Response.Write(rw.RowIndex)
For j = 1 To rw.Cells.Count - 1
'Response.Write("Site : " & rwh.Cells(j).Text & "|")
'Response.Write("Rayon : " & rw.Cells(0).Text & "|")
'Response.Write("Taux : " & rw.Cells(j).Text & "|")
'Response.Write(rw.Cells(0).Text & "|")
' Response.Write(GridView1.RowHeaderColumn(
'Response.Write(rw.RowIndex)
If rwh.Cells(j).Text.StartsWith("F") Then
Else
req = "update interface.tauxprovtmp set taux=" & rw.Cells(j).Text & " where rayon like '" & rw.Cells(0).Text & "' and site_agresso like '" & rwh.Cells(j).Text & "' and societe='" & Session("client") & "' and type='COOP'"
Dim cmdrayon As New OracleConnection(req, MyConnection)
cmdrayon.ExecuteNonQuery()
cmdrayon.Dispose()
End If
Next
Next
Label1.Visible = True
Label1.Text = "Les Taux COOP ont été intégrés avec succès"
End Sub
pour la 1ere erreur ==>Erreur 2 La résolution de surcharge a échoué, car aucun 'New' accessible n'accepte ce nombre d'arguments.
pour la 2eme erreur ==> Erreur 3 'ExecuteNonQuery' n'est pas un membre de 'System.Data.OracleClient.OracleConnection'.