Pgmer 50 Master Poster Featured Poster

I just gave as example to show Which key is pressed for testing.. You need to take only what u need.

Pgmer 50 Master Poster Featured Poster

Why cant u try like this

Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.F3 Then
            MessageBox.Show(e.KeyCode.ToString)
        Else
            MessageBox.Show(Keys.KeyCode.ToString)
        End If

    End Sub
Pgmer 50 Master Poster Featured Poster

Try application.doevents.. Or Try to use threading or background worker..

Pgmer 50 Master Poster Featured Poster

IsIdentity =true? And identity seed=1? Then if you have any records in table it will be not be -Ve

Pgmer 50 Master Poster Featured Poster

And also use the finally bloack to close ur connection to database or to dispose any objects...

Pgmer 50 Master Poster Featured Poster

listbox1.Items.Add("Item you want to add 1" & vbtab & "Item you want to add 2")

Pgmer 50 Master Poster Featured Poster

conflict in database? Explain in detail about your problem.

Pgmer 50 Master Poster Featured Poster

Post ur complete code... are u trying in datarow view? Cant you get the value to string variable and do indexof(.)?

Pgmer 50 Master Poster Featured Poster

Try setting dataset=nothing or dataset=null. This should work

Pgmer 50 Master Poster Featured Poster

Post your code here or try something like below

Private Sub ListBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedValueChanged
        If ListBox1.SelectedItem.ToString.Length > 0 Then
            Process.Start("explorer.exe", ListBox1.SelectedItem.ToString)
        End If
poojavb commented: Thank u very much +3
Pgmer 50 Master Poster Featured Poster

You are loading the full path of files into list box right? Then in selected index changed event of list box read the file path and load the file using Process.Start("explorer.exe", Filepath)

Pgmer 50 Master Poster Featured Poster

I am able to open all kinds of files using above code, Provided you have the file readers installed in machine..

Pgmer 50 Master Poster Featured Poster

what u mean by Automatically ? There is no any user interface? In which event u want this to happen?

Pgmer 50 Master Poster Featured Poster

Process.Start("explorer.exe", Filepath)

Can you try something like this? filepath is the location of file which u have in listbox..

Pgmer 50 Master Poster Featured Poster

You can read out the file names into listbox but not sure windows app supports file location as hyperlink

Pgmer 50 Master Poster Featured Poster

or else in front end before assigning to grid u can use IIF( function) if ur doing looing. but its nice and good to handle in SQL server.

Pgmer 50 Master Poster Featured Poster

Go to the project properties under that u could see Publish click on it. u could see button called Prereqisites click on it. u can choose the framework from there and see other options as well.

poojavb commented: its helped a lot.... +3
Pgmer 50 Master Poster Featured Poster

I have understood ur problem. It was my suggetion to have published setup files server to so its easy to maintain. However u can add the framework in Prerequisites. So it will check for the framework version and installs.

Pgmer 50 Master Poster Featured Poster

I am not sure how ur Handling application for all clients. If application users are more in number its allways good to publish the application and place in server. However in ur case go to publish wizard select preRequisites and add ur framework so it will get placed in debug folder when u build the ap and it will refer from root path.

Pgmer 50 Master Poster Featured Poster

In designer of the code check for Friend WithEvents dgvData as Datagridview. it should be there if not add. Or if its there then make it public
PUBLIC WithEvents dgvData as Datagridview

Pgmer 50 Master Poster Featured Poster

Are you using any packging tools or ur using Publish wizard in visual studio?.

Pgmer 50 Master Poster Featured Poster

What is ur way of deployement?

Pgmer 50 Master Poster Featured Poster

U can assign shot cut keys to the tabs and use Keys.send event to fire then u can select the tab.

Pgmer 50 Master Poster Featured Poster

No0 need to mention Me.dgvData U can just say dgvData. And moreover what is the problem ur facing?

Pgmer 50 Master Poster Featured Poster

Codeorder Thanks for ur detail code. :)
I just gave code to retrive the cell value of Column status at each row. So docgrid can put his efforts to get complete working code.. :)

Pgmer 50 Master Poster Featured Poster
Dim stringtotest As String = ""
        For i As Integer = 0 To DataGridView1.Rows.Count - 1
            stringtotest = DataGridView1.Item("Status", i).ToString

            MsgBox(stringtotest)

        Next
Pgmer 50 Master Poster Featured Poster

try generating random number in vb.net and use them and make sure its unique all the time..
Declare this at form level

Dim objRandom As New System.Random( _
   CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))
Public Function GetRandomNumber( _
    Optional ByVal Low As Integer = 1, _
    Optional ByVal High As Integer = 100) As Integer
        ' Returns a random number,
        ' between the optional Low and High parameters
        Return objRandom.Next(Low, High + 1)
    End Function
