تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[كود] ما معنى هذه الرساله
#1
السلام عليكم

في مربع الأخطاء تظهر لي الرسالة التاليه:
Unused local variable: 'cmd'.

ما معناها
الرد }}}
تم الشكر بواسطة:
#2
معناه انه لديك متغير ما ......تم تعريفه و هو غير مستخدم من خلال الكود المكتوب....عموما يمكنك حذفه
الرد }}}
تم الشكر بواسطة: Sajad
#3
بالعكس انا استخدمه وهو معلن عنه
الرد }}}
تم الشكر بواسطة:
#4
ما هو نوع المتغير نصي .. كائن .. رقمي ؟
(وَقُل رَّبِّ زِدْنِي عِلْمًا)

الرد }}}
تم الشكر بواسطة:
#5
هذا هو

Dim cmd As New OleDbCommand
الرد }}}
تم الشكر بواسطة:
#6
ممكن تعرض لنا الكود كاملا ؟
(وَقُل رَّبِّ زِدْنِي عِلْمًا)

الرد }}}
تم الشكر بواسطة:
#7
PHP كود :
Imports System.Data
Imports System
.Data.OleDb
Public Class frmAddNew

    
Public Sub ClearTextBox(ByVal root As Control)
        For 
Each ctrl As Control In root.Controls
            ClearTextBox
(ctrl)
            If 
TypeOf ctrl Is TextBox Then
                CType
(ctrlTextBox).Text String.Empty
            
End If
        
Next (ctrl)
    
End Sub
    
'Private Sub txtcrn_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles txtCRN.KeyPress
    '    
If e.KeyChar ControlChars.Cr Then
    
'        e.Handled = True
    '    
End If

    
'    If Not IsNumeric(e.KeyChar) And Not e.KeyChar = Chr(Keys.Enter) Then
    '        
e.Handled True

    
'        Dim Msg As String = "رقم السجل المدني يجب أن يكون عددا صحيحا"
    '        
MsgBox(MsgvbCritical vbMsgBoxRight vbMsgBoxRtlReading"نظام مواعيد الأعلاف")
    
'        txtCRN.Text = ""
    '        
Exit Sub
    
'    End If

    '    
If e.KeyChar Chr(Keys.Enter) And txtCRN.Text "" Then
    
'        Dim Msg As String = "يجب عليك ادخال السجل المدني"
    '        
MsgBox(MsgvbCritical vbMsgBoxRight vbMsgBoxRtlReading"نظام مواعيد الأعلاف")
    
'        txtCRN.Focus()
    '    
End If
    
