|
mrgaddam wrote: Can you please tell me what are all things have to follow in Code
I already did that.
Read my previous post, and if there is anything that you don't understand, say what it is.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
iam having only one text box which is useful to enter different datatype values say date,number,string etc now my requirement is the first data type is date datatype ..how i can check if the user enters some text in the text box is a valid date formate or not..if he enters other than date then how i can say that the value enter is not in date format
|
|
|
|
|
Hi jagadeeshkumar2106,
suppose u have a one textbox names text1 ok now try this code
// Code is here.
try
{
DateTime d = new DateTime();
d = Convert.ToDateTime(Text1.Text.Trim());
// If it will not be in proper format then it will throw an error ok
// if u know error type about converting then u can also write one another catch block regarding that.
}
catch(Exception ex)
{
Response.Write("Enter Date is not in valid format");
}
I hope it will work.
modified on Friday, December 14, 2007 7:14:25 AM
|
|
|
|
|
Hi!
I am trying to display a three level datagrid drill down. dont know what i am doing wrong. its not working on the third drill down as its not calling itemcommand event on the second datagrid.
also, there is a massive amout of text inviewstate. I want an efficient drill down. how could this be achieved. below are my codes for readability. please someone point me to correct direction.
aspx
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="gvPropertyAssetCapexSummary" DataKeyField="buildingcomponentid" runat="server" Width="472px" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue" ></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan" Font-Names="verdana" Font-Size="8pt"></HeaderStyle>
<ItemStyle Font-Names="verdana" Font-Size="8pt"/>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="buildingcomponentid" HeaderText="buildingcomponentid" Visible="false"></asp:BoundColumn>
<asp:TemplateColumn>
<HeaderStyle Width="9px"></HeaderStyle>
<ItemTemplate>
<asp:ImageButton id="btnExpandJob" runat="server" Width="9px" Height="9px" ImageUrl="/Images/Plus.gif" CommandName="ExpandJob"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:PlaceHolder ID="ExpandJob" Runat="server" Visible="False">
</td></tr>
<tr><td >&nbsp;</td>
<td colspan="3">
<asp:DataGrid id="gvPropertyAssetCapexJob" DataKeyField="CapExJobNo" runat="server" Width="100%" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan" Font-Names="verdana" Font-Size="8pt"></HeaderStyle>
<ItemStyle Font-Names="verdana" Font-Size="8pt"/>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="CapExJobNo" HeaderText="CapExJobNo" Visible="false"></asp:BoundColumn>
<asp:TemplateColumn>
<HeaderStyle Width="9px"></HeaderStyle>
<ItemTemplate>
<asp:ImageButton id="btnExpandJobDetail" runat="server" Width="9px" Height="9px" ImageUrl="/Images/Plus.gif" CommandName="ExpandJobDetail"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:PlaceHolder ID="ExpandJobDetail" Runat="server" Visible="False">
</td></tr>
<tr><td>&nbsp;</td>
<td colspan="3">
<asp:DataGrid DataSource='<%# getJobDetail(DataBinder.Eval(Container, "DataItem.CapExJobNo")) %>' id="gvPropertyAssetCapexJobDetail" runat="server" Width="100%" BorderColor="Tan" BorderWidth="1px" BackColor="LightGoldenrodYellow" CellPadding="2" GridLines="None" ForeColor="Black" AutoGenerateColumns="False">
<SelectedItemStyle ForeColor="GhostWhite" BackColor="DarkSlateBlue"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Tan"></HeaderStyle>
<FooterStyle BackColor="Tan"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="AssetDescription" HeaderText="Asset Description"></asp:BoundColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>
</asp:PlaceHolder>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>
</asp:PlaceHolder>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="DarkSlateBlue" BackColor="PaleGoldenrod"></PagerStyle>
</asp:DataGrid>
vb
Public Partial Class testfunc
Inherits System.Web.UI.Page
Private domainid As Integer
Private locationid As Integer
Private buildingcomponentid As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim mydal As New clsDAL
domainid = 1204111332
locationid = 27195
buildingcomponentid = 0
If Not IsPostBack Then
Try
Dim dtPropertyCapex As DataSet = mydal.getAssetsCapexByProperty(domainid, buildingcomponentid, locationid)
If Not dtPropertyCapex Is Nothing Then
gvPropertyAssetCapexSummary.DataSource = dtPropertyCapex
gvPropertyAssetCapexSummary.DataBind()
End If
Catch ee As Exception
mydal.UpdateErrorLog(ee.Message, ee.TargetSite.Name.ToString())
Throw ee
End Try
Try
Catch ex As Exception
End Try
End If
End Sub
Private Sub gvPropertyAssetCapexSummary_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles gvPropertyAssetCapexSummary.ItemCommand
Select Case e.CommandName
Case "ExpandJob"
Dim img As ImageButton
img = e.Item.Cells(1).FindControl("btnExpandJob")
If img.ImageUrl = "/Images/Plus.gif" Then
img.ImageUrl = "/Images/Minus.gif"
Else
img.ImageUrl = "/Images/Plus.gif"
End If
Dim exp As PlaceHolder
exp = e.Item.Cells(1).FindControl("ExpandJob")
Dim dgjob As DataGrid
dgjob = CType(e.Item.FindControl("gvPropertyAssetCapexJob"), DataGrid)
If (Not dgjob Is Nothing) Then
dgjob.DataSource = getJob(e.Item.Cells(0).Text)
dgjob.DataBind()
End If
exp.Visible = Not exp.Visible
End Select
End Sub
Public Function getJob(ByVal BCId As Integer) As DataSet
Dim myDal As New clsDAL
Dim dsPropertyAssetCapexSummary As DataSet
domainid = 1204111332
locationid = 27195
dsPropertyAssetCapexSummary = myDal.getCapitalExpenditureJob(domainid, BCId, locationid)
dsPropertyAssetCapexSummary = dsPropertyAssetCapexSummary
Return dsPropertyAssetCapexSummary
End Function
Private Sub gvPropertyAssetCapexJob_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Select Case e.CommandName
Case "ExpandJobDetail"
Dim img As ImageButton
img = e.Item.Cells(1).FindControl("btnExpandJobDetail")
If img.ImageUrl = "/Images/Plus.gif" Then
img.ImageUrl = "/Images/Minus.gif"
Else
img.ImageUrl = "/Images/Plus.gif"
End If
Dim exp As PlaceHolder
exp = e.Item.Cells(1).FindControl("ExpandJobDetail")
Dim dgjobdetail As DataGrid
dgjobdetail = CType(e.Item.FindControl("gvPropertyAssetCapexJob"), DataGrid)
If (Not dgjobdetail Is Nothing) Then
dgjobdetail.DataSource = getJobDetail(e.Item.Cells(0).Text)
dgjobdetail.DataBind()
End If
exp.Visible = Not exp.Visible
End Select
End Sub
Public Function getJobDetail(ByVal CapexJObNo As Integer) As DataSet
Dim myDal As New clsDAL
Dim dsPropertyAssetCapexSummary As DataSet
domainid = 1204111332
locationid = 27195
buildingcomponentid = 0
dsPropertyAssetCapexSummary = myDal.getCapitalExpenditureJobDetail(domainid, buildingcomponentid, locationid, CapexJObNo)
Return dsPropertyAssetCapexSummary
End Function
End Class
thanks in advance.
|
|
|
|
|
could someone please help me?
|
|
|
|
|
Hi Clever People.
I have create an application that exports data to Excel. It first writes the data to a FileStream where it will ask you if you want to open or save the Excel file. Now the problem is that it works very well on our one server. Unfortunately we decided to move all applications accross to a different server.
They both are identical where setup is concerned, but for some or other reason I am getting the Following Error when trying to Export to Excel.
InvalidOperationException was unhandled by user code.
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Can anyone tell me what we might have missed please?
Kind regards,
Elizma
|
|
|
|
|
Elizma wrote: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
I have not experienced this yet. But Google[^] returned many many results
|
|
|
|
|
Hi There,
Thanx for your reply. I also googled it before I came to post my question here. Unfortunatley nowhere in the over 600 results does it actually state what is causing it. They also cover the MsgBox problems. I am not making use of it. I am using the normal Filestream objects. Like I said. It works on our one server, but not on the new server. I am trying to figure out what we missed with the new server.
Kind Regards,
Elizma
|
|
|
|
|
Can you show a snippet of how you are streaming the file to the client?
|
|
|
|
|
Hi,
i have created a dataset named Dataset1.xsd
i have added a new crystalreport file to my apps named CrystalReport.rpt
i have configured the same with my dataset.
I get the tables n columns of my dataset in the FieldExplorer
I drag n drop the required columns in my rpt file
Then in my webform i drag n drop the crystalreportviewer
and map the CrystalReport.rpt source as the source for viewer.
When i execute i get this...
The report you requested requires further information
Dataset1
Server :Dataset
Database:
Username:
Password:
Integrated Security
and a logon button
can nebody help me???
zari
|
|
|
|
|
Hi,
1. Tell me, when you created your report, did you use the dataset that you created, or did you connected directly to the database?
2. When creating the Dataset, dropping the tables from the database on the dataset, have you deleted the fill objects at the bottom of the table?
3. Have you created an instance of your dataset and fill the tables in the dataset with the code from the database?
4. Lastly you have to set the datasource for this report to the dataset instance that you created and filled.
Let me know if you need assistance. I struggled myself with this in the beginning.
Kind Regards,
Elizma
|
|
|
|
|
hi all
good morning.can anyone explain me about data manager class. i could not get any proper definitions of data manager class
pintoo
|
|
|
|
|
The data layer is a class or dll that contains all your DB access code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I want to develop a comparison chart. For example,
You want to start a new restaurant in a particular place. So, what you do is you will list all the items that are being supplied by the restaurents already available on X-axis and all the restaurents on Y-axis.
Now you put a tick mark against each item taking one restaurent at a time.
item1 item2 item3 item4
Rest1 . .
Rest2 . . .
Rest3 . .
My report should look something like this and i am working in asp.net 1.1
Thank You in advance
|
|
|
|
|
What problem are you facing?
|
|
|
|
|
I have no idea about how to do it
Thank you
|
|
|
|
|
What I like to suggest you is that you should learn about ASP.NET before start working on the project.. Basically, we all here are not for teaching the tutorials. What we do here is that we give the advice if someone needed it and we help other people to solve their problem when they ask the specific question..
If you want to learn about ASP.NET 1.1, you can start reading the QuickStart tutorials from Microsoft website.. or you can buy the book too..
|
|
|
|
|
Thank you very much for your suggestion but, i am not expecting a tutorial from you. I am just expecting an idea on how to go for it.
|
|
|
|
|
Here is the idea.
1. Suppose: You have two tables called Restaurant (e.g ResID, ResName) and the available foods (e.g. ResID, FoodID, FoodName)
2. Join those both table
3. Get the count of available food, create the temp table or table variable, fill the data (if you have the static count for food name then this step is not necessary).
4. return those data to DataSet
5. Bind this dataset with Gridview.
That's all.
|
|
|
|
|
My database looks like this
SNo Restaurent Items
1 Rest1 Item1
2 Rest1 Item2
3 Rest1 Item4
4 Rest2 Item1
5 Rest2 Item3
6 Rest2 Item4
7 Rest3 Item2
8 Rest3 Item3
And in the Report, Y Axis should be Restaurent values and X-axis should be Item values. And wherever there is a matching point, a tick mark should come.
Thank you
|
|
|
|
|
hi freind i Use LLBL Gen Classe to Intract with my SQL database
now the problem s that i use the Grid view to show the number of the customer to Admin . the DataSource that i assign is the datatable which i recived from llbl Genreated Class Obj . Now i want to Edit the data in the Grid View but there is problem when i click the Update Button
plz any body tell me in detail
wasim khan
|
|
|
|
|
Hi,
I've made a windows application and i want to call it from a web application. How can i call it from a web application. Should i use web service to do so? If yes then how can i call from web service. Please give me material according to this. Thanks
|
|
|
|
|
You can use Process.Start() . but this will start the application in server, not in client machine.
|
|
|
|
|
Thanks a lot. I want to do it on server. So, it would help me a lot.
Thanks again
|
|
|
|
|
I am using a grid view control with check box, i want to modify multiple rows by selecting the checkboxes. i have added few textboxes in the footer template and a button. i will select multiple rows and i will assign the values which is avaialable in the text boxes in the footer template.
on button clik i am trying to find the text box control in the footer template. I am getting an error.
on clik of button i am doing this
string LSL = ((TextBox)gv.FindControl("txtAssLSL")).Text.ToString();
string USL = ((TextBox)gv.FindControl("txtAssUSL")).Text.ToString();
string GRR = ((TextBox)gv.FindControl("txtAssGrr")).Text.ToString();
string FLimit = ((TextBox)gv.FindControl("txtFLimit")).Text.ToString();
string VLimit = ((TextBox)gv.FindControl("txtAssVLimit")).Text.ToString();
can any one tell me how to find a control from the footer template?
Thanks in Advance.
|
|
|
|