Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. problem in check box [modified]

problem in check box [modified]

Scheduled Pinned Locked Moved ASP.NET
csharpsharepointhelpannouncement
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    susan_151615
    wrote on last edited by
    #1

    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 Subm

    C G E S 4 Replies Last reply
    0
    • S susan_151615

      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 Subm

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Sounds like a complex task for a beginner - choose something easier, like working through a book.

      Christian Graus Driven to the arms of OSX by Vista. "Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.

      S 1 Reply Last reply
      0
      • C Christian Graus

        Sounds like a complex task for a beginner - choose something easier, like working through a book.

        Christian Graus Driven to the arms of OSX by Vista. "Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.

        S Offline
        S Offline
        susan_151615
        wrote on last edited by
        #3

        Hi graus, I have to do this and i want a help and not skipping from difficult things if u can help me

        1 Reply Last reply
        0
        • S susan_151615

          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 Subm

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          susan_151615 wrote:

          Catch ex As Exception End Try

          Don't just catch the exception and ignore it. If there is a problem, you won't get any notification about it, and you have no information about what it could be. Comment out the Try..Catch code until you have got the code working. After that you can reintroduce it, with the addition of actually handling the exception in some way, e.g. displaying a message to the user.

          Despite everything, the person most likely to be fooling you next is yourself.

          S 1 Reply Last reply
          0
          • G Guffa

            susan_151615 wrote:

            Catch ex As Exception End Try

            Don't just catch the exception and ignore it. If there is a problem, you won't get any notification about it, and you have no information about what it could be. Comment out the Try..Catch code until you have got the code working. After that you can reintroduce it, with the addition of actually handling the exception in some way, e.g. displaying a message to the user.

            Despite everything, the person most likely to be fooling you next is yourself.

            S Offline
            S Offline
            susan_151615
            wrote on last edited by
            #5

            Hi thank You, after u mentioned it i wrote in catch System.Diagnostics.Trace.WriteLine("[] Exception " & ex.Message) after that i debugged it its throwing an error like this "Object reference not set to an instance of an object." in the same line which i entined before

            G 1 Reply Last reply
            0
            • S susan_151615

              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 Subm

              E Offline
              E Offline
              eyeseetee
              wrote on last edited by
              #6

              susan_151615 wrote:

              (View Home Task Status is a function which will call the SP)

              Is there a problem with this function?

              1 Reply Last reply
              0
              • S susan_151615

                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 Subm

                S Offline
                S Offline
                sharath07
                wrote on last edited by
                #7

                I think your way of approach is quite too complex for that task. If your aim is to show the rows that the user has checked in some other page, you could better take the ids of the checked rows, into a session variable and use a simple query just like the query which loads the grid in the first page with an extra where condition for the ids, so the ones that are selected alone will come. This should do ur task, it is strongly suggested that you dont take such values to database, just to show stuff in corresponding pages. And infact you can even do this with no database hit (for this purpose) in the second page, just take all the values of the selected rows into a datatable and take that datatable to the next page through session, but the session size will become heavy. Both the above ways are where your project allows to handle values in session, if that is not the case, you can try cookies too. and worst case your db method could help, and in your case, see whether the values u check are inserted in the table and use break points and see whether all the tables and rows that you want are in the dataset you are returned with.

                S 1 Reply Last reply
                0
                • S susan_151615

                  Hi thank You, after u mentioned it i wrote in catch System.Diagnostics.Trace.WriteLine("[] Exception " & ex.Message) after that i debugged it its throwing an error like this "Object reference not set to an instance of an object." in the same line which i entined before

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  Did you put that in the ViewHomeTaskStatus method? The only reference that can be null in the code where you get the exception now, is the data set. It always has a Tables collection, if there was no tables you would get a different exception, and a table always has a Rows collection. So, the conclusion is that a data set is never returned from the method, and that only happens if there is an exception.

                  Despite everything, the person most likely to be fooling you next is yourself.

                  S 1 Reply Last reply
                  0
                  • S sharath07

                    I think your way of approach is quite too complex for that task. If your aim is to show the rows that the user has checked in some other page, you could better take the ids of the checked rows, into a session variable and use a simple query just like the query which loads the grid in the first page with an extra where condition for the ids, so the ones that are selected alone will come. This should do ur task, it is strongly suggested that you dont take such values to database, just to show stuff in corresponding pages. And infact you can even do this with no database hit (for this purpose) in the second page, just take all the values of the selected rows into a datatable and take that datatable to the next page through session, but the session size will become heavy. Both the above ways are where your project allows to handle values in session, if that is not the case, you can try cookies too. and worst case your db method could help, and in your case, see whether the values u check are inserted in the table and use break points and see whether all the tables and rows that you want are in the dataset you are returned with.

                    S Offline
                    S Offline
                    susan_151615
                    wrote on last edited by
                    #9

                    HI ya what u r telling is correct .Since i dono how to implement that functionality and quite little bit tough am following this mehthod.And now my problem is no error is coming the SP is not working fine i think i dono whats the problem the think in backend when i checked the SP its working through front end on button click the SP is not working fine

                    1 Reply Last reply
                    0
                    • G Guffa

                      Did you put that in the ViewHomeTaskStatus method? The only reference that can be null in the code where you get the exception now, is the data set. It always has a Tables collection, if there was no tables you would get a different exception, and a table always has a Rows collection. So, the conclusion is that a data set is never returned from the method, and that only happens if there is an exception.

                      Despite everything, the person most likely to be fooling you next is yourself.

                      S Offline
                      S Offline
                      susan_151615
                      wrote on last edited by
                      #10

                      Hi i changed the way in which am getting the output i vchanged the getdataset into .Executescalar now

                      G 1 Reply Last reply
                      0
                      • S susan_151615

                        Hi i changed the way in which am getting the output i vchanged the getdataset into .Executescalar now

                        G Offline
                        G Offline
                        Guffa
                        wrote on last edited by
                        #11

                        So the problem was in the GetDataSet method? Did you change the exception handling? Did you find out what the actual problem was?

                        Despite everything, the person most likely to be fooling you next is yourself.

                        S 1 Reply Last reply
                        0
                        • G Guffa

                          So the problem was in the GetDataSet method? Did you change the exception handling? Did you find out what the actual problem was?

                          Despite everything, the person most likely to be fooling you next is yourself.

                          S Offline
                          S Offline
                          susan_151615
                          wrote on last edited by
                          #12

                          No am not getting the output still nor able to find out the mistake

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups