473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Newbie havng issue with repeater:

9
I have a data access layer called AAEData in namespace mil.dtra.ado:

Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Configuration

Namespace mil.dtra.ado

Public Class AAEData

Public myReader As SqlDataReader
Dim mySqlConnection As SqlConnection
Dim mySqlCommand As SqlCommand

Public Sub Dispose()
If Not (myReader Is Nothing) Then
myReader.Close()
End If
If (mySqlConnection.State = ConnectionState.Open) Then
mySqlConnection.Close()
End If

End Sub

Public Sub New()

End Sub

Public Sub New(ByVal sql As String)
mySqlConnection = New SqlConnection(WebConfigurationManager.ConnectionSt rings("DTRA_AAEConnectionString").ConnectionString )
mySqlCommand = New SqlCommand(sql, mySqlConnection)
mySqlConnection.Open()
myReader = mySqlCommand.ExecuteReader()

End Sub



Public Function getDataView(ByVal sql As String) As DataView

mySqlConnection = New SqlConnection(WebConfigurationManager.ConnectionSt rings("DTRA_AAEConnectionString").ConnectionString )
mySqlCommand = New SqlCommand(sql, mySqlConnection)
Dim mySqlDataAdapter As New SqlDataAdapter(mySqlCommand)
Dim myDataSet As New DataSet

mySqlConnection.Open()
mySqlDataAdapter.Fill(myDataSet)
If myDataSet.Tables(0).Rows.Count = 0 Then
Throw New Exception
End If
Return myDataSet.Tables(0).DefaultView

End Function

End Class

End Namespace

///////////////////////////////////////////////////

In my aspx.vb file I have:

Imports System.Data
Imports System.Data.OleDb
Imports mil.dtra.ado


Partial Class q_list
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not (Page.IsPostBack) Then

Dim objPds As New PagedDataSource()
Dim d As New AAEData()
Dim dv As DataView
Dim curPage As Integer = 1
Dim intCgiStart As Integer = 0
Dim intRefreshField As Integer = 0




dv = d.getDataView("SELECT q_id, question, date_submitted, gif = case cast(ansGIF as nvarchar) when '' then 'q' Else 'qa' end FROM [q_AllView] WHERE ([status] NOT IN ('New','Delete'))) ORDER By [q_id] DESC")

objPds.DataSource = dv
objPds.AllowPaging = True

'litQuestion.Text = dv.Item(0).Item("question")
rid.SelectedValue = intRefreshField
curPage = (intCgiStart / intRefreshField)

objPds.CurrentPageIndex = curPage
objPds.PageSize = intRefreshField

If Not objPds.IsFirstPage Then
Me.hypPrev.Text = "<< PREV" & intRefreshField
' Me.hypPrev.NavigateUrl = "q_list.aspx?q_ID =" & intCgi_qID & "&cgiStart=" & intCgiStart + intRefreshField & "&RefreshField =" & intRefreshField
Else

hypPrev.Visible = False

End If

If Not objPds.IsLastPage Then

Me.hypNext.Text = "Next" & intRefreshField & " >>"
' Me.hypNext.NavigateUrl = "q_list.aspx?q_ID =" & intCgi_qID & "&cgiStart=" & intCgiStart + intRefreshField & "&RefreshField =" & intRefreshField
Else
Me.hypNext.Visible = False
End If
Me.Repeater1.DataSource = objPds
Me.Repeater1.DataBind()
'Title = "Ask an Expert - Recent " & litQuestion.Text & "Questions"
End If
/////////////////////////

Problem is that I keep getting an error from the "mySqlDataAdapter.Fill(myDataSet)" from the mil.dtra.ado file.

Can anyone help?
Feb 14 '07 #1
1 885
kenobewan
4,871 Expert 4TB
What is the error?
Feb 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: labelle | last post by:
I have two divs on an aspx, and each DIV holds a repeater which holds a UserControl. On the left hand side, I have a "feature list" with an "add to cart" button, and on the right hand side, a...
0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
2
by: Martyn Fewtrell | last post by:
I have a repeater that displays records from a database. All fairly straight forward with the repeater binding to a dataset, and a datacommand filling the dataset from the database. The only...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
2
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: ...
2
by: Spotnick | last post by:
I have no idea why, but since I'm trying to recreate my website using ASP.NET 2.0 I've encountered so many performance issues that I'm about to give up and continue using v1.1 Seriously, how can...
1
by: mwhitlatch | last post by:
I have a repeater where the data is filtered by a param in the querystring. In the repeater I have a dropdown that needs to only show the data based upon the filter I set up in the datasource. I have...
4
by: Mick Walker | last post by:
I am using a repeater to display contacts to the user. Here is my repeater: <asp:Repeater ID="RepContacts" runat="server"> <HeaderTemplate><table cellpadding="5" cellspacing="2"> <tr>...
3
by: Queez | last post by:
I have an issue with an ASP repeater which is seriously frustrating me. In simple terms, I have an ASP repeater which is meant to display a list of items for a wedding list, including the name of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.