Monday, March 26, 2012

no date retrun

hi all i have question about this procedure

when i write this the data return this is nice ok

USE [DigitalFirm]

GO

/****** Object: StoredProcedure [dbo].[SearchTaskName] Script Date: 05/31/2007 21:44:47 ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERProcedure [dbo].[SearchTaskName]

(

@.TaskNamevarchar(50)

)

as

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdate

from Assign_Task a,Task_Emp te,Personal p,Employee e

where te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskName=@.TaskName

and when i write this procedure in Sql server 2005

the i can show data and it is right and work

then when i want to exam this procedur in my web no have any data

please tell me why??

USE [DigitalFirm]

GO

/****** Object: StoredProcedure [dbo].[SearchTaskName] Script Date: 05/31/2007 21:44:47 ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERProcedure [dbo].[SearchTaskName]

(

@.TaskNamevarchar(50)

)

as

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdate

from Assign_Task a,Task_Emp te,Personal p,Employee e

where te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskNamelike'@.TaskName%'

thanx

Try this:

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdatefrom Assign_Task a,Task_Emp te,Personal p,Employee ewhere te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskNamelike @.TaskName +'%'
|||

hi thanx mrndinakar you are nice manEmbarrassed

this is nice help for me .Stick out tongue

thanx

|||

it_amani:

hi thanx mrndinakar you are nice manEmbarrassed

this is nice help for me .Stick out tongue

thanx

You are welcome.Smile

|||

thax

mmmm

i want ask about another problem

when i update record from my web and i have value is null , the record not update

how i can solve this problem

thanx mrndinakar

|||

There could be lot of things involved. Post the UPDATE script you have. Does the script work if you run it from query analyzer?

|||

thanx i solve it . in incurved way(in arabic language toroq moltaweya)

but i wana to put my code and my query

Try

Dim idAsString

id = Request.QueryString("id").ToString()

If CheckBox1.Checked =TrueThen

fun.Update_Employee(id, fullname.Text, jobtitle.Text, salary.Text, sdate.Text, F_Date.Text, depno.SelectedValue, Active.SelectedValue, Username.Text, Pass.Text, Type.SelectedValue)

Label3.Text ="Update Employee Information are sucessful"

Else

fun.Update_Employee1(id, fullname.Text, jobtitle.Text, salary.Text, sdate.Text, depno.SelectedValue, Active.SelectedValue, Username.Text, Pass.Text, Type.SelectedValue)

Label3.Text ="Update Employee Information are sucessful"

EndIf

this is to the first Update

ALTERProcedure [dbo].[update_Employee]

(

@.IDNOnumeric(18,0),

@.fullNamevarchar(50),

@.Job_Titlevarchar(50),

@.Salaryint,

@.S_Datedatetime,

@.F_Datedatetime,

@.DepNonumeric(18,0),

@.Activebit,

@.Usernamevarchar(20),

@.Passvarchar(20),

@.ID_Type_idnumeric(18,0)

)

As

update Employeeset Job_Title=@.Job_Title,Salary=@.Salary,S_Date=@.S_Date,F_Date=@.F_Date,DepNo=@.DepNo,active=@.Active

where IDNO=@.IDNO

updateLogInset Username=@.Username,Pass=@.Pass,ID_Type_id=@.ID_Type_id

Where IDNO=@.IDNO

update Personalset fullName=@.fullName

Where SSN=@.IDNO

Catch exAs Exception

Label3.Text = ex.Message

and this to the second Update

ALTERProcedure [dbo].[update_Employee2]

(

@.IDNOnumeric(18,0),

@.fullNamevarchar(50),

@.Job_Titlevarchar(50),

@.Salaryint,

@.S_Datedatetime,

@.DepNonumeric(18,0),

@.Activebit,

@.Usernamevarchar(20),

@.Passvarchar(20),

@.ID_Type_idnumeric(18,0)

)

As

update Employeeset Job_Title=@.Job_Title,Salary=@.Salary,S_Date=@.S_Date,DepNo=@.DepNo,active=@.Active

where IDNO=@.IDNO

updateLogInset Username=@.Username,Pass=@.Pass,ID_Type_id=@.ID_Type_id

Where IDNO=@.IDNO

update Personalset fullName=@.fullName

WhereSSN=@.IDNO

thanx

No comments:

Post a Comment