Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
E

EngrImad

@EngrImad
About
Posts
14
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Update Parent and Child Table
    E EngrImad

    Sorry Confused already delete fronm there

    Visual Basic database sql-server sysadmin help announcement

  • Update Parent and Child Table
    E EngrImad

    Hello every one; the below Code is to update Parent and Child table, the relationship between tables was set to (Relation only) on Data Designer, But on SQL Server, Update and Delete Rule set to (Cascade) with this setup Parent table was Updating ok, but child table return (Added/Modified) changes as nothing and did not get update I tried all cases to Set (Update-Delete-Accept/Reject) relationship Rules On Dataset Designer but did not solve the issue Could advise what to do here thanks in advance

    ParentTableBindingSource.EndEdit
    Dim My_Parent_Modified As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Modified)
    Dim My_Parent_Added As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Added)
    Dim My_Parent_Deleted As DataTable = DataSet1.ParentTable.GetChanges(DataRowState.Deleted)

    If My_Parent_ Modified Is Nothing = False Then
    'Some Coding here
    End if
    If My_Parent_ Added Is Nothing = False Then
    'Some Coding here
    End if
    If My_Parent_Deleted Is Nothing = False Then
    'Some Coding here
    End if
    DataSet1.ParentTable.AcceptChanges

    ChildTableBindingSource.EndEdit
    Dim My_Child_Modified As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Modified)
    Dim My_Child_Added As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Added)
    Dim My_Child_Deleted As DataTable = DataSet1.ChildTable.GetChanges(DataRowState.Deleted)

    If My_Child_ Modified Is Nothing = False Then
    'Some Coding here
    End if
    If My_Child_ Added Is Nothing = False Then
    'Some Coding here
    End if
    If My_Child_Deleted Is Nothing = False Then
    'Some Coding here
    End if
    DataSet1.ChildTable.AcceptChanges

    Imad

    Visual Basic database sql-server sysadmin help announcement

  • Raise Event on another Form
    E EngrImad

    Hello everyone subject is declare event on Form1 , and run that event on Form2 here is the code , but event doesnt work on Form2 !! what is missing here?? many thanks

    Public Class Form1

    Private Sub btnOpenForm2\_Click(sender As Object, e As EventArgs) Handles btnOpenForm2.Click
        Form2.Show()
    End Sub
    
    Public Event show\_My\_Message()
    Private Sub btnShowMessageOnForm2\_Click(sender As Object, e As EventArgs) Handles btnShowMessageOnForm2.Click
        RaiseEvent show\_My\_Message()
    End Sub
    

    End Class

    Public Class Form2

    Public WithEvents My\_Form1 As Form1 = New Form1
    Private Sub Show\_My\_Message\_On\_Form2() Handles My\_Form1.show\_My\_Message
        MsgBox("Hello")
    End Sub
    

    End Class

    Visual Basic question

  • Get Process Percentage
    E EngrImad

    Another Option here we could use "BackgroundWorker" as following:

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    ProgressBar1.Maximum = ???? Here what should put?
    BackgroundWorker1.WorkerReportsProgress = True
    BackgroundWorker1.RunWorkerAsync()
    End Sub

      Private Sub BackgroundWorker1\_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
       
       'We can measure this loop for example
       For t = 0 To myMax
            Label1.Text = t
            BackgroundWorker1.ReportProgress(t)
            Threading.Thread.Sleep(100)
        Next
    
      'But we need to measure process percentage of (My\_Process()) , 
      'No have (t) digital counter to use in (BackgroundWorker1.ReportProgress(t))
      'So what is the solution here???
    
    
    End Sub
    

    Private Sub BackgroundWorker1_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
    Label1.Text = e.ProgressPercentage.ToString() & " %"
    ProgressBar1.Value = e.ProgressPercentage
    ProgressBar1.Refresh()
    End Sub

    Private Sub My_Process()
    ---- Code
    End Sub

    Visual Basic tutorial question

  • Get Process Percentage
    E EngrImad

    Thanks sir for reply other option could we do the following: Private Sub My_Process() Timer1.Start ----Code ----Code Timer1.Stop End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick 'What we should do here to link progress bar to timer in Parallel ??? End Sub mean we shall measure the time for whole process then we need to link that time to ProgressBar to show where we are in process but here also must link the ProgressBar to timer in Parallel May be we can use threading start ProgressBar and TimerTick?? Does that Possible? If so, can show main function or code to achieve that?

    Visual Basic tutorial question

  • Get Process Percentage
    E EngrImad

    Hello How we can get the Percentage of any Process? for example we have the the following: Private Sub My_Process() ----Code ----Code End Sub this My_Process will have a lot of codes and process and may will take a time to finish Is there a way to measure the achievement percent of M_Process while process? thanks regards

    Visual Basic tutorial question

  • DataGridView Multi Layer Header
    E EngrImad

    thanks clear

    Visual Basic csharp tutorial question

  • DataGridView Multi Layer Header
    E EngrImad

    thanks what about if want to attached file?

    Visual Basic csharp tutorial question

  • DataGridView Multi Layer Header
    E EngrImad

    Hello I have Seen this Article: DataGridView – Stacked Header; talk about how to make Multi Layer head for DatagridView it was on C# , I have translated to VB.net but there was some errors, have made it before in VB.net ? I try to attach Source code of VB.net but I have'nt seen attachment option many thanks

    Visual Basic csharp tutorial question

  • How to BitConverter.GetBytes() return 2 digits only
    E EngrImad

    I solved like follows:-

    Dim MyInt As Int16 = 12
    Dim result (0) As Byte
    result (0) = Convert.ToByte(MyInt)
    Console.WriteLine(BitConverter.ToString(result))

    thanks everyone again

    Visual Basic tutorial question

  • How to BitConverter.GetBytes() return 2 digits only
    E EngrImad

    Hello every one simple code as follow

    Dim MyInt As Int16 = 12
    Dim result As Byte() =BitConverter.GetBytes(MyInt)
    Console.WriteLine(BitConverter.ToString(result).Length)
    Console.WriteLine(BitConverter.ToString(result))

    this will return as follow 5 0C-00 Just I want to get 2 0C (length 2 only) and return (0C) only I try to change "MyInt" Declare type from Int16 to all available types but did not work, also i dont need to subtract result as string, i need result as byte() type any advise please ? I am using VS2019 thanks in advance

    Visual Basic tutorial question

  • Saving & Retrieving An Image
    E EngrImad

    I have got same issue exactly, while retrieving image from Database to PitcureBox getting error saying that "Parameters is Not Valid", it is look like there is an issue when save the image and converted to string in DB, hope to have some solutions,

    Visual Basic database sql-server sysadmin help tutorial

  • Save, Retrieve Image on SQL Database using VB.net
    E EngrImad

    Hello; I have image on PictureBox, Cinverted to Base64String string and saved in Database as following: Dim ms As MemoryStream = New MemoryStream Dim bmp As Bitmap = New Bitmap(PictureBox1.Image) bmp.Save(ms, System.Drawing.Imaging.ImageFormat.jpg) Dim My_Photo_Str As String = Convert.ToBase64String(ms.ToArray) myqry = "update MYTABLE set COLUMN1=" & "'" & My_Photo_Str & "'" & "where COLUMN2=" & 50 mycmd = New OleDbCommand(myqry, conn) mycmd.CommandTimeout = 0 mydr = mycmd.ExecuteReader Now that image need to retrieve it or shows on PictureBox, So I used the following:- myqry = "select * from MYTABLE where COLUMN2=" & 50 mycmd = New OleDbCommand(myqry, conn) mycmd.CommandTimeout = 0 mydr = mycmd.ExecuteReader mydr.Read() Dim PIC As Byte() PIC = mydr("COLUMN1") Dim My_Photo = New MemoryStream(PIC) PictureBox1.Image = Bitmap.FromStream(My_Photo) <<<<<-----HERE GOT ERROR the error on last line while try to set image to PictureBox, and error said that cannot convert Byte() to image, If any help will so appreciated thanks

    Visual Basic database graphics help csharp

  • Fill Data of Parents and multi levels of Child tables only
    E EngrImad

    I would like to know how to fill the Parent table and multi different levels of child tables with data, mean the child tables will be filled with data relate to that Parent table only.. Example: Level 1 : GRANDFATHER table - Can be fill using Data Adapter Like: (DataAdapter.Fill(DataSet.DataTable,GRANDFATHER-ID) - {(GRANDFATHER-ID is Primary Key)} here i select specific record and fill and everything good Level 2 : Father table - Can be fill using Data Adapter Like:(DataAdapter.Fill(DataSet.DataTable, MYGRANDFATHER-ID) - {(MYGRANDFATHER-ID is Foreign Key)} mean here i can fill level 2 of child table because it is link to one record only from Parent table so I fill all fathers and one Grandfather, and still everything is good Level 3 : Kids table - Here we face problem!! , How to Fill Data Adapter using multi Fathers ID?? mean i want to fill all kids under multi fathers related to that Parent table of one GRANDFATHER only.. I don not like to fill all Kids Data under all Fathers and All Grandfathers, hopefully i found solution and clear what I mean...

    Visual Basic tutorial help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups