Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 我得到了一个“答案”;无法识别的Guid格式“;错误消息_Database_Vb.net_Function_Combobox - Fatal编程技术网

Database 我得到了一个“答案”;无法识别的Guid格式“;错误消息

Database 我得到了一个“答案”;无法识别的Guid格式“;错误消息,database,vb.net,function,combobox,Database,Vb.net,Function,Combobox,Guid构造函数的字符串格式必须为以下格式之一() dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd -或- dddddddd-dddd-dddddd-dddddd-dddddddddd -或- {dddddddd-dddd-dddddd-dddddd-dddddddddddd} -

Guid构造函数的字符串格式必须为以下格式之一()

dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

-或-

dddddddd-dddd-dddddd-dddddd-dddddddddd

-或-

{dddddddd-dddd-dddddd-dddddd-dddddddddddd}

-或-

(dddddddd-dddd-dddddd-dddddd-dddddddddd)

-或-

{0xdddd,0xdddd,0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}

确保从组合框中获取的值采用以下格式之一

Public Function GetPrinter(ByVal PrinterID As Guid) As DataSet
    Try
        GetPrinter = New DataSet
        MyBase.SQL = "SelectPrinter"
        //Initialize the Command object
        MyBase.InitializeCommand()
        //Add the Parameter to the Parameters collection
        MyBase.AddParameter("@PrinterID", _
            SqlDbType.UniqueIdentifier, 16, PrinterID)
        //Fill the DataSet
        MyBase.FillDataSet(GetPrinter, "Printers")
    Catch ExceptionErr As Exception
        Throw New System.Exception(ExceptionErr.Message, _
            ExceptionErr.InnerException)
    End Try
End Function


Public Function GetPrinter(ByVal PrinterID As Guid) As DataSet
    Try
        //Call the data component to get a specific Printer
        GetPrinter = objPrinterDA.GetPrinter(PrinterID)
    Catch ExceptionErr As Exception
        Throw New System.Exception(ExceptionErr.Message, _
            ExceptionErr.InnerException)
    End Try
End Function


Private Sub cboCodeLevelPrinters_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboCodeLevelPrinters.SelectedIndexChanged
    //Initialize a new instance of the business logic component
    Using objPrinters As New CodeLevelsBusinessLogic.PrintersBL( _
        strCompany, strApplication)
        Try

 //The next line of code throws a "Unrecognozed Guid Format" error message.
            //Get the specific Printer selected in the cboCodeLevelPrinters combobox
            objDataSet = objPrinters.GetPrinter( _
                New Guid(cboCodeLevelPrinters.SelectedText.ToString.ToUpper))
 //End error line

            //Populate the CodeLevels Location & IPAddress textbox's
            txtCodeLevelLocation.Text = ( _
                objDataSet.Tables("Printers").Rows(0).Item("PrinterLocation"))
            txtCodeLevelIPAddress.Text = ( _
                objDataSet.Tables("Printers").Rows(0).Item("PrinterIPAddress"))
        Catch ExceptionErr As Exception
            MessageBox.Show(ExceptionErr.Message, strAppTitle)
        End Try
    End Using
End Sub