我如何更改但发生许多错误的C#中如何更改它 [英] How Can Change It In C# I Changed But Many Error Occurs

查看:81
本文介绍了我如何更改但发生许多错误的C#中如何更改它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub AddStocksInUpdating()
        If txtItemNo.Text = "" Then
            MsgBox("Please select item to add stocks.", MsgBoxStyle.Critical, "Select Item")
            Exit Sub
        End If
        Dim strStocksIn As String

        strStocksIn = InputBox("Enter number of items : ", "Stocks In")
        txtQuantity.Text = Val(txtQuantity.Text) + Val(strStocksIn)
        Try
            sqL = "INSERT INTO StocksIn(ItemNo, ItemQuantity, SIDate, CurrentStocks) VALUES('" & txtItemNo.Text & "', '" & strStocksIn & "', '" & Format(Date.Now, "Short Date") & "', " & txtQuantity.Text & ")"
            ConnDB()
            cmd = New OleDbCommand(sqL, conn)
            Dim i As Integer

            i = cmd.ExecuteNonQuery()
            If i > 0 Then
                MsgBox("Stocks added successfully", MsgBoxStyle.Information, "Stocks In")
                Updateproduct()
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            cmd.Dispose()
            conn.Close()
        End Try
    End Sub

推荐答案

不是C#,而是VB.
它不会编译为C#,甚至不会编译.
但是...您可以通过以下方式运行它: http://www.developerfusion.com/tools/convert/vb-to-csharp/ [ ^ ]-这是一个在线代码转换器,大部分情况下都做得很好...
That isn''t C# - it VB.
It won''t compile as C#, or even close.
But...you could run it through this: http://www.developerfusion.com/tools/convert/vb-to-csharp/[^] - it''s an online code translater that mostly does a pretty good job...


这篇关于我如何更改但发生许多错误的C#中如何更改它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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