Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
    Public Sub editdetails(intdressid)
        '  Dim gintdressid As Integer
        Dim ds As New DataSet()
        con.ConnectionString = "server=192.168.0.190;uid=sa;pwd=fiessystems;database=adminv2"
        con.Open()
        Dim cmd As SqlCommand = New SqlCommand("Editdetails", con)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Parameters.Add("@dressid", SqlDbType.VarChar).Value = intdressid
        frmDress.txtDressCode.Text = cmd.Parameters("@dresscode").Value.ToString()
        frmDress.txtDressName.Text = cmd.Parameters("@dressname").Value.ToString()
        frmDress.cbogender.Text = cmd.Parameters("@gender").Value.ToString()
        cmd.ExecuteNonQuery()

        con.Close()
end sub
Posted
Updated 1-Aug-14 3:50am
v3
Comments
CHill60 1-Aug-14 10:06am    
What is the problem?

1 solution

Um...no, not like that...in fact, as little like that as it is possible to get...

You can't write code by "finding something that might do a bit of it", chucking it in you code and doing it will magically chnage itself to work.
You have to look at what you are doing, think about it, and come up with code that fits the situation.

You want to read from a database, so starting with something that (presumably) changes database value is not a good place to begin. You can't just say "this is what I want to do", try to get the values, and then ask SQL to fetch them for you.

While it would be pretty simple for me to replace that with code that stands a chance of working, I'm not going to, because I don't think it would help you even slightly in the long term. You need to look back at your notes, or your course and try to learn how to read values from a DB - because if you can't do that pretty much with your eyes shut, the next bit of the course is going to make no sense whatsoever, and it will get even worse from there.

It's your homework: so settle down, learn your course and try doing it yourself. If you get a specific problem then feel free to ask - but just chucking random code in and hoping we will sort it out for you is not a constructive way to pass your course.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900