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

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



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



for more understanding
I want to insert module 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_fileName,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





You should consult a SQL tutorial and/or do a web search. Your question is too broad for SO. Questions of the form "I want to do X, tell me how" are not appropriate.
– jmcilhinney
Aug 13 at 3:00





Also, if you're asking how to write SQL code, where's the tag to indicate that the question relates to SQL? You also ought to specify what flavour of SQL because the more complex the query, the more likely it will be different for different data sources.
– jmcilhinney
Aug 13 at 3:02





Is this a SQL question or not? You've now change the title and (I think) question to make no reference to SQL but you still appear to have some SQL syntax in there. The code you have doesn't make sense as VB or SQL and your explanation is far from clear. Try providing a FULL and CLEAR explanation of the problem. Assume that too many words is better than too few. Also, if you're trying to execute SQL code from a VB app then you need to do some research on ADO.NET because there's no indication that you know how it works in what you've posted.
– jmcilhinney
Aug 13 at 3:32





OK, so it seems that you want to execute some SQL code against MySQL from VB. You should start by learning the generalities of doing that and then write some code that actually can affect the database. You can then try to edit that to perform the action you want and, if it doesn't work, you can show us that code. As it stands, you really need to do more research for yourself to make your question more specific.
– jmcilhinney
Aug 13 at 4:01





Tq @jmcilhinney for your comment. Actually I'm a beginner in programming so I still lack of skill. My purpose is to segregate every module by category so that when I view module by category only show module file for each category. But by now, all module were upload in same path. For each module were categorize in module_category in database. How can I do to make it happened? Is it i need to create different path for upload file or can I just call by database? If you want more understanding please refer to for more understanding file and coding file
– airina
Aug 13 at 4:33









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard