表'Orders_Header'中'InvoiceValue'列的值为DBNull。 [英] The value for column 'InvoiceValue' in table 'Orders_Header' is DBNull.

查看:56
本文介绍了表'Orders_Header'中'InvoiceValue'列的值为DBNull。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,伙计们,我试图通过你们所有的步骤让你们了解我正在做的事情并感谢你的帮助。



我有一个按钮导入,当我点击它我从所有关节中获取数据并将其输入数据库,但我不希望成为一个盒子,数据库也没有介绍其他股票交易所介绍的内容。就像那样



 Adapter.Insert(OrderCategory,_ 
SampleOrder,_
Requester,_
ProjectNumber,_
CostCenter,_
PersonInvoiced,_
SampleCategory,_
数量,_
,_
描述,_
RecipientName,_
DesiredDelivery,_
AssemblyPlannedDate,_
Coordonator,_
ShippingMode,_
ShippingAddress ,_
紧急,_
BOM,_
危险,_
运输车,_
SerialComponents,_
PrototypeComponents,_
ReadyAssembly,_
状态)







好​​的,很完美,我的数据库中全部都有价值。

但是当我尝试填充所有值显示该错误的方框时。

好​​的,我有一个编辑表单,我尝试填充所有框和所有DopDownList,但哪里什么都没有(InvoiceValue )我想没有任何价值用于编辑和更新与其他价值。



这是我的代码我填充框。



  Dim  RowID 作为 整数 = 没有 

如果 GridView1.Rows.Count> 0 然后
如果 GridView1 .SelectedValue<> Nothing 然后

RowID = GridView1.SelectedValue

结束 如果
结束 如果

Dim MyAdapter As MV_SamplesOrdersTableAdapters.Orders_HeaderTableAdapter

Dim DT 作为 MV_SamplesOrders.Orders_HeaderDataTable = MyAdapter.GetDataByID(RowID)

如果 DT.Rows.Count> ; 0 然后
BOX_SampleOrder1.Enabled = False

DDL_OrderCategory1.Text = DT( 0 )。OrderType
BOX_SampleOrder1.Text = DT( 0 )。DVMOrderNumber
BOX_Requester1.Text = DT( 0 )。请求者
BOX_ProjectNumber1.Text = DT ( 0 )。ProjectNumber
BOX_PersonInvoiced1.Text = DT( 0 )。CostResponsable
DDL_SampleCategory1.Text = DT( 0 )。SampleOrderType
BOX_Quantity1.Text = DT( 0 ).TotalSamples
BOX_CostCenter1.Text = DT( 0 )。CostCenter

如果 DT( 0 ).InvoiceValue<> Nothing 然后

BOX_SampleInvoice.Text = DT( 0 )。InvoiceValue

结束 如果
BOX_Description1.Text = DT( 0 )。OrderDescription
BOX_RecipientName1.Text = DT( 0 ).FinalCustomerAddress
BOX_DesiredDelivery1.Text = DT( 0 )。TargetDate
BOX_AssemblyPlannedDate1.Text = DT( 0 )。AssemblyPlannedDate
DDL_Coordonator1.Text = DT( 0 )。后勤负债
DDL_ShippingMode1.Text = DT( 0 )。ShippingMode
DDL_Transporter1.Items.Clear()
DDL_Transporter1.Items.Add(DT( 0 )。ExpressShipment)

BOX_ShippingAddress1.Text = DT( 0 )。ShippingAddress
DBL_Urgent1.Text = DT( 0 )。紧急
RBL_Hazardous1.Text = DT( 0 )。HazardousMaterial
RBL_BOM1。 Text = DT( 0 ).HasBOM
RBL_SerialComponents1.Text = DT( 0 )。HasSerialComponents
RBL_PrototypeComponents1.Text = DT( 0 )。PrototypeComponents
RBL_ReadyAssembly1.Text = DT( 0 ).ReadyForAssembly
DDL_Status1.Text = DT( 0 )。状态

结束 如果





这里显示我的错误,我有如果是一个问题。是<>没什么,但我的问题是没有任何东西填充那个盒子或跳这一步。谢谢

