|
Mathew P V wrote: the reason is because its not showing the records that i want so i want it to be displayed so i thought of writing the query in .cs page and display manually without the use of datasource.
WEll, perhaps you need to post your code, so we can see what you're doing wrong. If you're binding to a datasource, then the records will show, so long as your control itself is visible.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
i have not started writing code for grid view i did was using the datasource for retreiving values the sql query is as follows
SELECT DISTINCT LeaveMaster.LeaveType, LeaveAllotted.NoOfDays
FROM LeaveMaster INNER JOIN
LeaveAllotted ON LeaveMaster.LeaveTypeID = LeaveAllotted.LeaveTypeID INNER JOIN
EmpCategType ON LeaveAllotted.EmpCategID = EmpCategType.EmpCategID INNER JOIN
GeneralInfo ON EmpCategType.EmpCategID = GeneralInfo.EmpCategID INNER JOIN
GenderMaster ON LeaveAllotted.GenderID = GenderMaster.GenderID AND GeneralInfo.GenderID = GenderMaster.GenderID
the problem because there are both male and females staffs in my GeneralInfo table its showing both leaves for both the employees infact it should should male leave to males and female leaves to female
|
|
|
|
|
OK, so your SQL needs fixing ? Your problem has nothing to do with the gridview then ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
kindly tell me how to display the records in a gridview by writing code in the .cs page
or send me a link which have the description related to this
a reply from you will be deeply appreciated
|
|
|
|
|
Take a look this example.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Do you not own any references on ASP.NET ? Does google not work where you live ? EIther you're not explaining this right ( possible, as the only code you've posted is SQL ), or you're struggling with something quite trivial.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello,
I want to call a java web service from my asp.net application?
I have a WSDL file URL for a java web service.
Can anyone tell how can i use the web methods of java web service using a WSDL URL in my asp.net application?
|
|
|
|
|
|
You have given good solution, but i can not add the reference of a web reference in my C# page.
where you have write "using JSimpCalcWebServiceService;", i can't get my added web reference at this position.
so, anything required for this?
|
|
|
|
|
ashish bhakhar wrote: but i can not add the reference of a web reference in my C# page.
Why?
In your Web Site, Right Click on the Project > Add Web Reference > Then one popup window will come. you have to give the WSDL link on that Address bar. Now Click on the Go link.
It will Create a proxy of that web service url.
After successuly creation, you will get the reference name in the below text box, you can change the Reference name.
Suppose you have given the reference name as MyWS. Then Click on Add Reference Button.
Then Add the namespace using MyWS;
Now you can create object of the class of Web service and can call the methods.
Let me know if any other issue.
Hope this will help you.
Thanks you.
|
|
|
|
|
I have done, all you have written.
but after adding a web reference with some name, i can't add the namespace using my given name, bcoz it can't found!
|
|
|
|
|
did you tried access via code, like say if you have given the name space like MyWS, then are you able to access it like MyWS.ClassName ?
Do one think, after adding the reference, Build your application once then try ?
That will resolve your issue.
Thank you !!
|
|
|
|
|
Yes, i have given the name space like MyWS, but i am not able to access it like MyWS.ClassName even after application Re Build.
this is the problem.
|
|
|
|
|
Hi guys, thanks for looking
Im having a little problem with search engines
When i launched my site i was using cookiless session, well, actually it was autodetect
Search engines crawled my site, and asp.net detected them like cookieless browsers, and some links have the session id in the url
Ive set the sessionState cookieless="false" now
But still there are some links with the session id
What i want to do is to detect when a url has a session id and redirect them to the default page, or even better to the requested page but removing the sessionid
Ive tryed this in the global.asax:
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
If Request.Url.ToString.Contains("(S(") Then '"(S(" just for the time being :)
Response.Redirect("~/")
End If
End Sub
But the url always contains a regular url (without the session id, and im using a url with session id in it)
What would be the best way to accompilsh my goal??
Thanks in advance
Alexei Rodriguez
|
|
|
|
|
I need to create number of textbox and label on user selection.
I am using asp.net 1.1 and jquery for client side development.
One person's data is another person's program.
--J.Walia
|
|
|
|
|
OK. How do you hope to get the data from these textboxes when a postback occurs ? Or will you pass the values back with AJAX ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
|
Is there a way to find out programatically from where the user landed on an aspx page. For instance, a link on another site, or by directly keying in the url in the address bar, etc.
|
|
|
|
|
Yes, it's Request.UrlReferrer, from memory.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hello everyone,
Im running a dynamic site where I'm using MS access as the DB. I'm having difficulty doing the search for the site. I have looked at couple of codes here and there but they all seem to be for static websites, at least to me it seems that way. If you guys have any suggestions on what to do or where to look at.
Any kind of help would greatly be appreciated. Oh and also, I'm pretty new to Asp.net so if I sound like a NEWBie thats because I am one.
Thanks everyone,
Dulla
|
|
|
|
|
dullar wrote: I'm having difficulty doing the search for the site.
You'll have to a little more specific. What are you having difficulties with, the code, getting results???
dullar wrote: dynamic site where I'm using MS access as the DB
That's your first mistake. Use SQL Server. SQL Express is free and far more capable than Access for this type of appliction.
only two letters away from being an asset
|
|
|
|
|
Yea I'm having trouble with the code. I don't know where to start as far as the search capabilities. I want a very basic way to do it and am not looking for something very fancy with highlights and stuff. I want it to search the Database and look for the word thats being searched. I don't even want it to search any other pages just the database.
I have used some of the code thats on this site but I get so many errors that it drives me nuts.
I should have used SQL Server but its too late because I have put in way too much time in doing it in Access.
Thanks!
|
|
|
|
|
As Christian points out, you should take a few steps back, you are quite apparently over your head.
only two letters away from being an asset
|
|
|
|
|
dullar wrote: Oh and also, I'm pretty new to Asp.net so if I sound like a NEWBie thats because I am one.
Then you should perhaps take a step back and learn things at a reasonable pace, so you learn them properly, and well.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
I cant get the database to update properly. I have a template field in a gridview and there are labels, dropdowns, textboxes in the template field that are bound to fields in the database.
I was trying to use the dropdown to populate two fields "KRAKey" bound to the SelectedValue of the dropdown and "KRAName" would be bound to the dropdowns SelectedItem.Text and I was trying to use the RowUpdating Event of the gridview to populate the UpdateParameters of the datasource for that field.
=========== PROBLEMS =================================
A. The "KRAName" field will not update. It is supposed to update with the dropdown list.selectedItem.text value in the EditItemTemplate of the gridview, as you can see in the RowUpdating Event of the gridview.
B. This might be related to problem A... if there is already data in the field, the field will not update with the values im trying to set for the parameters in the RowUpdating Event in the gridview. It WILL, however, update if the current value in that field in the database is NULL. It also WILL update the value in the textbox field that is bound to the "KRADescription" field even if there is existing data in the field.
Can anyone see why this is not working, please?
Now, I will post the entire code.... I hope someone can figure out my problems, which I will state after the code. Thanks!
============= Gridview =================================
<br />
<EditItemTemplate><br />
<br />
<table style="width:100%;"><br />
<br />
<tr><br />
<br />
<td class="style1"><br />
<br />
<asp:DropDownList ID="drpETChooseKRA" runat="server" <br />
SelectedValue='<%# Bind("KRAKey") %>' AppendDataBoundItems="True"><br />
<br />
<asp:ListItem Selected="True" Value="-1">< Choose a KRA Level ></asp:ListItem><br />
<br />
<asp:ListItem Value="1.0">1.0 - Markets, Products and Services</asp:ListItem><br />
<br />
<asp:ListItem Value="3.0">3.0 - Resources</asp:ListItem><br />
<br />
<asp:ListItem Value="4.0">4.0 - Operational Systems</asp:ListItem><br />
<br />
<asp:ListItem Value="5.0">5.0 - Management Systems</asp:ListItem><br />
<br />
<asp:ListItem Value="6.0">6.0 - Culture</asp:ListItem><br />
<br />
<asp:ListItem Value="7.0">7.0 - Financial Management</asp:ListItem><br />
<br />
</asp:DropDownList><br />
<br />
<asp:Label ID="lblETKRAName" runat="server" Text='<%# Bind("KRAName") %>' <br />
style="color: #0000CC"></asp:Label><br />
<br />
<asp:Label ID="lblETPlanUID" runat="server" Text='<%# Bind("PlanUID") %>' <br />
style="color: #CC3300"></asp:Label><br />
<br />
</td><br />
<br />
<td class="style2"><br />
<br />
<asp:TextBox ID="txtETKRADescription" runat="server" Rows="4" TextMode="MultiLine" <br />
Width="250px" Text='<%# Bind("KRADescription") %>'></asp:TextBox><br />
<br />
</td><br />
<br />
<tr><td><br />
<br />
<asp:Label ID="lblETEditedBy" runat="server" Text='<%# Bind("EditedBy") %>' <br />
style="color: #006600"></asp:Label><br />
<br />
</td><td><br />
<br />
<asp:Label ID="lblETEditDate" runat="server" Text='<%# Bind("EditDate") %>' <br />
style="color: #FF6600"></asp:Label><br />
<br />
</td></tr> <br />
</tr> <br />
<br />
</table><br />
<br />
</EditItemTemplate><br />
<br />
<ItemStyle Wrap="False" /><br />
<br />
</asp:TemplateField><br />
<br />
<asp:BoundField DataField="PlanUID" HeaderText="PlanUID" <br />
SortExpression="PlanUID" Visible="False" /><br />
<br />
<asp:BoundField DataField="KRAUID" HeaderText="KRAUID" <br />
SortExpression="KRAUID" InsertVisible="False" ReadOnly="True" <br />
<br />
Visible="False" /><br />
<br />
<asp:ButtonField ButtonType="Button" CommandName="ViewObjectives" <br />
Text="View Objectives" /><br />
<br />
</Columns><br />
<br />
<HeaderStyle BackColor="#CCCCCC" /><br />
<br />
<AlternatingRowStyle BackColor="#FFFFCC" /><br />
<br />
</asp:GridView><br />
<br />
======== Datasource =================<br />
<br />
<asp:SqlDataSource ID="sdsKRAs" runat="server" <br />
<br />
UpdateCommand="UPDATE [tblKRAs] SET [KRAKey] = @KRAKey, [PlanUID] = @PlanUID, [KRAName] = @KRAName, [KRADescription] = @KRADescription, [EditedBy] = @EditedBy, [EditDate] = @EditDate WHERE [KRAUID] = @original_KRAUID"><br />
<br />
<UpdateParameters><br />
<br />
<asp:Parameter Name="KRAKey" Type="String" /><br />
<br />
<asp:Parameter Name="original_PlanUID" Type="Int32" /><br />
<br />
<asp:Parameter Name="KRAName" Type="String" /><br />
<br />
<asp:Parameter Name="KRADescription" Type="String" /><br />
<br />
<asp:Parameter Name="EditedBy" Type="String" /><br />
<br />
<asp:Parameter Name="EditDate" Type="DateTime" /><br />
<br />
<asp:Parameter Name="original_KRAUID" Type="Int32" /><br />
<br />
</UpdateParameters><br />
<br />
=============== Codebehind =======================<br />
<br />
Protected Sub gvKRAs_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gvKRAs.RowUpdating <br />
Dim name, sql, pstring, KRAName, EditedBy, EditDate, username As String<br />
<br />
sdsKRAs.UpdateParameters("KRAName").DefaultValue = name <br />
sdsKRAs.UpdateParameters("EditedBy").DefaultValue = Session("username")<br />
<br />
username = Session("username")sdsKRAs.UpdateParameters("EditDate").DefaultValue = DateTime.Now <br />
<br />
<br />
KRAName = CType(gvKRAs.Rows(e.RowIndex).FindControl("lblETKRAName"), System.Web.UI.WebControls.Label).Text<br />
<br />
EditedBy = CType(gvKRAs.Rows(e.RowIndex).FindControl("lblETEditedBy"), System.Web.UI.WebControls.Label).TextEditDate = CType(gvKRAs.Rows(e.RowIndex).FindControl("lblETEditDate"), System.Web.UI.WebControls.Label).Text <br />
sql = sdsKRAs.UpdateCommand.ToString<br />
<br />
<br />
End Sub<br />
I would really appreciate the help!
Thanks
modified on Friday, June 5, 2009 12:45 PM
|
|
|
|