|
treuveni wrote: I wrote it with LINQ, not with ADO.NET
So?
I see StartDate and EndTime. Is that what you intend?
|
|
|
|
|
Yes,
i made a mistake at the column name when i created the DB,
it's not the point here.
|
|
|
|
|
I guess there's a mistake in the formulation of your Linq query. This should be :
var query = from p in dc.OnLineDuties
where p.StartDate == start && p.EndTime == end
select p;
|
|
|
|
|
Nop,
it's dosen't works.
I'm still getting 0 row results from the query.
|
|
|
|
|
Are you sure such a row exists?
Rhys
"With no power comes no responsibility"
|
|
|
|
|
goblinTech wrote: Are you sure such a row exists?
Sure.
Here are the two rows from my DB:
DutyId PersonId StartDate EndTime
124 37 2010-11-01 09:00:00 2010-11-01 10:00:00
152 37 2010-09-01 19:00:00 2010-09-01 22:00:00
and still, this query dosen't return any results.
modified on Tuesday, November 9, 2010 1:53 AM
|
|
|
|
|
Can some-one please help me why my query doesn't works?
var query = from p in dc.OnLineDuties<br />
where p.StartDate == start<br />
p.EndTime == end <br />
select p;<br />
<br />
Here are the two rows from my DB:
DutyId PersonId StartDate EndTime<br />
124 37 2010-11-01 09:00:00 2010-11-01 10:00:00<br />
<br />
152 37 2010-09-01 19:00:00 2010-09-01 22:00:00<br />
|
|
|
|
|
To expand on something Mark Nischalke asked some time ago to which you never replied, what is start, what is end? Are they string's, are they datetime's, what are there values at runtime?
Rhys
"With no power comes no responsibility"
|
|
|
|
|
goblinTech wrote: what is start, what is end?
they are DateTime's.
goblinTech wrote: what are there values at runtime?
the user inserts the value trough text box and i parse it to a DateTime type.
at the end the become dd/MM/yyyy hh:mm:ss formt.
The colums ype is also DateTime.
10x
|
|
|
|
|
But what are the values of start and end at runtime? Can you debug and check?
Rhys
"With no power comes no responsibility"
|
|
|
|
|
The values are:
StartDate -
2010-11-01 09:00:00
EndTime -
2010-11-01 10:00:00
same like in the DB
|
|
|
|
|
Hey, I write an view and when I try to run my page, running with error.
its my code
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
InsertUpdatePerson
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>InsertUpdatePerson</h2>
<div id = "leftside">
<%using (Html.BeginForm())
{ %>
<div>
<fieldset>
<div class="editor-label">
<label for= "Fname">FirstName:</label>
</div>
<div class="editor-field-textbox">
<!--textboxname,value,create attribute for textbox!-->
<%Html.TextBox("Fname",null, new{@class= "Form_TextBox"})%>
</div>
<div class="editor-label">
<label for="Sname">LastName:</label>
</div>
<div class= "editor-field-textbox">
<%Html.TextBox("Sname",null, new{@class= "Form_TextBox"})%>
</div>
<div class="editor-label">
<label for= "Gender">Gender:</label>
</div>
<div class="editor-field-textbox">
<!--textboxname,value,create attribute for textbox!-->
<%Html.DropDownList()%>
</div>
</fieldset>
</div>
<%} %>
</div>
</asp:Content>
and its the error
Line 18: <div class="editor-field-textbox">
Line 19: <!--textboxname,value,create attribute for textbox!-->
Line 20: <%Html.TextBox("Fname",null, new{@class= "Form_TextBox"})%>
Line 21: </div>
Line 22:
Error is line 20
I am just following an sample job.what could be the problem?
|
|
|
|
|
future3839 wrote: what could be the problem?
What did the error-message say? Have you googled that message?
I are Troll
|
|
|
|
|
hi,
do you know how can I add dropdown list?
<div class="editor-field-textbox">
<%Html.DropDownList(??????????)%>
</div>
|
|
|
|
|
Using the DropDownList Helper
The DropDownList helper renders a drop-down list. In its simplest form, DropDownList takes one parameter, the name of the ViewData key whose value is of type SelectList and that contains the option values for the drop-down list. The MVC framework uses the ModelState property of ViewData to determine the selected value. If the ModelState property is empty, the framework looks for an item whose Selected property is set.
The following example shows markup for the DropDownList helper method.
<%= Html.DropDownList("pets") %>
The following code is a part of an Index action method in which values are added to a List object. The List object is passed to an instance of SelectList, which is then added to the ViewData object.
List<string> petList = <code>new List<string>()</code>;
petList.Add("Dog");
petList.Add("Cat");
petList.Add("Hamster");
petList.Add("Parrot");
petList.Add("Gold fish");
petList.Add("Mountain lion");
petList.Add("Elephant");
ViewData["Pets"] = new SelectList(petList);
Note:**Both the DropDownList and ListBox helpers accept either a SelectList or MultiSelectList object.
have a look on this link Click Here[^]
|
|
|
|
|
Hi,
I just like to know that can we change the way Asp.Net render the controls. Like RadioButtonGroup Gets converted in Tables and cells and radiobuttons of HTML. Can I edit the controls so that it render to Div instead of table. There are lot of controls like GridView which create lot of problems in layouting.
Thanks & Best Regards
Jay Khatri
|
|
|
|
|
You can subclass the control and override its Render method.
|
|
|
|
|
-----javascript----------------
function SelectTab(itemID,tkID)
{
ob_em_SelectItem(itemID);
window.frames['tabIframe'].location.replace("../page/" + itemID + ".aspx?itemID=" + itemID + "&tkID=" + tkID + "");
}
------asp client code----------
<oem:MenuItem InnerHtml="<span style='cursor:default'>ItemName</span>"
ID="STU0001" OnClientClick="SelectTab('STU0001','<%#txtItemID.ClientID %>')" >
</oem:MenuItem>
return result page:
/page/STU0001.aspx?itemID=STU0001&tkID=<%#txtItemID.ClientID %> ---->got an error here
it should
/page/STU0001.aspx?itemID=STU0001&tkID=1020 --> or whatever the value of txtItemID.ClientID
how to pass a value to javascript function from a textbox?just like above which is not correct.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
modified on Saturday, November 6, 2010 3:37 AM
|
|
|
|
|
Because you are passing id as string. Use client id directly in javascript as:
ob_em_SelectItem('<%= txtItemID.ClientID %>');
window.frames['tabIframe'].location.replace("../page/" + '<%= txtItemID.ClientID %>' + ".aspx?itemID=" + itemID + "&tkID=" + tkID + "");
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
thanks. i got it.
another problem.please help me.
function getValue(passID)
{
document.getElementById("txtPropID").value =passID
}
<asp:TemplateField HeaderText="PropID">
<ItemTemplate>
<a href="javascript:getValue('<%# Eval("PropID")% >')">
<%#Eval("PropID")%></a>
</ItemTemplate>
</asp:TemplateField>
<asp:Button ID="btnSTU12" runat="server" Text="STU12" OnClientClick="javaScript:window.showModalDialog("../page/STU0012.aspx?propID="+ '<%=txtPropID.Text%>' + "","","");
result: page/STU0012.aspx?propID= -->returns empty string
note: txtPropID has always a value.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
modified on Sunday, November 7, 2010 7:41 PM
|
|
|
|
|
solve my own problem.
instead of this.
("../page/STU0012.aspx?propID="+ '<%=txtPropID.Text%>' + "","","");
i use
document.getElementById('<%=txtPropID.ClientID%>').value
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
hi guys
i have a mobile website that run at windows mobile that has printer
i want to print a page from web page i can do this in windows application and now
how to print this with web ?
|
|
|
|
|
I am no expert in mobile websites but I imagine it's the same principle involved as with any website: you can (just) use a javascript call to open the client's "Print" dialog - after that it's up to them. Unlike a windows applciation, you cannot access their printers directly.
|
|
|
|
|
I've been baning my head against the wall for the better part of a day on this issue. I cannot run my coded web performance test.
I'm using VS 2010 Ultimate.
I can do the steps below with no problem using other solutions (even by creating a new solution!) but not with one particular solution.
Here's what I've done:
1) Added a web performance test project to my solution
2) recorded a few mouse clicks in the open browser window
3) ran (repeatedly) the resultant web performance test. Works great!
4) Clicked the Generate Code button in the web test viewer window, which does create a .cs test
5) Chose Test-> Run -> All Tests in Solution. Only the original web performance test shows up in the Test Results window
I want/need the .cs test to compile because I need the .dll for use with a test plan from within Test Manager.
ANY help would be GREATLY appreiciated. Thank you.
--------------------------------------------------------------------------------
jboyd
|
|
|
|
|
FINALLY! OK, here's what I did to resolve the issue:
1) From the Build menu I chose to Build my test project. Building/Rebuilding the solution did NOT do the trick. I had to explicitly choose my test project name from the Build menu.
2) Then I selected Test ->Windows -> Test View. This showed my web performance AND coded tests.
Hope this helps others who have this issue!
|
|
|
|