Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
susan_151615
Yak Posting Veteran
99 Posts |
Posted - 2008-10-16 : 08:30:04
|
hi am displaying values in datagrid based on selection in calendar and dropdown it has worked properly but when e\the user choses some other values or some other vdate from calendar it is not displaying the values corresponding to it nor it is displaying the line no records to displaymy code is as follows:Dim AssocID As String AssocID = Convert.ToString(Session.Item("Username")) Dim Connstr As String = "Server=tdl12d08;user id=sa;password=sa;database=ToolsTeam" Dim st2 As String = ("SELECT ALLO.TASK_ID, ALLO.TASK_ALLOC_DATE, ALLO.TASK_ACTUAL_EFFORT, ALLO.TASK_START_DATE, ALLO.TASK_END_DATE, ALLO.TASK_STATUS, ALLO.TASK_DETAILS FROM UST_TASK_ALLOCATION_HISTORY ALLO,UST_TASK_HISTORY HIST WHERE ASSOC_ID =@ASSOC_ID AND ALLO.TASK_STATUS =@STATUS AND HIST.TASK_CREATE_DATE = @TASK_CREATE_DATE AND HIST.TASK_ID=ALLO.TASK_ID ") Dim cn2 As SqlConnection = New SqlConnection(Connstr) cn2.Open() ddlStatus.Attributes.Add("onchange", "return ConfirmApply();") Dim da2 As SqlDataAdapter = New SqlDataAdapter(st2, cn2) da2.SelectCommand.Parameters.Add("@STATUS ", SqlDbType.VarChar).Value = ddlStatus.SelectedValue.ToString() da2.SelectCommand.Parameters.Add("@ASSOC_ID", SqlDbType.VarChar).Value = AssocID da2.SelectCommand.Parameters.Add("@TASK_CREATE_DATE", SqlDbType.VarChar).Value = txtselect.Text Dim ds2 As New DataSet da2.Fill(ds2) cn2.Close() If ds2.Tables(0).Rows.Count > 0 Then dgcomptask.DataSource = ds2 dgcomptask.DataBind() Else Response.Write("No Records to display") End Ifsusan |
|
|
|
|