List And Contains Scenario - Compare Get Excluded And Included Using 2.0
Jul 10, 2010
I have two List's that contain a object of Tag like List<Tag> i need to find excluded and included to do an update operation how do find the difference in them both since they contain a Tag object. Can you use Contains function with a Tag object inside the list.
[Code]....
View 3 Replies
Similar Messages:
Feb 9, 2011
I got 2 linq results, one of them is as follow.
[Code]....
I need to find out which states in the "query" are not included in the "query2".I can loop through 2 results with nested loop but I think there might be better way of doing the same task with LINQ.Please show me the right direction if it can be done.
View 5 Replies
Nov 25, 2010
how to compare to checkbox list and show selected in first checkbox list
[Code]....
View 7 Replies
Apr 22, 2010
I have a web form where there are couple of DDL's; DDL1 and DDL2 respectively. I want the DDL2 to be populated based on the selection made in DDL1. From the DDL1, I just want to extract the first three digits of the value selected in DDL1 and use it in the WHERE clause of SQL query which is used to generate DDL2.
My prob is that I am not able to extract the first three digits out of DDL1 and use it in the WHERE clause of DDL2. I have pasted all my code below:
Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ddl1Value As String = DropDownList1.SelectedValue
ddl1Value = (ddl1Value.Substring(0, 3))
SqlDataSource3.SelectParameters(0).DefaultValue = ddl1Value
SqlDataSource3.DataBind()
End Sub
Code for DDL2:
<asp:DropDownList ID="DropDownList2" runat="server" CssClass="style29"
DataSourceID="SqlDataSource3" DataTextField="IXC_Vendor_Name"
AutoPostBack="True" AppendDataBoundItems="true"
DataValueField="IXC_Vendor_Name" Height="24px" Width="338px"
onselectedindexchanged="DropDownList10_SelectedIndexChanged">
<asp:ListItem Selected = "True" Text = " " Value = " " ></asp:ListItem>
</asp:DropDownList>.......
View 8 Replies
Feb 18, 2010
I have an SQL Function with the following SQL within:
SELECT StockID FROM (SELECT DISTINCT StockID,
ROW_NUMBER() OVER(ORDER BY DateAdded DESC) AS RowNum
FROM Stock
WHERE CategoryCode LIKE @CategoryID) AS Info
WHERE RowNum BETWEEN @startRowIndex AND (@startRowIndex + @maximumRows) - 1
I have a Parameter @CategoryID - however I need to take in a category ID such as "BA" and translated this to a list of Category IDs such as "IE","EG" etc so my WHERE clause looks like:
WHERE (CategoryCode LIKE 'IE' OR CategoryCode LIKE 'EG') AS Info
I have a Lookup Table which contains the "BA" code and then all the real category codes this means such as "IE" and "EG".How do I have the CategoryID expand to multiple "OR" statements in my SQL Function?
At the moment the query as shown can cope with one CategoryID such as "IE", this is done as I want a category page such as category.aspx where a parameter "BA" is passed such as category.aspx?category=BA and this page will list all items with the category codes "EG" and "IE".
The reason I need this is there is a "parent" category code which has multiple "children" category codes which are different to the parent code. I am using ASP.NET and .NET 3.5 on the front-end if this helps.
View 2 Replies
Jan 10, 2011
When attempting to place controls in different content areas using Masterpages and trying to use a compare validator, I get the error: Unable to find control id 'txtStartDate' referenced by the 'ControlToCompare' property of 'cvlDate'. I have also attempted to set it within the c# code behind in page load: cvlDate.ControlToCompare = txtStartDate.ID and by using findControl there must be an easy way to achieve this?
<asp:Content ID="Content4" ContentPlaceHolderID="leftForm" Runat="Server">
<asp:Label ID="lblStartTimeEnter" runat="server" Text="Start Time:" Width="100px"/>
<asp:TextBox ID="txtStartTime"runat="server" MaxLength="50" Width="250"/>
</asp:content>
<asp:Content ID="Content4" ContentPlaceHolderID="rightForm" Runat="Server">
<asp:label ID="lblEndDateEnter" CssClass="formMargin labelInput" runat="server" Text="End Date:" Width="100px"/>
<asp:TextBox ID="txtEndDate" CssClass="formMargin" runat="server" MaxLength="20" Width="250" ClientIDMode="Static"/>
<asp:CompareValidator ID="cvlDate" runat="server" ControlToValidate="txtEndDate" ControlToCompare="txtStartDate" Operator="GreaterThan" Type="Date" ErrorMessage="Start Date must be before End Date" > *</asp:CompareValidator>
</asp:content>
View 9 Replies
Feb 15, 2010
I am using compare validator to compare date... But Its not working ...I have used calendar extender...with date format as "dd/MM/yyyy"...
View 3 Replies
Apr 17, 2010
I am trying to check for a condition such that a date in an input control (textbox) is not greater from a date 1 years from current date(exactly) and also it should not be less than a date 1 year back from current date. for eg. if today's date is "21/dec/1990" then usen cannot enter a date in textbox which is less than 21/dec/89 and it should not be greater than 21/dec/1991. for this i first tried to confirm the greater than condition, i wrote the following code:
<asp:TextBox
ID="TxtSessionFrom"
runat="server"></asp:TextBox>
<asp:CompareValidator
ID="CompareValidator1"
runat="server"
ControlToValidate="TxtSessionFrom"
ErrorMessage="CompareValidator"
Operator="GreaterThanEqual"
Type="Date"></asp:CompareValidator>
CompareValidator1.ValueToCompare=(DateTime.Now.AddYears(1).ToString());
but this gave an error: The value '' of the ValueToCompare property of 'CompareValidator1' cannot be converted to type 'Date'.
View 7 Replies
Dec 6, 2010
I have this SQL Select statement to select the basket id where the user id equals a specific ID.I want to store the result of the query in a variable, so I thought I could have done:
BasketPage.SelectCommand="SELECT BasketID FROM tblBasket WHERE (UserID = '9f96bd94-91b9-4328-8214-4eac179c3a26')"
var BasketID = BasketPage.ExecuteScalar().ToString();
But apparently I need to create a new instance of an SQL Command for it to work, how can I do this for the BasketPage Select Command?
View 2 Replies
Apr 27, 2010
1) All users can browse open web site content.
2) To access memebrs area users must login.
3) Users can create , edit/update, delete there profile/information only.
4) Users can see / view other users profiles.
5) Admin can browse, create, edit/update, delete an any profiles.
I found many different ways to implement it, but what the best practice. May be you can point me in right direction.
Application Web based, MsSQL 2005, .NET 3.5, Server 2003.
View 1 Replies
Mar 2, 2010
I was looking to build an application with the scenario:
1. The application is a Shared PowerPoint Presentation
2. There would be 2 users for the application, Admin and Client
3. Admin can upload presentations
4. Only Admin can control the flow of presentation and cLient can just see the changes
5. As-In Admin can select next slide or previous slide and correspondingly Client configuration changes
I was thinking of updating current values in Database and using AJAX for updates on Client end. But I want a notification kinda thing that would notify the Client as soon as the Admin changes slides.
View 1 Replies
Mar 9, 2011
My scenario is this:
I have asp.net page which having the drop down control with Product list. in database my Product Table has fields as ProductId, Product Name and Price. where as I have filled this drop down control by this method:
private void FillProducts()
{
List<Product> productList = objProductManager.GetProducts();
if (productList.Count > 0)
{
drpProducts.DataSource = productList;
drpProducts.DataTextField = "ProductName";
drpProducts.DataValueField = "ProductId";
drpProducts.DataBind();
}
}
Which is working perfect. But i want to get selected product Price value on client side. for that I don't want round trip at server to get that. is any property of dropdown control other than DataTextFeild Or DataValueField to hold the Price Field of product ? so that i would avoid to go back at server. Or suggest any remedy for the same.
View 4 Replies
Feb 1, 2011
string filePath = ExportAndSaveInvoiceAsHtml(invoiceId);
Response.AddHeader("Content-Disposition", "attachment;filename=" + Path.GetFileName(filePath));
Response.WriteFile(filePath);
[code]...
View 2 Replies
Jul 16, 2010
I am using ajax.beginform. i am inserting and updating records using ajax and showing the inserted or updated value in the div above the div containing form. I need to apply validtion on these values.what is the recomended validation framework for this scenario. i have problems pushing validation messages to the form as i can only update one div that is indicated in updatetargetid parameter of ajax.beginform and this value in my case is set to div displaying the updated/inserted data
View 7 Replies
May 26, 2010
i'm new with design patterns and i'm not sure if in this situation i can use a composite pattern.
The scenario is a web application for an address book : the address book cointains AddressBoookItem, generalization for Contact and ContactGroup. The last one is the composite object containing a collection of AddressBoookItem.
With these scenario i'm sure that this is a composite pattern, but what is confusing me is that a contact may belong to many contactgroup. Does this request change the situation? Till now i thought that between the Leaf object and the Composite (in the composite pattern) there was a 1-to-m relationship (a composite may contains many leaf but a leaf is contained in only one composite object). Can i still use the composite pattern ? And, the last question,
How could i represent my scenario in a relational database? One table for the entire hierarchy or two table (Contact and ContactGroup) with a m:n relationship between them ?
View 3 Replies
Apr 24, 2010
I want the select statement for the above scenario.
View 2 Replies
Mar 14, 2011
[Code]....
How can I maintain using data annotation attributes for validations in mvc3 different requirement for edit and create in an elegant manner. I have an different edit and create requirement.
View 2 Replies
Oct 26, 2010
I want to track equipment between three types of allocations. A piece of equipment can be allocated to an employee, to a customer facility or to a warehouse.
I have an equipment table, employee table, a customer table and warehouse table. Warehouse is where equipment is temporarily held and shared between multiple employees, it is a holding area.
Obviously each equipment item can only be allocated to one employee, customer or warehouse.
My original thinking was to make a table for EquipmentAllocations where it linked the EquipmentID and the id of the employee, customer or warehouse (all guids).
Eventually I will need to query the equipment to see where it is located/allocated. I will also need to query the employees to check what equipment is allocated to them.
I am trying to figure out the best way to handle this and I am looking for some guidance. I am sure many of you have had situations similar to this that you could draw upon to offer up some advice.
View 8 Replies
Jan 27, 2011
SaveChanges can generate an UpdateException when an object added to the ObjectContext cannot be successfully created in the data source. This can happen if a row with the foreign key specified by the relationship already exists. When this occurs, you cannot use Refresh to update the added object in the object context. Instead, reload the object with a value of OverwriteChanges for MergeOption.
In a table, a foreign key column can have a single value multiple times. e.g. DepartmentID foreign key in Users Table: More than one User can have same DepartmentID foreign key.
So how can this cause an UpdateException ?
View 1 Replies
Jun 16, 2010
When i POST the page using the following code, the Response.write("Hey") doesn't write the content ("Hey") to the parent page
<form method="post" name="upload" enctype="multipart/form-data"
action="http://localhost:2518/Web/CrossPage.aspx" >
<input type="file" name="filename" />
<input type="submit" value="Upload Data File" name="cmdSubmit" />
</form>
But When i use following code , and POST the data, the Response.write("Hey") can be obtained in the parent page
[code]...
View 4 Replies
Mar 2, 2010
I use the code bellow to dynamically include a CSS file:
HtmlHead head = (HtmlHead)Page.Header;
HtmlLink link = new HtmlLink();
link.Attributes.Add("href", Page.ResolveClientUrl("~/App_Themes/Default/StyleSheet.css"));
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
head.Controls.Add(link);
The problem is: I want to do it only once, and only if it isn't alrealy included in the page.
How do I verify if it is already included?
Edit:
Answers telling me to include in page load using !IsPostBack won't solve my problem, as this code will be inside a Web User Control and my page may have a lot of the same user control.
For example, I use the code below to do it with javascript:
if (!Page.ClientScript.IsClientScriptIncludeRegistered("jsScript"))
{
Page.ClientScript.RegisterClientScriptInclude("jsScript", ResolveUrl("~/Utilities/myScript.js"));
}
View 3 Replies
Mar 18, 2010
I have created a great stand-alone web form in asp.net utilizing many jQuery features and CSS. It works fine. When I re-create it as a web content form as part of a MasterPage, my jQuery and javascript is completely ignored.
I am referencing the pertinent jQuery and CSS in my of the MasterPage. I have a content placeholder at the bottom of the masterpage called "ScriptContent". In my content page, this is where I plug in the various jQuery methods and javascript.
When I view the page source everything is there. However, it's all being ignored so to speak. What am I doing wrong?
View 2 Replies
May 14, 2010
I am using ASP.NET MVC with jquery. I have the following MVC Action that returns a partial page on Success. On Application Error, I am not sure what to send it for correctly handling it at the client side.
public ActionResult LoadFilterSet(int filterSetId)
{
try
{
BreadCrumbManager bcManager = this.ResetBreadCrumbManager(this.BreadCrumbManagerID);
GeneralHelper.LoadBreadCrumbManager(bcManager, filterSetId);
ViewData["BreadCrumbManager"] = bcManager;
return View("LoadFilterSet");
}
catch (Exception ex)
{
return Content("");
}
}
Following is my jquery ajax call. Notice that I am checking for the data length to make sure there are no errors. Please suggest me a better way of doing this.
$.ajax({
type: "GET",
dataType: "html",
async: true,
data: ({ filterSetId: selectedId }),
url: link,
contentType: "text/html; charset=utf-8",
success: function(data, textStatus) {
if (data.length > 0) {
// Clear the local filters first.
clearLocalFilters();
$('td.selected-filters table.filters-display').append(data);
}
}
});
View 2 Replies
May 18, 2010
I have a question about model binding. Imagine you have an existing database entity displayed in a form and you'd like to edit some details, some properties eg createddate etc are not bound to the form, during model binding, these properties are not assigned to the model as they are not on the http post data or querystrong etc, hence their properties are null. In my controller method for update , Id just like to do
public ActionResult Update( Entity ent)
{
//Save changes to db
}
but as some properties are null in ent, they override the existing database fields which are not part of the form post data, What is the correct way to handle this? Ive tried hidden fields to hold the data, but model binding does not seem to assign hidden fields to the model.
View 1 Replies
Jan 15, 2010
I am working on my company's website and when I get the project from the Source safe and compile it. It compiles and run's fine.
But how come the Bin folder is not included in the project and how come my application is still running fine.?
Don't the BIN folder needs to be included my doing the right click on the BIN folder and including it in the project.?
View 2 Replies