Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

soap exception

Posted on 2009-07-08
4
980 Views
Last Modified: 2013-11-18
i could not see any error :( please help code and error image as seen on below
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim kaydedicim As New Sirket_islemleri.sirket_islemleri
        Dim uyeno As New uye_islemleri.uye_islemleri
        Dim row As TableRow
        Dim cell As TableCell
        Dim hid1, hid2 As HiddenField
        Dim tum_resimler = ""
        Dim n = 0
        For Each row In Table1.Rows
            For Each cell In row.Cells
                If n = 0 Then
                    hid1 = row.FindControl("hidden1_" & Left(cell.ID, Len(cell.ID) - 4))
                    hid2 = row.FindControl("hidden2_" & Left(cell.ID, Len(cell.ID) - 4))
                    If Not (hid2.Value = hid1.Value) And Not (hid1.Value = "") Then
                        If tasi(hid1.Value) Then
                            silici(hid1.Value, hid2.Value)
                        End If
                    ElseIf hid1.Value = "" And Not (hid2.Value = "") Then
                        hid1.Value = hid2.Value
                    End If
                    If Not (hid1.Value = "") Then
                        tum_resimler += hid1.Value & ","
                    End If
                End If
            Next
            If n = 0 Then
                n = 1
            Else
                n = 0
            End If
        Next
        Dim genelislem As New Genel_islemler.Genel_Islemler
        Dim kayit
        If Button1.Text = "Kaydet" Then
            Dim no = uyeno.UyeBilgisiAl(Context.User.Identity.Name, uye_islemleri.Kullanici_bilgisi.kimlik)
            kayit = kaydedicim.kayit_al(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox6.Text, TextBox4.Text, TextBox5.Text, TextBox7.Text, DropDownList2.SelectedItem.Value, DropDownList3.SelectedItem.Value, DropDownList4.SelectedItem.Value, DropDownList5.SelectedItem.Value, TextBox8.Text, DropDownList6.SelectedItem.Value, "", Editor1.Content, TextBox9.Text, no, DropDownList1.SelectedItem.Value)
        Else
            kaydedicim.Guncelle(TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox6.Text, TextBox4.Text, TextBox5.Text, TextBox7.Text, DropDownList2.SelectedItem.Value, DropDownList3.SelectedItem.Value, DropDownList4.SelectedItem.Value, DropDownList5.SelectedItem.Value, TextBox8.Text, DropDownList6.SelectedItem.Value, "", Request.QueryString("no"), Editor1.Content, TextBox9.Text, DropDownList1.SelectedItem.Value)
        End If
        If Not (Request.QueryString("no") = "") Then
            genelislem.resim_sil("sirket", Request.QueryString("no"))
            genelislem.resim_kayit(Request.QueryString("no"), "sirket", Left(tum_resimler, Len(tum_resimler) - 1))
        Else
            genelislem.resim_sil("sirket", kayit)
            genelislem.resim_kayit(kayit, "sirket", Left(tum_resimler, Len(tum_resimler) - 1))
        End If
        Response.Redirect("default.aspx")
    End Sub
 
 
 
 
the code which gives error  from web service :
 
 
 
    <WebMethod()> _
    Function resim_kayit(ByVal bolumno As String, ByVal bolum As String, ByVal bilgi As String)
        Dim connection
        Dim Ar_Bilgi As Array = bilgi.split(",")
        Dim adres = ""
        For i = 0 To Ar_Bilgi.Length
            adres = adres & sql.resimler_ekle.ToString.Replace("bolumno1", "bolumno" & i)
        Next
        connection = ConfigurationSettings.AppSettings("ConnectionString")
        Dim cmd As New MySqlCommand(sql.resimler_ekle, New MySqlConnection(connection))
        cmd.Parameters.Add("?bolumno", bolumno).MySqlDbType = MySqlDbType.VarChar
        cmd.Parameters.Add("?bolum", bolum).MySqlDbType = MySqlDbType.VarChar
        For i = 0 To Ar_Bilgi.Length
            cmd.Parameters.Add("?bolumno" & i, Ar_Bilgi(i)).MySqlDbType = MySqlDbType.Datetime
        Next
        cmd.Connection.Open()
        cmd.ExecuteNonQuery()
        cmd.Connection.Close()
    End Function

Open in new window

hata.jpg
0
Comment
Question by:CahitEy
  • 3
4 Comments
 
LVL 15

Accepted Solution

by:
jinal earned 500 total points
ID: 24810682
Try this.
In WebMethod  i just changes for loop to this For i = 0 To Ar_Bilgi.Length - 1 .
 
 

<WebMethod()> _
    Function resim_kayit(ByVal bolumno As String, ByVal bolum As String, ByVal bilgi As String)
        Dim connection
        Dim Ar_Bilgi As Array = bilgi.split(",")
        Dim adres = ""
        For i = 0 To Ar_Bilgi.Length - 1 
            adres = adres & sql.resimler_ekle.ToString.Replace("bolumno1", "bolumno" & i)
        Next
        connection = ConfigurationSettings.AppSettings("ConnectionString")
        Dim cmd As New MySqlCommand(sql.resimler_ekle, New MySqlConnection(connection))
        cmd.Parameters.Add("?bolumno", bolumno).MySqlDbType = MySqlDbType.VarChar
        cmd.Parameters.Add("?bolum", bolum).MySqlDbType = MySqlDbType.VarChar
        For i = 0 To Ar_Bilgi.Length - 1
            cmd.Parameters.Add("?bolumno" & i, Ar_Bilgi(i)).MySqlDbType = MySqlDbType.Datetime
        Next
        cmd.Connection.Open()
        cmd.ExecuteNonQuery()
        cmd.Connection.Close()
    End Function

Open in new window

0
 
LVL 1

Author Comment

by:CahitEy
ID: 24812556
I tryed it and i tryed it again if i got a mistake but the result is same ::


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
  at System.Array.GetValue(Int32 index)
  at Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetArrayValue(Object[] Indices)
  at Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, ResolutionFailure& Failure)
  at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames)
  at Genel_Islemler.resim_kayit(String bolumno, String bolum, String bilgi)
  --- End of inner exception stack trace ---
0
 
LVL 1

Author Comment

by:CahitEy
ID: 24815265
there were one more array at the bottom i forget it thanks for your answer you were right
0
 
LVL 1

Author Closing Comment

by:CahitEy
ID: 31601417
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question