Click here to Skip to main content
15,892,797 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Which windows vista version is better for .net developer Pin
eyeseetee28-Oct-08 23:13
eyeseetee28-Oct-08 23:13 
GeneralRe: Which windows vista version is better for .net developer Pin
VenkataRamana.Gali28-Oct-08 23:16
VenkataRamana.Gali28-Oct-08 23:16 
GeneralRe: Which windows vista version is better for .net developer Pin
eyeseetee28-Oct-08 23:30
eyeseetee28-Oct-08 23:30 
AnswerRe: Which windows vista version is better for .net developer Pin
#realJSOP29-Oct-08 0:56
mve#realJSOP29-Oct-08 0:56 
AnswerRe: Which windows vista version is better for .net developer Pin
Paul Conrad29-Oct-08 10:34
professionalPaul Conrad29-Oct-08 10:34 
QuestionError while exporting data to Excel sheet Pin
Satish - Developer28-Oct-08 22:35
Satish - Developer28-Oct-08 22:35 
AnswerRe: Error while exporting data to Excel sheet Pin
meeram39528-Oct-08 23:09
meeram39528-Oct-08 23:09 
Questionproblem in check box [modified] Pin
susan_15161528-Oct-08 21:27
susan_15161528-Oct-08 21:27 
Hi am a beginner in dotnet .Am creating a web application in asp vb.net .First i will tell what i want to accomplish

First i have a page when the user logins in to that site the page will display what all the tasks allocated to him in a datagrid





The datagrid has a check box for each of the rows being displayed.

and outside the datagrid there is a send button.When the user clicks the check box and then clicks the send button these datas must get displayed in the another datagrid which is present in another page.

What i have done in back end for this is:

When i check the check box and click the save button all the details will get inserted into the temp table and inside the temp table i have set a flag when the user checks the check box the flag will turn into "y" and the another datagrid which i want to display all the records will choose only the records where the flag is set to "y"

and the codes for it is as follows:

the SP on button click is as follows:

CREATE PROCEDURE USP_VIEW_TASK_UPDATE
(
@TASK_ID VARCHAR(5),
@TASK_ALLOC_DATE DATETIME,
@PROJ_ID VARCHAR(15),
@SUBMOD_ID VARCHAR(15),
@ACTIVITY VARCHAR(15),
@TASK_CREATE_BY VARCHAR(15),
@TASK_DETAILS VARCHAR(100),
@ASSOC_ID VARCHAR(15),
@SEND CHAR(1)
)
AS
BEGIN
CREATE TABLE UST_VIEW_TASK_TEMP
(
TASK_ID VARCHAR(5),
TASK_ALLOC_DATE DATETIME,
PROJ_ID VARCHAR(15),
SUBMOD_ID VARCHAR(15),
ACTIVITY VARCHAR(20),
TASK_CREATE_BY VARCHAR(15),
TASK_DETAILS VARCHAR(100),
SEND CHAR(1)
)

INSERT INTO UST_VIEW_TASK_TEMP VALUES
(
@TASK_ID,
@TASK_ALLOC_DATE,
@PROJ_ID,
@SUBMOD_ID,
@ACTIVITY,
@TASK_CREATE_BY,
@TASK_DETAILS,
@SEND
)
SELECT
ALLO.TASK_ID,
ALLO.TASK_ALLOC_DATE,
HIST.PROJ_ID,
HIST.SUBMOD_ID,
HIST.ACTIVITY,
HIST.TASK_CREATE_BY,
ALLO.TASK_DETAILS,
'N'
FROM
UST_TASK_ALLOCATION ALLO,
UST_TASK_HISTORY HIST
WHERE
ASSOC_ID =@ASSOC_ID
AND convert(varchar,ALLO.TASK_ALLOC_DATE,112) =convert(varchar,getdate(),112)
AND HIST.TASK_ID=ALLO.TASK_ID
AND ALLO.TASK_ID=@TASK_ID

UPDATE UST_VIEW_TASK_TEMP SET SEND='Y'
WHERE
ASSOC_ID =@ASSOC_ID
AND HIST.TASK_ID=ALLO.TASK_ID
AND ALLO.TASK_ID=@TASK_ID
END

and the front end which i havedone on selecting a check box and the button click is:

Dim bsl As New BSL

Dim item As DataGridItem

Dim chkBox As CheckBox

Dim AllocatedDate As String

Dim taskid As String

Dim ProjID As String