'End Sub
    Private Sub btnSaveInfo_Click(sender As Object, e As EventArgs) Handles btnSaveInfo.Click
        ApoSYSconn.Close()
        ApoSYSconn.Open()

        Dim CMD As New OleDb.OleDbCommand("qNewCustomer", ApoSYSconn)
        CMD.CommandType = CommandType.StoredProcedure

        CMD.Parameters.Add(New OleDb.OleDbParameter("@CivilRegNum", txtCRN.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name1", txtName1.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name2", txtName2.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name3", txtName3.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name4", txtName4.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@MobileNum", txtMobileNo.Text))

        CMD.ExecuteNonQuery()

        ApoSYSconn.Close()
        Dim Msg2 As String = "تم حفظ السجل بنجاح"
        MsgBox(Msg2, vbInformation + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
        ClearTextBox(Me)
        txtCRN.Focus()

        Exit Sub
        ClearTextBox(Me)

    End Sub
    Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
        Close()
    End Sub
    Private Sub btnSaveAll_Click(sender As Object, e As EventArgs) Handles btnSaveAll.Click
        If txtCRN.Text = "" Then
            Dim Msg1 As String = "يجب عليك ادخال رقم السجل المدني"
            MsgBox(Msg1, vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
            txtCRN.Focus()
            Exit Sub
        End If
        ApoSYSconn.Close()
        ApoSYSconn.Open()

        Dim CMD As New OleDb.OleDbCommand("qNewCustomer", ApoSYSconn)
        CMD.CommandType = CommandType.StoredProcedure

        CMD.Parameters.Add(New OleDb.OleDbParameter("@CivilRegNum", txtCRN.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name1", txtName1.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name2", txtName2.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name3", txtName3.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@Name4", txtName4.Text))
        CMD.Parameters.Add(New OleDb.OleDbParameter("@MobileNum", txtMobileNo.Text))

        CMD.ExecuteNonQuery()

        Dim CMD1 As New OleDb.OleDbCommand("qNewBarwah", ApoSYSconn)
        CMD1.CommandType = CommandType.StoredProcedure

        CMD1.Parameters.Add(New OleDb.OleDbParameter("@Customer", txtCRN.Text))
        CMD1.Parameters.Add(New OleDb.OleDbParameter("@BarwahNum", txtBarwahNo.Text))
        CMD1.Parameters.Add(New OleDb.OleDbParameter("@Notes", txtNotes.Text))

        CMD1.ExecuteNonQuery()

        Dim CMD2 As New OleDb.OleDbCommand("qNewDate", ApoSYSconn)
        CMD2.CommandType = CommandType.StoredProcedure

        CMD2.Parameters.Add(New OleDb.OleDbParameter("@BawahNum", txtBarwahNo.Text))
        CMD2.Parameters.Add(New OleDb.OleDbParameter("@DateReg", txtDateReg.Text))
        CMD2.Parameters.Add(New OleDb.OleDbParameter("@DateReceipt", txtDateRecipt.Text))

        CMD2.ExecuteNonQuery()

        ApoSYSconn.Close()

        Dim Msg As String = "تم حفظ السجل بنجاح"
        MsgBox(Msg, vbInformation + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
        Exit Sub
        ClearTextBox(Me)

    End Sub
    Private Sub txtCRN_KeyDown(sender As Object, e As KeyEventArgs) Handles txtCRN.KeyDown
        If e.KeyCode = Keys.Enter Then
            '  
SendKeys.Send("{tab}")
            
'e.SuppressKeyPress = True
            txtName1.Focus()
        End If

    End Sub
    Private Sub txtBarwahNo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBarwahNo.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If Not IsNumeric(e.KeyChar) And Not e.KeyChar = Chr(Keys.Enter) Then
            e.Handled = True

            Dim Msg As String = "رقم البروه يجب أن يكون عددا صحيحا"
            MsgBox(Msg, vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
            txtBarwahNo.Text = ""
            Exit Sub
        End If

        If e.KeyChar = Chr(Keys.Enter) And txtBarwahNo.Text = "" Then
            Dim Msg As String = "يجب عليك ادخال رقم البروه"
            MsgBox(Msg, vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
            txtBarwahNo.Focus()
        End If
    End Sub
    Private Sub txtBarwahNo_KeyDown(sender As Object, e As KeyEventArgs) Handles txtBarwahNo.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtDateRecipt.Focus()
        End If
    End Sub
    Private Sub txtName1_KeyDown(sender As Object, e As KeyEventArgs) Handles txtName1.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtName2.Focus()
        End If
    End Sub
    Private Sub txtName2_KeyDown(sender As Object, e As KeyEventArgs) Handles txtName2.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtName3.Focus()
        End If
    End Sub
    Private Sub txtName3_KeyDown(sender As Object, e As KeyEventArgs) Handles txtName3.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtName4.Focus()
        End If
    End Sub
    Private Sub txtName4_KeyDown(sender As Object, e As KeyEventArgs) Handles txtName4.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtMobileNo.Focus()
        End If
    End Sub
    Private Sub txtMobileNo_KeyDown(sender As Object, e As KeyEventArgs) Handles txtMobileNo.KeyDown
        If e.KeyCode = Keys.Enter Then
            txtBarwahNo.Focus()
        End If
    End Sub
    Private Sub btnSaveAll_KeyDown(sender As Object, e As KeyEventArgs) Handles btnSaveAll.KeyDown
        If e.KeyCode = Keys.Enter Then
            btnCancel.Focus()
        End If
    End Sub
    Private Sub frmAddNew_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If txtCRN.Text = "" And txtBarwahNo.Text = "" Then
            btnSaveAll.Enabled = False
        Else
            btnSaveAll.Enabled = True
        End If
        If txtCRN.Text = "" Then
            btnSaveInfo.Enabled = False
        Else
            btnSaveInfo.Enabled = True
        End If
    End Sub
    Private Sub txtName1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtName1.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If IsNumeric(e.KeyChar) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtName2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtName2.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If IsNumeric(e.KeyChar) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtName3_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtName3.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If IsNumeric(e.KeyChar) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtName4_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtName4.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If IsNumeric(e.KeyChar) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtMobileNo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMobileNo.KeyPress
        If e.KeyChar = ControlChars.Cr Then
            e.Handled = True
        End If

        If Not IsNumeric(e.KeyChar) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtCRN_Validated(sender As Object, e As EventArgs) Handles txtCRN.Validated
        If txtCRN.Text = "" Then
            Dim Msg As String = "يجب عليك ادخال السجل المدني"
            MsgBox(Msg, vbCritical + vbMsgBoxRight + vbMsgBoxRtlReading, "نظام مواعيد الأعلاف")
            txtCRN.Focus()
            txtCRN.SelectionStart = 0
            Return
        End If

        '
كود التحقق من المدخل عدد صحيح
        
If IsNumeric(txtCRN.TextThen
            
Exit Sub
        
Else
            
Dim Msg As String "رقم السجل المدني يجب أن يكون عددا صحيحا"
            
MsgBox(MsgvbCritical vbMsgBoxRight vbMsgBoxRtlReading"نظام مواعيد الأعلاف")
            
txtCRN.Text ""
            
txtCRN.Focus()
            
txtCRN.SelectionStart 0
            
Return
            Exit 
Sub
        End 
If

        
Dim cmd As New OleDbCommand
        ApoSYSconn
.Close()
        
cmd.Connection ApoSYSconn
        ApoSYSconn
.Open()
        
cmd.CommandText "Select * from tblCustomers where CivilRegNum=@n"
        
cmd.Parameters.Add("@n"OleDbType.VarChar).Value txtCRN.Text.ToString
        Dim dr 
As OleDbDataReader cmd.ExecuteReader()
        If 
dr.HasRows True Then
            MessageBox
.Show("هذا السجل موجود""تحذير"MessageBoxButtons.OKMessageBoxIcon.Warning)
            
txtCRN.Text ""
            
txtCRN.Focus()
            
txtCRN.SelectionStart 0
            ApoSYSconn
.Close()
        
End If
    
End Sub
    
Private Sub txtBarwahNo_Validated(sender As ObjectAs EventArgsHandles txtBarwahNo.Validated
        Dim cmd 
As New OleDbCommand
        ApoSYSconn
.Close()
        
cmd.Connection ApoSYSconn
        ApoSYSconn
.Open()
        
cmd.CommandText "Select * from tblBarwah where BarwahNum=@n"
        
cmd.Parameters.Add("@n"OleDbType.VarChar).Value txtBarwahNo.Text.ToString

        Dim dr 
As OleDbDataReader cmd.ExecuteReader()
        If 
dr.HasRows True Then
            MessageBox
.Show("هذا السجل موجود""تحذير"MessageBoxButtons.OKMessageBoxIcon.Warning)
            
txtBarwahNo.Text ""
            
txtBarwahNo.Focus()
            
txtBarwahNo.SelectionStart 0
            ApoSYSconn
.Close()

        
End If
    
End Sub
    
Private Sub txtCRN_TextChanged(sender As ObjectAs EventArgsHandles txtCRN.TextChanged
        
If txtCRN.Text "" Then
            btnSaveInfo
.Enabled False
        
Else
            
btnSaveInfo.Enabled True
        End 
If

    
End Sub
    
Private Sub txtBarwahNo_TextChanged(sender As ObjectAs EventArgsHandles txtBarwahNo.TextChanged
        
If txtBarwahNo.Text "" Then
            btnSaveAll
.Enabled False
        
Else
            
btnSaveAll.Enabled True
        End 
If
    
End Sub
    
Private Sub txtDateReg_KeyDown(sender As ObjectAs KeyEventArgs)
        If 
e.KeyCode Keys.Enter Then
            txtDateRecipt
.Focus()
        
End If
    
End Sub
    
Private Sub txtDateRecipt_KeyDown(sender As ObjectAs KeyEventArgs)
        If 
e.KeyCode Keys.Enter Then
            txtNotes
.Focus()
        
End If
    
End Sub
    
Private Sub txtDateRecipt_KeyDown_1(sender As ObjectAs KeyEventArgsHandles txtDateRecipt.KeyDown
        
If e.KeyCode Keys.Enter Then
            txtNotes
.Focus()
        
End If
    
End Sub
    
Private Sub btnSaveInfo_KeyPress(sender As ObjectAs KeyPressEventArgsHandles btnSaveInfo.KeyPress
        
If e.KeyChar ControlChars.Cr Then
            e
.Handled True
        End 
If

    
End Sub
    
Private Sub txtDateReg_KeyPress(sender As ObjectAs KeyPressEventArgsHandles txtDateReg.KeyPress
        
If e.KeyChar ControlChars.Cr Then
            e
.Handled True
        End 
If

    
End Sub
    
Private Sub txtDateRecipt_KeyPress(sender As ObjectAs KeyPressEventArgsHandles txtDateRecipt.KeyPress
        
If e.KeyChar ControlChars.Cr Then
            e
.Handled True
        End 
If
    
End Sub
End 
Class 
الرد }}}
تم الشكر بواسطة:
#8
لا ارى أي سبب في الكود لكي يظهر ذلك الخطأ .. ربما يراه غيري
(وَقُل رَّبِّ زِدْنِي عِلْمًا)

الرد }}}
تم الشكر بواسطة:
#9
وما الحل
المشكله تكمن في هذه الجزئيه
PHP كود :
Dim cmd As New OleDbCommand
        ApoSYSconn
.Close()
        
cmd.Connection ApoSYSconn
        ApoSYSconn
.Open()
        
cmd.CommandText "Select * from tblCustomers where CivilRegNum=@n"
        
cmd.Parameters.Add("@n"OleDbType.VarChar).Value txtCRN.Text.ToString
        Dim dr 
As OleDbDataReader cmd.ExecuteReader()
        If 
dr.HasRows True Then
            MessageBox
.Show("هذا السجل موجود""تحذير"MessageBoxButtons.OKMessageBoxIcon.Warning)
            
txtCRN.Text ""
            
txtCRN.Focus()
            
txtCRN.SelectionStart 0
            ApoSYSconn
.Close() 
هل بالإمكان تعديل الكود
الرد }}}
تم الشكر بواسطة:
#10
PHP كود :
cmd.Connection ApoSYSconn
        ApoSYSconn
.Open()
        
cmd.CommandText "Select * from tblCustomers where CivilRegNum="txtCRN.Text.ToString "
     
        Dim dr As OleDbDataReader = cmd.ExecuteReader()
        If dr.HasRows = True Then
            MessageBox.Show("
هذا السجل موجود", "تحذير", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            txtCRN.Text = ""
            txtCRN.Focus()
            txtCRN.SelectionStart = 0
            ApoSYSconn.Close() 
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [VB.NET] ما معنى هذا التقرير ؟؟ AhmedEissa 0 231 05-11-23, 05:33 PM
آخر رد: AhmedEissa
  [سؤال] ما معنى هذه العبارة (Additional information: Overflow) safralfahd 5 1,178 14-02-22, 02:45 AM
آخر رد: ابراهيم ايبو
  معنى بعض هذه الفنكشن في السيكوال سيرفر لمعرفة عمل كل منها ابراهيم ايبو 8 1,537 13-02-22, 12:18 AM
آخر رد: asmarsou
Question [مساعدة] ... شباب تظهر هي الرساله عندما اقوم ب ربط قاعدة البيانات..؟ Mahmoud41 5 2,099 10-12-20, 02:27 PM
آخر رد: Mahmoud41
  ما معنى تلك الرساله التى تظهر خالد كامل1 7 2,616 06-08-20, 02:29 PM
آخر رد: معاند الحظ
  [VB.NET] لماذا تطلع هذه الرساله is never disposed dubai.eig 3 1,791 03-09-19, 10:42 PM
آخر رد: dubai.eig
  لماضا تظهر لى هذه الرساله خالد كامل1 2 1,548 09-08-19, 03:07 AM
آخر رد: خالد كامل1
  مالفرق بين Class و Module وما معنى الوراثة ! zakaria_farhati 1 1,345 03-07-19, 03:21 PM
آخر رد: اسامه الهرماوي
Photo السلام عليكم ممكن معنى الخطاء ده bdwwsyd 2 1,530 10-06-19, 11:59 PM
آخر رد: sniperjawadino
Information ظهور هذه الرساله عند تشغيل برنامجي...؟ Ahmed-IT 2 1,730 17-10-18, 03:25 AM
آخر رد: عبد العزيز البسكري

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم