I am passing the following code:
Code:
Try
Using connection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=D:\ProjectMW\MachineWale\MachineWale\DatabaseMW.mdf;Integrated Security=True;User Instance=True")
connection.Open()
Using command As New SqlCommand("SELECT * FROM SubPack order by SlNo", connection) '
Using reader As SqlDataReader = command.ExecuteReader()
While reader.Read()
ComboBox1.Items.Add(reader("SlNo") + "-" + reader("Type".ToString) + "-" + reader("Duration".ToString) + "M" + "-" + reader("Machine".ToString))
End While
End Using
End Using
End Using
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Exclamation)
End Try
And i am getting following result:
When i need result as:
I tried TRIM but to no use. Any idea on how to do it?