Click here to Skip to main content
15,899,475 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Updating outlook calander from asp.net on click(Urgent) Pin
Christian Graus8-Dec-08 9:33
protectorChristian Graus8-Dec-08 9:33 
AnswerRe: Updating outlook calander from asp.net on click(Urgent) Pin
Sandeep Mewara4-Jan-09 22:43
mveSandeep Mewara4-Jan-09 22:43 
QuestionHow to handle file upload exception Pin
Aslesh8-Dec-08 6:28
Aslesh8-Dec-08 6:28 
AnswerRe: How to handle file upload exception Pin
Adam Maras8-Dec-08 7:23
Adam Maras8-Dec-08 7:23 
GeneralRe: How to handle file upload exception Pin
Aslesh8-Dec-08 9:39
Aslesh8-Dec-08 9:39 
QuestionHow to get the TemplateItem of a DetailsView Pin
b43r_3oo38-Dec-08 5:24
b43r_3oo38-Dec-08 5:24 
AnswerRe: How to get the TemplateItem of a DetailsView Pin
b43r_3oo38-Dec-08 7:22
b43r_3oo38-Dec-08 7:22 
QuestionGridview not showing Empty data Template when Empty Pin
www.Developerof.NET8-Dec-08 3:22
www.Developerof.NET8-Dec-08 3:22 
Hi all,

I have been struggling to get this done but it has drilled a nail in my head.

I have a grid as foll:

<asp:GridView ID="Grid_Results" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="loc" HeaderText="supplocid" SortExpression="loc" />
<asp:BoundField DataField="to_loc_ID" HeaderText="destlocid" SortExpression="destlocid" />
<asp:BoundField DataField="frm_loc" HeaderText="Source" SortExpression="frm_loc" />
<asp:BoundField DataField="to_loc" HeaderText="Destination" SortExpression="to_loc" />
<asp:BoundField DataField="amt_with_tax" HeaderText="Value(with Tax)" SortExpression="amt_with_tax"
DataFormatString="{0:f}" HtmlEncode="False">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="amt_wo_tax" HeaderText="Value(without Tax)" SortExpression="amt_wo_tax"
DataFormatString="{0:f}" HtmlEncode="False">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="totcld" HeaderText="Total CLD`s" SortExpression="totcld" />
<asp:BoundField DataField="freight" HeaderText="Freight" SortExpression="freight" />
</Columns>
<EmptyDataTemplate>
<asp:Label runat="server" ID="EDL" Text="Sorry!!! No Records found"></asp:Label>
</EmptyDataTemplate>
<RowStyle CssClass="datagrid_row1" />
<HeaderStyle CssClass="datagrid_heading" />
</asp:GridView>


and

the code i m using is as follows


Protected Sub Button_Search_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_Search.Click
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "Blah Blah"
Dim loc As String = Nothing
If DDL_Location.SelectedValue <> "0" Then
loc = DDL_Location.SelectedValue
End If
frmdate = DateTime.ParseExact(TextBox_Date_From.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentCulture)
todate = DateTime.ParseExact(TextBox_Date_To.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentCulture)
cmd.Parameters.Add(New SqlParameter("@Fromdate", frmdate))
cmd.Parameters.Add(New SqlParameter("@todate", todate))
cmd.Parameters.Add(New SqlParameter("@source_loc", loc))
sda = New SqlDataAdapter
sda.SelectCommand = cmd
ds = New DataSet
sda.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
Dim caption As String = ""
caption = "From date: " + frmdate.ToLongDateString + " To date: " + todate.ToLongDateString
Grid_Results.Caption = "<b>" + caption + "</b>"
Else
Grid_Results.Caption = String.Empty
End If
Grid_Results.DataSource = ds
Grid_Results.DataBind()
If ds.Tables(0).Rows.Count > 0 Then
Button_Export.Visible = True
Button_Export_All.Visible = True
Else
Button_Export.Visible = False
Button_Export_All.Visible = False
End If
End Sub


can anyone get this code working!!!!!

When you fail to plan, you are planning to fail.
AnswerRe: Gridview not showing Empty data Template when Empty Pin
Abhijit Jana8-Dec-08 3:25
professionalAbhijit Jana8-Dec-08 3:25 
GeneralRe: Gridview not showing Empty data Template when Empty Pin
www.Developerof.NET8-Dec-08 4:16
www.Developerof.NET8-Dec-08 4:16 
QuestionFile.Exists - cannot find file on PostBack Pin
Member 34028868-Dec-08 1:58
Member 34028868-Dec-08 1:58 
AnswerRe: File.Exists - cannot find file on PostBack Pin
Brij8-Dec-08 2:40
mentorBrij8-Dec-08 2:40 
QuestionAccessing 3rd party software object from asp.net Pin
lavankumar8-Dec-08 1:57
lavankumar8-Dec-08 1:57 
AnswerRe: Accessing 3rd party software object from asp.net Pin
Abhijit Jana8-Dec-08 2:22
professionalAbhijit Jana8-Dec-08 2:22 
GeneralRe: Accessing 3rd party software object from asp.net Pin
Brij8-Dec-08 2:48
mentorBrij8-Dec-08 2:48 
AnswerRe: Accessing 3rd party software object from asp.net Pin
Christian Graus8-Dec-08 9:44
protectorChristian Graus8-Dec-08 9:44 
QuestionHow to dynamically load an ASPX page into a exisitng element from code behind?? Pin
DuelMonster_Coder8-Dec-08 0:57
professionalDuelMonster_Coder8-Dec-08 0:57 
AnswerRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
Brij8-Dec-08 1:14
mentorBrij8-Dec-08 1:14 
GeneralRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
DuelMonster_Coder8-Dec-08 1:47
professionalDuelMonster_Coder8-Dec-08 1:47 
GeneralRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
Abhijit Jana8-Dec-08 1:50
professionalAbhijit Jana8-Dec-08 1:50 
GeneralRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
DuelMonster_Coder8-Dec-08 2:50
professionalDuelMonster_Coder8-Dec-08 2:50 
AnswerRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
Satish - Developer8-Dec-08 1:40
Satish - Developer8-Dec-08 1:40 
AnswerRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
Paddy Boyd8-Dec-08 2:28
Paddy Boyd8-Dec-08 2:28 
GeneralRe: How to dynamically load an ASPX page into a exisitng element from code behind?? [modified] Pin
DuelMonster_Coder8-Dec-08 2:54
professionalDuelMonster_Coder8-Dec-08 2:54 
AnswerRe: How to dynamically load an ASPX page into a exisitng element from code behind?? Pin
cmk8-Dec-08 6:32
cmk8-Dec-08 6:32 

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.