Results 1 to 1 of 1

Thread: I want to insert module file in specific folder by module categories in VB.net

  1. #1

    Thread Starter
    Registered User
    Join Date
    Aug 2018
    Posts
    1

    I want to insert module file in specific folder by module categories in VB.net

    I want to insert module file in specific folder by module categories in VB.net

    For example:

    If "modul_category" = "OPTO" Then "@modul_filePath" values "notes/OPTO" * from "ModulContents" ElseIf

    Is it correct? Or any suggestions? i want to call specific modules by their module categories only.

    Full coding :

    Protected Sub addSyllabusButton_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles addSyllabusButton.Click
    Dim myConnection As New SqlConnection()
    Dim myCommand As SqlCommand
    Dim str As String
    Dim filepath As String = Server.MapPath("notes/")
    'Dim filepath As String = "C:\Uploads"
    Dim uploadedFiles As HttpFileCollection = Request.Files
    Dim i As Integer = 0

    Using myConnection
    myConnection = New SqlConnection("server=mtmwhs;uid=private;pwd=private;database=elearning")
    'you need to provide password for sql server
    str = "INSERT INTO ModulContents (modul_name,modul_filePath,modul_vidPath,course_name,deptName,modul_status,modul_category,modul_file Name,modul_mediaName) values (@modul_name,@modul_filePath)"

    myCommand = New SqlCommand(str, myConnection)

    myConnection.Open()

    End Using

    myCommand.Parameters.AddWithValue("@modul_filePath", "notes/" & FileUpload1.FileName)
    myCommand.Parameters.AddWithValue("@modul_vidPath", "notes/" & FileUpload2.FileName)
    myCommand.Parameters.AddWithValue("modul_fileName", fileName.Text)
    myCommand.Parameters.AddWithValue("modul_mediaName", mediaName.Text)
    myCommand.ExecuteNonQuery()

    End Sub

    Please help.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width