Click here to Skip to main content
15,898,798 members

Comments by Member 12770648 (Top 37 by date)

Member 12770648 4-Jan-20 3:55am View    
login as sysdba
Member 12770648 7-Nov-19 7:14am View    
USE [WPAY]
GO
/****** Object: StoredProcedure [dbo].[sp_pers_trans] Script Date: 11/03/2019 19:27:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[sp_pers_trans]
(
@BRETURN varchar(20) output
)

AS
Begin
Begin


CREATE TABLE #SearchResults
(
Zidno varchar(50),
Zempno varchar(80),
Zfname varchar(50),
Zlname varchar (50),
Zdeptname varchar (50)
)

Insert Into #SearchResults(Zidno,Zempno,Zfname,Zlname,Zdeptname)
Select IDNO,EMPNO,FNAME,LNAME,DEPTNAME from WHR.dbo.PAYMAST where WHR.dbo.PAYMAST.IDNO not in
(select idno from WPAY.dbo.Paycurrt);



IF EXISTS (SELECT * FROM #SearchResults)
BEGIN
Select Zidno 'IDNO' ,
Zempno 'EMPNO',
Zfname 'FNAME',
Zlname 'LNAME',
Zdeptname 'DEPTNAME'
From #SearchResults ORDER BY Zlname

SELECT @BRETURN = 'FIRST'
END

ELSE


SELECT @BRETURN = 'SECOND'

END

End
Member 12770648 6-Nov-19 12:36pm View    
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
//GRIDVIEW BEGIN

//txtSave.Enabled = false;
try
{
//connection to the database
//
//
string str;
str = ConfigurationManager.ConnectionStrings["WEBPAY"].ConnectionString;
SqlConnection sqlcon = new SqlConnection(str);

string intno;

//Get the intno
intno = GridView1.SelectedRow.Cells[1].Text;

//call the stored procedure
SqlCommand SqlCmd = new SqlCommand("sp_pers_trans", sqlcon);
SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;


//Supply the User_id parameter
// SqlCmd.Parameters.AddWithValue("@BRNNO", intno);

//Create and supply the output parameters

// SqlCmd.Parameters.Add("@BRETURN", System.Data.SqlDbType.VarChar, 12);
// SqlCmd.Parameters["@BRETURN"].Direction = System.Data.ParameterDirection.Output;

//Open the sql data connection
sqlcon.Open();

//Execute the stored procedures
SqlCmd.ExecuteNonQuery();

//Assign the results to the controls


lblstatus.Text = "Grid record successful";

//
//
sqlcon.Close();
}
catch (Exception ex)
{
lblstatus.Text = ex.Message;

}

//GRIDVIEW END
}
Member 12770648 4-Nov-19 15:29pm View    
If this is meant to be a text comparison with the value UNIQ then the clause should be
WHERE Category = 'UNIQ'

Yes Exactly.
Member 12770648 28-Apr-19 9:20am View    
How do you TRIM the fields