Pgmer 50 Master Poster Featured Poster

Make the primary key in table for Enquiry and order table.with autoincrement as 1. I am not sure how to do this in MS access DB. while showing allways u can append some fixed text and u can save that in another column of table.

Pgmer 50 Master Poster Featured Poster

The new ASP application u designed is having code behind files as vb.net or c#? If vb.net is ur option u need not to convert any code. u can use the code which u wrote for windows app.

Pgmer 50 Master Poster Featured Poster

Is ur class public? formCustomers?
If yes then u should be able to access its behaviours.

Pgmer 50 Master Poster Featured Poster

You need to create object of that form first before accessing its controls.

Pgmer 50 Master Poster Featured Poster

The items in database from where ur getting the list is having primary key associated? Then bind the dataset using Displaymember and valuemebmer first.

Pgmer 50 Master Poster Featured Poster

Then based on the selected item u need to run a query to get the corresponding price and who it on textbox

Pgmer 50 Master Poster Featured Poster

You need to do application.exit() if u want to triminate entire application in the main form close event..

Pgmer 50 Master Poster Featured Poster

Mr Waqas Aslam
I also suggested the same. let him/she try it out.

Pgmer 50 Master Poster Featured Poster

What is difficulty in using the controls? They would have given the help files or vedio with controls. check out those.. And they have forum also check out the forum and discussion board.

Pgmer 50 Master Poster Featured Poster

What is the error message? Why cant u take the Query before running cmd.ExecuteNonQuery() and try to run on SQL server?

Pgmer 50 Master Poster Featured Poster

Syntax for insert into is as below

INSERT INTO TABLENAME(
					COLUMN1,
					COLUMN2,
					COLUMN3,
					)
			 VALUES(VALUE1,
					VALUE12,
					VALUE13,)
Pgmer 50 Master Poster Featured Poster

Whay using AND?

Pgmer 50 Master Poster Featured Poster

Yes oxiegen correct, in web cant use msgbox. U can use alert in javascript.

Pgmer 50 Master Poster Featured Poster
If fileExtension.Equals(".xls") = True Then'some code here else'some code hereend if

what is the problem with this code? you want to make genreal function to check or validate .xls?

Pgmer 50 Master Poster Featured Poster

CodeOrder, Yes we can use that. Thanks :)

Pgmer 50 Master Poster Featured Poster

Yep, I am using fileUpload

Is it web application? Can you please post your code here what you have so far?

Pgmer 50 Master Poster Featured Poster

If ur opening through program then you can try something like this

Private Function isFileExcel(ByVal filename As String) As Boolean
        Try
            Dim fileExtenstion As String = String.Empty
            fileExtenstion = filename.Substring(filename.IndexOf(".", 1))
            Select Case fileExtenstion
                Case ".xlt"
                    Return True
                Case ".xls"
                    Return True
                Case Else
                    Return False

            End Select
        Catch ex As Exception
            Msgbox(ex.Tostring())
            Return false
        End Try
You need to include all the formats of excel in case statement.
Pgmer 50 Master Poster Featured Poster

Why cant you force the user to select only excel file? using fileopen Dialogue?
are you opening the file through program not using fileopen Dialogue?

Pgmer 50 Master Poster Featured Poster

U need to add the required component for crystal reports at client system. So u needs to include them in prerequisites in ur project and why you want to install the SQL at client end? it should be server and ur client should point to server.

Pgmer 50 Master Poster Featured Poster

This is what ur looking at?

Dim sSaveFile As New SaveFileDialog
        With sSaveFile
            .Filter = "Text files(*.txt)|*.txt|All files (*.*)|*.*"
            .FilterIndex = 1
            .Title = "Save as textfile"
        End With
        sSaveFile.ShowDialog()
Pgmer 50 Master Poster Featured Poster

If ur thread is solved then plz mark the thread as solved...

Pgmer 50 Master Poster Featured Poster

See if this helps u...

Try
            Dim starttime As New DateTime
            Dim endtime As New DateTime
            Dim duration As New TimeSpan
            endtime = DateTimePicker2.Text
            starttime = DateTimePicker1.Text
            duration = TimeValue(DateTimePicker2.Text) - TimeValue(DateTimePicker1.Text)
            Dim Dur As Integer = duration.Hours
            Dur = (Dur * 60) / 30

            For i As Integer = 0 To Dur - 1

                cmbTime.Items.Add(starttime.ToString)
                starttime = starttime.AddMinutes(30)
            Next

        Catch ex As Exception

        End Try
Pgmer 50 Master Poster Featured Poster

What is ur sollution ? And if it solved then plz mark the thread as solved..