VirusSpore Posted June 25, 2004 Posted June 25, 2004 Hi all, i'm currently coding a project in VS.NET 2002 ... It is a web application and involves some DB queries. The error i have is this : "Compiler Error Message: BC30456: 'getReportYear' is not a member of 'TaServiceRpt.localhost7.TaEditGetReportId'. " however, i've already defined 'getReportYear' as a <WebMethod()> Public Function in the TaEditGetReportId.asmx.vb page. Can anyone help me out here ? Cheers! Quote
Administrators PlausiblyDamp Posted June 25, 2004 Administrators Posted June 25, 2004 Have you recently added this webmethod to the service? If so you may need to refresh the client proxy for the web service: Under solution explorer, web references - right click on the web reference in question and select update, then try a rebuild. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VirusSpore Posted June 28, 2004 Author Posted June 28, 2004 Corr, thanks !! I think it solved the problem, coz now the error's different .. lol anyway, thanks again. Cheers ! Quote
VirusSpore Posted June 28, 2004 Author Posted June 28, 2004 Hi I've got another problem ... System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IndexOutOfRangeException: inYearRT at System.Data.Common.FieldNameLookup.GetOrdinal(String fieldName) at System.Data.OleDb.OleDbDataReader.GetOrdinal(String name) at System.Data.OleDb.OleDbDataReader.get_Item(String name) at TaServiceRpt.TaEditGetReportId.getReportYear(String UserName) in D:\Inetpub\wwwroot\...\TaEditGetReportId.asmx.vb:line 263 can anybody make any sense outta this ? I think its related to my SQL statement, but i cant seem to be able to find out what's wrong ... Can anyone enlighten me ? Thanks ! Quote
Administrators PlausiblyDamp Posted June 29, 2004 Administrators Posted June 29, 2004 Could you post the SQL statement and also the table definition? It looks like you are trying to reference a column in the datareader that doesn't exist (possible typo?). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VirusSpore Posted June 30, 2004 Author Posted June 30, 2004 Here here's the Public Function, in the .asmx page, the one that i'm trying to call ... The statement might be wrong, as i hvn't been able to view the results but i think it should more or less be correct ... <WebMethod()> Public Function getReportYear(ByVal UserName As String) As _ArrayList Dim conn As New OleDbConnection(ConfigurationSettings.AppSettings("ConnectionString")) Dim dtrReader As OleDbDataReader Dim cmdGetReportYear As OleDbCommand Dim strSql As String Dim arrReportYear As New ArrayList() strSql = "SELECT intYearRT FROM tblReportRT " & _ "WHERE strReportByRT ='" & UserName & "' AND strStatusRT = 'Submit'" '"ORDER BY intYearRT " cmdGetReportYear = New OleDbCommand(strSql, conn) conn.Open() dtrReader = cmdGetReportYear.ExecuteReader While dtrReader.Read arrReportYear.Add(dtrReader("inYearRT")) End While conn.Close() dtrReader.Close() Return arrReportYear End Function and here's the table definition ( tblReportRT )... its an MS Access DB and the Primary Key is intReportIdRT ... intReportIdRt ( AutoNumber), strReportByRT ( Text ), strSchoolNameRT( Text ), strVerifiedRT(Text), strActionRT(Text), strOutStandingRT(Memo), strDateRT(Text), intWeek(Number), intMonthRT(Number), intSchLevelRT(Number), strStatusRT(Text), intYearRT(Number) ... Quote
Administrators PlausiblyDamp Posted June 30, 2004 Administrators Posted June 30, 2004 You'll kick yourself - looks like a typo: In the SELECT you have a field intYearRT but in the datareader code you refer to it as inYearRT (missing a 't') Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VirusSpore Posted July 1, 2004 Author Posted July 1, 2004 . . . . . . I am really red now ... Shheesssshhhhh ..... Er, thanks again ... i learn a new thing everyday ... lol Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.