تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مساعدة عملت برنامج للتعلم وعملت لة سيتب كل الامور تماام لكن اليوزر والباسوورد غير موج
#16
عدل في الملف

AddUserNameFirstLogin\AddUserNameFirstLogin\My Project\Application.Designer.vb

بوضع الشرط التالي :

كود :
       Protected Overrides Sub OnCreateMainForm()
           Dim DT As New DataTable
           DT.Clear()
           ConnectionSql("(Local)", "Company_2018", "Select * From users", DT)
           If DT.Rows.Count = 0 Then
               Me.MainForm = AddUserName
           Else
               Me.MainForm = LoginForm
           End If
       End Sub
بالنسبة لكود الاتصال : ConnectionSql في مديول ConnectionStringMD

كود :
Module ConnectionStringMD
   Public Sub ConnectionSql(SqlServerName As String, DbName As String, SqlQuery As String, DTable As DataTable)
       Dim conn As New SqlClient.SqlConnection("Data Source=" & SqlServerName & ";Initial Catalog=" & DbName & ";Integrated Security=True")
       If conn.State = ConnectionState.Closed Then conn.Open()
       Dim DA As New SqlClient.SqlDataAdapter(SqlQuery, conn)
       DTable.Clear()
       DA.Fill(DTable)
       If conn.State = ConnectionState.Open Then conn.Close()
   End Sub
End Module


الملفات المرفقة
.zip   AddUserNameFirstLogin.zip (الحجم : 174.84 ك ب / التحميلات : 22)
الرد }}}
تم الشكر بواسطة: essawq , essawq , elgokr , عبد العزيز البسكري


الردود في هذا الموضوع
RE: مساعدة عملت برنامج للتعلم - بواسطة asemshahen5 - 05-09-18, 06:38 PM


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


يقوم بقرائة الموضوع: