منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : استفسار :- بخصوص qsl
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله 

يسعد الله اوقاتكم


[attachment=16085]
كيف اعمل نفس الطريقه اللي في الصورة

مثلا قاعدة البيانات فيها خمس ادخالات يعمل لي المربعات من واحد لين خمس 
 Button1.Enabled = True

ومن 6 لين عشرة
  Button1.Enabled = False


واذا الادخالات في قاعدة البيانات مثلا 8

[attachment=16086]
يحدد لي ال 8   Button1.Enabled = True

والتاسع والعاشر 
  Button1.Enabled = False


واذا الادخالات في قاعدة البيانات اكثر من عشر مثلا 20 او 30
[attachment=16087]
يطلع لي العشر مربعات 
 Button1.Enabled = True

اتمنى الفكرة وصلت والسموحه 
بارك الله فيكم وشكرا
PHP كود :
Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

For 
0 To btns.Length 1
    btns
(i).Enabled = (dt.Rows.Count)
Next 
(11-11-17, 08:24 PM)a.ahmed كتب : [ -> ]
PHP كود :
Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

For 
0 To btns.Length 1
    btns
(i).Enabled = (dt.Rows.Count)
Next 

تسلم يا بطل

بارك الله فيك

بس سؤال  بعد اذنك

كيف اربط الكود مع قاعدة البيانات

مثال

كود :
           Dim btns As Button() = {Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9, Button10}

           Dim cntotel As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & contestnyearx & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
           Dim okall As New SQLiteCommand(" SELECT COUNT(id) FROM DBQTC", cntotel)

           cntotel.Open()


           For i = 0 To btns.Length - 1
               btns(i).Enabled = (i < dt.Rows.Count)
           Next


والسموحه ويعطيك العافيه على مجهودك ووقتك
???
(11-11-17, 09:13 PM)dubai.eig كتب : [ -> ]تسلم يا بطل




PHP كود :
          Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

 
          Dim cntotel As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & contestnyearx & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
           Dim okall As New SQLiteCommand(" 
SELECT COUNT(idFROM DBQTC", cntotel)

           cntotel.Open()

           Dim c As Integer = okall.ExecuteScalar()
           For i = 0 To btns.Length - 1
               btns(i).Enabled = (i < c )
           Next 
(11-11-17, 09:34 PM)a.ahme كتب : [ -> ]
PHP كود :
          Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

 
          Dim cntotel As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & contestnyearx & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
           Dim okall As New SQLiteCommand(" 
SELECT COUNT(idFROM DBQTC", cntotel)

           cntotel.Open()

           Dim c As Integer = okall.ExecuteScalar()
           For i = 0 To btns.Length - 1
               btns(i).Enabled = (i < c )
           Next 


تسلم بارك  الله  فيك

دائما تتحفنا بلمساتك الجميله

مبدع يا اخي شكرا شكرا شكرا Rolleyes
PHP كود :
          Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

 
          Dim cntotel As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & contestnyearx & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
           Dim okall As New SQLiteCommand(" 
SELECT COUNT(idFROM DBQTC", cntotel)

           cntotel.Open()

           Dim c As Integer = okall.ExecuteScalar()
           For i = 0 To btns.Length - 1
               btns(i).Enabled = (i < c )
           Next 




السلام عليكم

عندي سؤال 
[attachment=16101]

احاول اسحب بيانات من قاعدة البيانات لاعبي ال TextBox

هذا الكود

كود :
       Dim dr As SQLiteDataReader
       Dim cn As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & opencontest & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
       Dim cmdi As New SQLiteCommand("SELECT * FROM DBQTC ORDER BY id desc limit 2", cn)
       cn.Open()

       dr = cmdi.ExecuteReader()

       While dr.Read()
           TextBox1.Text = dr.Item(9)
           TextBox2.Text = dr.Item(7)
           TextBox3.Text = dr.Item(15)

       End While


ال desc limit 2

ممكن يكون 2 اواكثر مثلا 9
او10 على حسب المربعات

حاولت بس ما ضبط

بحثت في النت كثير ما حصلت الحل
حاولت اغير في الكود 


كود :
      While dr.Read()
           TextBox1.Text = dr.Item(9)
           TextBox2.Text = dr.Item(7)
           TextBox3.Text = dr.Item(15)

           TextBox6.Text = dr.Item(9)
           TextBox5.Text = dr.Item(7)
           TextBox4.Text = dr.Item(15)

       End While


بعد ما ضبط


وشكرا 
(12-11-17, 11:21 PM)dubai.eig كتب : [ -> ]
PHP كود :
          Dim btns As Button() = {Button1Button2Button3Button4Button5Button6Button7Button8Button9Button10}

 
          Dim cntotel As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & contestnyearx & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
           Dim okall As New SQLiteCommand(" 
SELECT COUNT(idFROM DBQTC", cntotel)

           cntotel.Open()

           Dim c As Integer = okall.ExecuteScalar()
           For i = 0 To btns.Length - 1
               btns(i).Enabled = (i < c )
           Next 




السلام عليكم

عندي سؤال 


احاول اسحب بيانات من قاعدة البيانات لاعبي ال TextBox

هذا الكود

كود :
       Dim dr As SQLiteDataReader
       Dim cn As New SQLiteConnection(String.Format("Data Source= {0}\BKHAMLOG\contest\" & strcallbk & "\DB" & opencontest & ".s3db", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)))
       Dim cmdi As New SQLiteCommand("SELECT * FROM DBQTC ORDER BY id desc limit 2", cn)
       cn.Open()

       dr = cmdi.ExecuteReader()

       While dr.Read()
           TextBox1.Text = dr.Item(9)
           TextBox2.Text = dr.Item(7)
           TextBox3.Text = dr.Item(15)

       End While


ال desc limit 2

ممكن يكون 2 اواكثر مثلا 9
او10 على حسب المربعات

حاولت بس ما ضبط

بحثت في النت كثير ما حصلت الحل
حاولت اغير في الكود 


كود :
      While dr.Read()
           TextBox1.Text = dr.Item(9)
           TextBox2.Text = dr.Item(7)
           TextBox3.Text = dr.Item(15)

           TextBox6.Text = dr.Item(9)
           TextBox5.Text = dr.Item(7)
           TextBox4.Text = dr.Item(15)

       End While


بعد ما ضبط


وشكرا 



الحمدالله حصلت الحل 
كود :
  Private ProductList As New List(Of String)


Dim ProductStr As String = "SELECT * FROM DBQTC ORDER BY id desc limit " & IDQTCS & ""
       Dim ProductSql As New SQLiteCommand(ProductStr, ProductConnection)
       Dim ProductDa As New SQLiteDataAdapter(ProductSql)
       Dim ProductDs As New DataSet
       ProductDa.Fill(ProductDs)
       ProductList.Clear()

       For Each dr As DataRow In ProductDs.Tables(0).Rows
           ProductList.Add(dr.Item(9).ToString)
           ProductList.Add(dr.Item(7).ToString)
           ProductList.Add(dr.Item(15).ToString)
       Next

       For i As Integer = 0 To ProductList.Count - 1
           Me.Controls.Find("TextBox" & i + 1, True)(0).Text = ProductList.Item(i)
       Next


شكرا  Rolleyes