CREATE PROC [dbo].[INRv2_GetAllSavedJobs] 
AS
    SELECT  plm.jobcode [Job No],si.seminartitle [Seminar Title] 
    FROM (SELECT DISTINCT pm.jobNo jobcode FROM inr_mailinglist pm) plm
    INNER JOIN (SELECT js.jobno, sm.seminartitle 
        FROM inr_seminarmaster sm
        INNER JOIN  inr_jobshedule js
        ON sm.seminarid =js.seminarid) si
    ON plm.jobcode =si.jobno
    ORDER BY plm.jobcode
RETURN




GO

This SP retruns [Job No] rows but when other SP runs to delete and write these table (inr_mailinglist), return 0 rows. I want to force to get [job no] rows return while this table is deleting or writing by job number by other SP. I am a beginner. Please help me.

Can you please explain what you are trying to do, a bit better?
What is the "other SP" doing and how is it connected to this table/SP ?
Why should this SP return any rows when it's the other SP that is deleting rows?

**
*two user log on- no job number list return *- First user on Application replace records in "tableName1" by job number with name (excute SP1) and same time second user on same Application try to get Job number List from same table "tablneName1" (excute SP2) to be able to selectc different job no to get detail list for report, --- the SP2 doesn't bring Job number lists

*only one user log on *- job number list return - When only one user run application store procedure SP2 then job number list return - this works

SP2 = "INRv2_GetAllSavedJobs"

I need to able to get job number list always whether single user or two user

Private Function getSavedJobs()
        Dim cmdSavedJobs As New SqlCommand
        Dim objSqAd As New SqlDataAdapter
        Try
            con = GetConnection()
            dtJobs.Columns.Add("Select", Type.GetType("System.Boolean"))
            dtJobs.Columns("Select").DefaultValue = False
            With cmdSavedJobs
                .Connection = con
                .CommandType = CommandType.StoredProcedure
                .CommandText = "INRv2_GetAllSavedJobs"
            End With
            objSqAd.SelectCommand = cmdSavedJobs
            objSqAd.Fill(dtJobs)

            Dim d(0) As DataColumn
            d(0) = dtJobs.Columns(1)

            dtJobs.PrimaryKey = d
            Dim dr1 As DataRow
            If Not objMergeJob.dtSelJobs Is Nothing Then
                For Each dr As DataRow In objMergeJob.dtSelJobs.Rows
                    dr1 = dtJobs.Rows.Find(dr(1))
                    dr1(0) = True
                Next
                dtArr = dtJobs.Select("Select = True")
            End If
            'objMergeJob.dtSelJobs.Rows.Find
            intRowCount = dtJobs.Rows.Count
            objtableStyle.MappingName = dtJobs.TableName
            fnFormatDataGrid()
            objtableStyle.AllowSorting = False
            dbgJob.TableStyles.Add(objtableStyle)
            dbgJob.DataSource = dtJobs
            dbgJob.Focus()
        Catch ex As Exception
            MessageBox.Show(dtJobs.Rows.Count) '' suk 20121112 wt
            Console.WriteLine(ex.ToString)

            ''MessageBox.Show(ex.ToString)   '' suk 20121112
        End Try
    End Function

**

Could it be that "SP1" is messing up your records?
Please post the "SP1" code

This one solved. I had to insert SQL CommandTimeout on vb.net. Thank you very much and I really appreciate it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.