Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. radgrid

radgrid

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netdatabasedata-structures
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devsam
    wrote on last edited by
    #1

    hay guys i am still beginner in asp.net whn i tryed this code i got the "index out the bound of array" so plzz help me in this error Dim MyConn As New SqlConnection("Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True") Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load 'Dim conn As String = "Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True" Dim MyAdapter As New SqlDataAdapter MyConn.Open() MyAdapter.SelectCommand = New SqlCommand("Select * from RecCalls", MyConn) Try MyAdapter.Fill(CallDS) Finally MyConn.Close() End Try End Sub Public Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged Dim Ids As String = (RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID")) Dim dr() As DataRow = CallDS.Tables("RecCalls").Select("ID = '" + Ids + "'") If dr.Length > 0 Then lblCallDate.Text = CStr(dr(0)("PCName")) Return Else lblCallDate.Text = [String].Empty End If End Sub

    Developer

    R _ 2 Replies Last reply
    0
    • D devsam

      hay guys i am still beginner in asp.net whn i tryed this code i got the "index out the bound of array" so plzz help me in this error Dim MyConn As New SqlConnection("Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True") Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load 'Dim conn As String = "Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True" Dim MyAdapter As New SqlDataAdapter MyConn.Open() MyAdapter.SelectCommand = New SqlCommand("Select * from RecCalls", MyConn) Try MyAdapter.Fill(CallDS) Finally MyConn.Close() End Try End Sub Public Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged Dim Ids As String = (RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID")) Dim dr() As DataRow = CallDS.Tables("RecCalls").Select("ID = '" + Ids + "'") If dr.Length > 0 Then lblCallDate.Text = CStr(dr(0)("PCName")) Return Else lblCallDate.Text = [String].Empty End If End Sub

      Developer

      R Offline
      R Offline
      RepliCrux
      wrote on last edited by
      #2

      devsam wrote:

      Public Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged Dim Ids As String = (RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID"))

      Your code is going in selected index change before there is any item in the grid. Write a check, something like this: IF NOT RadGrid1.SelectedItems.Count = 0 THEN and then write your code inside this If condition.

      D 1 Reply Last reply
      0
      • D devsam

        hay guys i am still beginner in asp.net whn i tryed this code i got the "index out the bound of array" so plzz help me in this error Dim MyConn As New SqlConnection("Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True") Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load, Me.Load 'Dim conn As String = "Data Source=ASMAA-PC;Initial Catalog=LogFinity;Integrated Security=True" Dim MyAdapter As New SqlDataAdapter MyConn.Open() MyAdapter.SelectCommand = New SqlCommand("Select * from RecCalls", MyConn) Try MyAdapter.Fill(CallDS) Finally MyConn.Close() End Try End Sub Public Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged Dim Ids As String = (RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID")) Dim dr() As DataRow = CallDS.Tables("RecCalls").Select("ID = '" + Ids + "'") If dr.Length > 0 Then lblCallDate.Text = CStr(dr(0)("PCName")) Return Else lblCallDate.Text = [String].Empty End If End Sub

        Developer

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        Don't post the same question multiple times.

        Apurva Kaushal

        1 Reply Last reply
        0
        • R RepliCrux

          devsam wrote:

          Public Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged Dim Ids As String = (RadGrid1.SelectedItems(0).OwnerTableView.DataKeyValues(RadGrid1.SelectedItems(0).ItemIndex)("ID"))

          Your code is going in selected index change before there is any item in the grid. Write a check, something like this: IF NOT RadGrid1.SelectedItems.Count = 0 THEN and then write your code inside this If condition.

          D Offline
          D Offline
          devsam
          wrote on last edited by
          #4

          its not working with me..i got the same error is there another way to do that:sigh:

          Developer

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups