Получение ошибок при попытке создать веб-сервис CRUD - PullRequest
0 голосов
/ 30 ноября 2010

Привет, ребята, вот ошибки, которые я получаю:

Value of type 'Integer' cannot be converted to 'music.MusicDataTable'. 
//happens at return deleteSong(...)
Value of type 'Integer' cannot be converted to 'music.MusicDataTable'.
//happens at return insertSong(...)

И вот код, полученный со страницы vb веб-службы, где я получаю сообщение об ошибке:

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class getMusicList
     Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetMusic() As music.MusicDataTable
        Dim music As New musicTableAdapters.MusicTableAdapter
        Return music.GetMusic
    End Function

    Public Function deleteSong(ByVal song_title As String) As music.MusicDataTable
        Dim music As New musicTableAdapters.MusicTableAdapter
        Return music.deleteSong(song_title)
    End Function

    Public Function insertSong(ByVal song_album As String, ByVal song_artist As String, ByVal song_file As String, ByVal song_format As String, ByVal song_size As String, ByVal song_time As String, ByVal song_title As String, ByVal song_track As Integer, ByVal song_year As Integer) As music.MusicDataTable
        Dim music As New musicTableAdapters.MusicTableAdapter
        Return music.insertSong(song_album, song_artist, song_file, song_format, song_size, song_time, song_title, song_track, song_year)
    End Function


End Class

MusicDataTable происходит из набора данных, называемого музыкой.

GetMusic () работает, потому что я ничего не передаю.Я не уверен, почему insertSong и deleteSong не работают.Любая помощь будет оценена.

1 Ответ

1 голос
/ 30 ноября 2010

очевидно music.deleteSong и music.insertSong возврат integer. вы должны изменить тип возвращаемого значения deleteSong и insertSong на целое число, чтобы соответствовать им.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...