解决方案

尝试



 如果 DT( 0 )。InvoiceValue  IsNot  没什么 然后 






Ok,Guys i try to exmplane you all steps for you understand what i`m doing and thanks for help.

I have a button import and when I click on it I get the data from all knuckles and enter them in the database, but nothing I want to be a box and the database does not introduce anything other stock exchange introduces. Like that

Adapter.Insert(OrderCategory, _
                           SampleOrder, _
                            Requester, _
                                ProjectNumber, _
                                 CostCenter, _
                                  PersonInvoiced, _
                                   SampleCategory, _
                                    Quantity, _
                                     Nothing, _
                                      Description, _
                                       RecipientName, _
                                        DesiredDelivery, _
                                         AssemblyPlannedDate, _
                                          Coordonator, _
                                           ShippingMode, _
                                            ShippingAddress, _
                                             Urgent, _
                                              BOM, _
                                               Hazardous, _
                                                Transporter, _
                                                 SerialComponents, _
                                                  PrototypeComponents, _
                                                   ReadyAssembly, _
                                                   Status)




Ok, is perfect, i have all value in my database.
But when i try to fill al boxes with all value display that error.
Ok, i have a edit form where i try to fill all boxes and all DopDownList, but where is nothing (InvoiceValue) i want to put nothing in value for edit and update with another value.

Here is my code where i fill boxes.

 Dim RowID As Integer = Nothing

        If GridView1.Rows.Count > 0 Then
            If GridView1.SelectedValue <> Nothing Then

                RowID = GridView1.SelectedValue

            End If
        End If

        Dim MyAdapter As New MV_SamplesOrdersTableAdapters.Orders_HeaderTableAdapter

        Dim DT As MV_SamplesOrders.Orders_HeaderDataTable = MyAdapter.GetDataByID(RowID)

If DT.Rows.Count > 0 Then
            BOX_SampleOrder1.Enabled = False

            DDL_OrderCategory1.Text = DT(0).OrderType
            BOX_SampleOrder1.Text = DT(0).DVMOrderNumber
            BOX_Requester1.Text = DT(0).Requester
            BOX_ProjectNumber1.Text = DT(0).ProjectNumber
            BOX_PersonInvoiced1.Text = DT(0).CostResponsable
            DDL_SampleCategory1.Text = DT(0).SampleOrderType
            BOX_Quantity1.Text = DT(0).TotalSamples
            BOX_CostCenter1.Text = DT(0).CostCenter

            If DT(0).InvoiceValue <> Nothing Then

                BOX_SampleInvoice.Text = DT(0).InvoiceValue

            End If
            BOX_Description1.Text = DT(0).OrderDescription
            BOX_RecipientName1.Text = DT(0).FinalCustomerAddress
            BOX_DesiredDelivery1.Text = DT(0).TargetDate
            BOX_AssemblyPlannedDate1.Text = DT(0).AssemblyPlannedDate
            DDL_Coordonator1.Text = DT(0).LogisticsResponsable
            DDL_ShippingMode1.Text = DT(0).ShippingMode
            DDL_Transporter1.Items.Clear()
            DDL_Transporter1.Items.Add(DT(0).ExpressShipment)

            BOX_ShippingAddress1.Text = DT(0).ShippingAddress
            DBL_Urgent1.Text = DT(0).Urgent
            RBL_Hazardous1.Text = DT(0).HazardousMaterial
            RBL_BOM1.Text = DT(0).HasBOM
            RBL_SerialComponents1.Text = DT(0).HasSerialComponents
            RBL_PrototypeComponents1.Text = DT(0).PrototypeComponents
            RBL_ReadyAssembly1.Text = DT(0).ReadyForAssembly
            DDL_Status1.Text = DT(0).Status

        End If



Here display my error, where i have "if" is a problem. Is <> Nothing, but my problem is to fill that box with nothing or jump this step. Thanks

解决方案

Try

If DT(0).InvoiceValue IsNot Nothing Then



?


这篇关于表'Orders_Header'中'InvoiceValue'列的值为DBNull。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