Dim SubmodID As String

Dim Activity As String

Dim details As String

Dim CreateBy As String

Dim AssocID As String

Dim Connstr As String = "myconnectionstring"

For Each item In dgUserhometask.Items

chkBox = CType(item.FindControl("chkbox"), CheckBox)

If (chkBox.Checked) Then

AllocatedDate = CType(item.FindControl("lblAllocDate"), Label).Text.ToString

taskid = CType(item.FindControl("lblTID"), Label).Text.ToString

ProjID = CType(item.FindControl("lblPID"), Label).Text.ToString

SubmodID = CType(item.FindControl("lblMID"), Label).Text.ToString

Activity = CType(item.FindControl("lblActivity"), Label).Text.ToString

details = CType(item.FindControl("lblSynopsis"), Label).Text.ToString

CreateBy = CType(item.FindControl("lblAllocatedBy"), Label).Text.ToString

bsl.UserTaskStatus(Connstr, AllocatedDate, taskid, ProjID, SubmodID, Activity, details, CreateBy, AssocID)----->(UserTaskStatus is a function which will call the sp)

End If

Next

Dim ds As DataSet

dgUserhometask.DataSource = ds.Tables(0)

dgUserhometask.DataBind()

End Sub



UserTaskStatus function is as :

Public Function UserTaskStatus(ByVal Connstr As String, ByVal AllocatedDate As String, ByVal taskid As String, ByVal ProjID As String, ByVal SubmodID As String, ByVal Activity As String, ByVal details As String, ByVal CreateBy As String, ByVal AssocID As String) As DataSet

'To get the Connection String

Try

Dim objDataAccess As New DAL(Connstr)

Dim dsViewTask As DataSet

Dim strSQLScript As String = "USP_VIEW_TASK_UPDATE"

Dim strDatabaseServer As String = objDataAccess.DatabaseServer

With objDataAccess

.CreateSQLParmCollection(8)

If AllocatedDate = "" Then

.AddInParameter("@TASK_ALLOC_DATE", SqlDbType.DateTime, DBNull.Value, 1)

Else

.AddInParameter("@TASK_ALLOC_DATE", SqlDbType.DateTime, AllocatedDate, 1)

End If

.AddInParameter("@TASK_ID", SqlDbType.VarChar, taskid, 2)

.AddInParameter("@PROJ_ID", SqlDbType.VarChar, ProjID, 3)

.AddInParameter("@SUBMOD_ID", SqlDbType.VarChar, SubmodID, 4)

.AddInParameter("@ACTIVITY", SqlDbType.VarChar, SubmodID, 5)

.AddInParameter("@TASK_DETAILS", SqlDbType.VarChar, SubmodID, 6)

.AddInParameter("@TASK_CREATE_BY", SqlDbType.VarChar, SubmodID, 7)

.AddInParameter("@ASSOC_ID", SqlDbType.VarChar, AssocID, 8)

dsViewTask = .GetDataSet("USP_VIEW_TASK_UPDATE")

Return dsViewTask

End With

Catch ex As Exception

End Try

End Function

in the second page:



the sp which will be called after button click is:



create procedure USP_USER_VIEW_TASK
(
@ASSOC_ID VARCHAR(30),
@TASK_ID VARCHAR(5)
)
as
begin
SELECT * FROM UST_VIEW_TASK_TEMP
WHERE
SEND='Y'
AND ASSOC_ID =@ASSOC_ID
AND convert(varchar,TASK_ALLOC_DATE,112) =convert(varchar,getdate(),112)
AND TASK_ID=@TASK_ID
END



and the front end coding is for it is:



Dim Connstr As String = "myconnectionstring"

Dim bsl As New BSL

Dim AllocatedDate As String

Dim taskid As String

Dim AssocID As String

AssocID = Convert.ToString(Session.Item("Username"))

Dim dsViewHomeTask As New DataSet

dsViewHomeTask = bsl.ViewHomeTaskStatus(Connstr, AllocatedDate, taskid, AssocID)---->(View Home Task Status is a function which will call the SP)

If (dsViewHomeTask.Tables(0).Rows.Count > 0) Then

dgUpdtasksave.DataSource = dsViewHomeTask.Tables(0)

dgUpdtasksave.DataBind()

lblError.visible = False

Else

lblError.visible = True

dgUpdtasksend.ShowHeader = False

End If





View Home TaskStatus is a sfollows:

Public Function ViewHomeTaskStatus(ByVal Connstr As String, ByVal AllocatedDate As String, ByVal taskid As String, ByVal AssocID As String) As DataSet

'To get the Connection String

Try

Dim objDataAccess As New DAL(Connstr)

Dim dsViewTask As DataSet

Dim strSQLScript As String = "USP_USER_VIEW_TASK"

Dim strDatabaseServer As String = objDataAccess.DatabaseServer

With objDataAccess

.CreateSQLParmCollection(3)

If AllocatedDate = "" Then

.AddInParameter("@TASK_ALLOC_DATE", SqlDbType.DateTime, DBNull.Value, 3)

Else

.AddInParameter("@TASK_ALLOC_DATE", SqlDbType.DateTime, AllocatedDate, 3)

End If

'.AddInParameter("@PROJ_ID", SqlDbType.VarChar, ProjID, 3)

'.AddInParameter("@SUBMOD_ID", SqlDbType.VarChar, SubmodID, 4)

'.AddInParameter("@ACTIVITY", SqlDbType.VarChar, SubmodID, 5)

'.AddInParameter("@TASK_CREATE_BY", SqlDbType.VarChar, SubmodID, 6)

'.AddInParameter("@TASK_DETAILS", SqlDbType.VarChar, SubmodID, 7)

.AddInParameter("@TASK_ID", SqlDbType.VarChar, taskid, 2)

.AddInParameter("@ASSOC_ID", SqlDbType.VarChar, AssocID, 3)

dsViewTask = .GetDataSet("USP_USER_VIEW_TASK")



Return dsViewTask

End With

Catch ex As Exception

End Try

End Function



But when i click the check box and then the save button

its throwing an error "object reference not set to an instance of the object" in the place

If (dsViewHomeTask.Tables(0).Rows.Count > 0) Then

dgUpdtasksave.DataSource = dsViewHomeTask.Tables(0)

in the second page

The second page will show a message if there is no records to display when the user doesnt click the button even that it is not showing its throwing the same error for it .

Can anyone help me in sorting this out
Cry | :((

modified on Wednesday, October 29, 2008 3:33 AM

AnswerRe: problem in check box Pin
Christian Graus28-Oct-08 22:17
protectorChristian Graus28-Oct-08 22:17 
GeneralRe: problem in check box Pin
susan_15161528-Oct-08 22:40
susan_15161528-Oct-08 22:40 
AnswerRe: problem in check box Pin
Guffa28-Oct-08 22:54
Guffa28-Oct-08 22:54 
GeneralRe: problem in check box Pin
susan_15161528-Oct-08 22:59
susan_15161528-Oct-08 22:59 
GeneralRe: problem in check box Pin
Guffa29-Oct-08 9:17
Guffa29-Oct-08 9:17 
GeneralRe: problem in check box Pin
susan_15161529-Oct-08 20:01
susan_15161529-Oct-08 20:01 
GeneralRe: problem in check box Pin
Guffa29-Oct-08 21:15
Guffa29-Oct-08 21:15 
GeneralRe: problem in check box Pin
susan_1516152-Nov-08 17:33
susan_1516152-Nov-08 17:33 
AnswerRe: problem in check box Pin
eyeseetee28-Oct-08 23:11
eyeseetee28-Oct-08 23:11 
AnswerRe: problem in check box Pin
sharath0729-Oct-08 1:21
sharath0729-Oct-08 1:21 
GeneralRe: problem in check box Pin
susan_15161529-Oct-08 19:58
susan_15161529-Oct-08 19:58 
Questioncategory tree like structure Pin
S.Dhanasekaran28-Oct-08 21:14
S.Dhanasekaran28-Oct-08 21:14 
Questionhow to issue STARTTLS command Pin
raghvendrapanda28-Oct-08 21:04
raghvendrapanda28-Oct-08 21:04 
AnswerRe: mail sending problem Pin
GDMFSOB28-Oct-08 21:12
GDMFSOB28-Oct-08 21:12 
GeneralRe: mail sending problem Pin
raghvendrapanda28-Oct-08 21:26
raghvendrapanda28-Oct-08 21:26 
GeneralRe: mail sending problem Pin
Himanshu Manjarawala23-Apr-12 19:49
Himanshu Manjarawala23-Apr-12 19:49 
AnswerRe: how to issue STARTTLS command Pin
GDMFSOB28-Oct-08 21:35
GDMFSOB28-Oct-08 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.