|
this[^] one? I don't see any .NET assemblies in there?
Tal Humy wrote: Not enough storage is available to complete this operation. Well, is it out of memory? If you are low on harddisk-space then this error would occur, as Windows can't grow its swapfile.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That error wasn't thrown by a managed component. There are some strange and confusing situations when you get an "Out of Memory" error message but such an error did not happen. Actually, it was a different problem in the non-managed component.
Hence look for things which the functioning programs have in common, things which the crashing programs have in common, and the differences between the groups. E.g. bit-ness, user context (service, interactive, admin, ...) etc.
|
|
|
|
|
Hi, I have written an OData 4.0 WebAPI.
As anyone answering this question probably knows, $InLineCount=AllPages has now been replaced with $Count=True.
For backward compatibility purposes, I need to continue to support $inLineCount=AllPages as an option, I have tried for two days to override the validation of this, but I always get a message "The query parameter '$inlinecount' is not supported.".. I created a custom QueryOption validator, tried a CustomMessageHandler in the Configuration.MessageHandlers to no avail.
Would anyone know if/where the URL could possibly be overridden before getting to the OData code. The validation of the $inLineCount value, seems to occur to early for me to override. I would simply like to replace $inLineCount=AllPages with $count=true when the request arrives.
|
|
|
|
|
What the heck does this have to do with C#?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It hard to see what you are talking about without see your code...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Sorry guys, it's a C# webAPI question.
I didn't see anything detailing specifically OData, so I thought it would fit in C#.
I don't think it's really a code specific question however, more of a question of Method. Here's my code below though. When an OData GET is called, this method fires, but even though I set a custom validator, the oData code is kicking out my request before it gets there, because "$inlineCount" is an unsupported method. My goal is to thow $inlineCount out of the REQUEST URL myself before it ever gets here. But I don't know when/where the request is getting blocked.
[EnableQuery(AllowedQueryOptions = AllowedQueryOptions.All, PageSize = 5)]
public IHttpActionResult Get(ODataQueryOptions<Task> queryOptions)
{
try
{
queryOptions.Validator = new CustomValidator();
return Ok(_db.Tasks.AsQueryable());
}
catch (Exception e)
{
_logger.LogError(e.ToString());
return BadRequest(e.ToString());
}
}
|
|
|
|
|
Hello!
I'm new here hope you guys can give me a suggestions/answers to my questions.
I have an aspx page which has two dropdownlist the first dropdownlist populates school level and the second dropdownlist populate available section depending on the selected school level. I had enabled already the EnableViewState to TRUE from the page and to my master page. Below is my code.
On my Page Load event I populate the school level, I have this condition
If(!IsPostback)
{
PopulateSchoolLevel();
}
on my first dropdownlist selectedindexchanged event I have this code
Datatable dt = New DataTable;
dt=_queries("StoredProcedure",ddlLevel.SelectedValue.Tostring());
if(dt.rows!=0)
{
ddlSection.Datasource=dt;
ddlSection.ValueTextField="Section";
ddlSection.DataValueField="id";
ddlSection.DataBind();
}
now every time i select a value in my second dropdownlist it always return to the first index or first value. how can i retain the selected value on my second dropdownlist? I'm having burned a lot of time for this screnario.. please help me.
Thanks
|
|
|
|
|
Sorry, not enough code to fully answer but try this. I am running from memory now so I might be off a bit. I had a similar problem but found that I was forcing the second dropdown back to the first object. IIRC I also a selectedindex change event on the second dropdown and that was where my problem was.
If this doesn't help drop in more of the code.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
every time you change the index you re-bind the data source.
a very simple solutions
session["current"] = ddlSection.selectedindex;
on page load
ddlSection.selectedIndex = convert.toint32(session["current"]);
|
|
|
|
|
Thanks for your replies.. i tried your suggestion by storing the selectedindex of my second dropdownlist into session. i put a breakpoint on Loading event to see if the selectedindex value was stored but unfortunately it was not stored,it always stored the first value of my second dropdownlist.. here are some of my codes below
private void _getSection()
{
ddlSection.Datasource=_queries("StoredProc",ddlLevel.SelectedIndexChanged);
ddlSection.DataTextField ="SectionName";
ddlSection.DataValueField="id";
ddlSection.DataBind();
}
private void _loadLevels()
{
//_queries is a class handles all queries to my sql database.
ddlLevel.Datasource=_queries("select * from levels");
ddlLevel.DataTextField ="LevelName";
ddlLevel.DataValueField ="id";
ddlLevel.DataBind();
}
on my pageload event i call the _loadLevels() function. I have this condition
if(!IsPostback)
{
_loadLevels();
}
if(Session["_sectionid"]!=null)
{
string _result = Session["_sectionid"].Tostring();
}
//---------------
protected void ddlLevel_SelectedIndexChanged(object sender, EventArgs e)
{
Session["_sectionid"]=ddlSection.Selectedindex;
_getSection(); //-- this will populate the section in my ddlSection which values are
ex. DataTextField DataValueField
St.Dominic 1
St.Agustine 2
}
Autopostback of my DDL's is set to True and EnableViewState from my masterpage is also set into True.
Every time i select the second or third item in my ddlSection it always give me the first index I can't understand???...Im sure that there is no event calling my _getSection function only in the ddlLevel. by the way Im using Masterpage but there is no code i have in my masterpage. Please let me know what's happening on this scenario?
modified 30-Jul-14 1:38am.
|
|
|
|
|
Step #1: On Page Load
populate drop down 1 with items / values
ex>
Text: ".NET 101"
Value: "1"
Step #2: On Drop 1 Selected Index Changed
store the selected items value
****the index corresponds only to the drop 1 list - don't store this*****
pass the selected value to the stored procedure
EXEC spGetData 1
Step#3: On Page Load --
if(Session["_sectionid"]!=null)
get session value
pass to stored procedure
bind data
clear session for next round
|
|
|
|
|
thanks for the reply @Member9245431 but my objective is to get the seletedvalue of my second dropdwonlist(ddlSection) which i can't get the selected item. every time i put a breakpoint on my Loading event of my page the selectedindex in my ddlSection always reset that's why im still getting the first index which i selected is the second or third item. im sure that there's no one in my function that populates my ddlSection trigger at any event only in my first dropdwonlist(ddlLevel)which fires only on selectedindexchanged event. I burned a lot of time on this issue of mine.
|
|
|
|
|
Hi,
Is it possible if windows tag the clipboard to check if it's related my application or to other application?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
There is two tables.
1)Employee table(slno,empid,empname,projid)
2)Project table(slno,projid,projname)
In combobox projname should be shown, and when we select projname, according to that emp table should be shown.
Using stored procedure.
For me connection string also not working.
|
|
|
|
|
What exactly is your question? What code have you written? What isn't working?
|
|
|
|
|
Mate, I assume that you need show the related employees in the gridview as per the combobox selection.
It is just the matter of reading the selected value from the combobox,
selectedItem = comboBox1.SelectedItem;
Pass this selected value to filter the Employee table and read the results.
Finally, Rebind(); the gridview.
This is the basic logic. Try the above(There are plenty of resources online). If you get any real problem after your own attempt, post them in Questions area. Good luck.
|
|
|
|
|
I started to learn how to write mvc tests from the following site http://www.asp.net/mvc/tutorials/older-versions/contact-manager/iteration-5-create-unit-tests-cs"
However when running the test I keep getting a object not set to instance exception
[TestMethod]
public void CreateRace()
{
RACE race = new RACE();
race.RACE_CODE = 1;
race.Logourl = "dasdad";
race.RegattaCity = "Durban";
race.RegattaProvince = "Kzn";
race.RegattaStreetAddress = "232Chats";
race.MAXPARTICA = 12;
race.SECRETARY_EMAIL = "ssasda";
race.SECRETARY_MOBILE = 1422434;
race.SECRETARY_NAME = "jsjsjs";
race.ENTRYAMOUNT = Convert.ToDecimal(23.58);
race.EVENT_NAME = "sadada";
race.status = "Active";
race.UserId = 1;
race.LATEENTRYAMOUNT = Convert.ToDecimal(23.58);
string eventstart = "2014/05/12 12:02", eventend = "2014/05/17 12:02", entrydeadline = "2014/05/11 12:02", withdrawdate = "2014/05/11 12:02", YachtClubname = "durban";
var result = _service.CreateRace(race, eventstart, eventend, entrydeadline, withdrawdate, YachtClubname, "Kzn");
Assert.IsTrue(result);
}
//Create Service Method
public bool CreateRace(RACE race, string eventstart, string eventend, string entrydeadline, string withdrawaldate,string YachtClubname,string Province )
{
if (!ValidateRace( race,eventstart, eventend, entrydeadline, withdrawaldate,YachtClubname,Province))
return false;
try
{
_repository.CreateRace(race, eventstart, eventend, entrydeadline, withdrawaldate,YachtClubname,Province);
}
catch
{
return false;
}
return true;
}
|
|
|
|
|
I see two possible locations in there. One is that you haven't initialized _service, the other being _repository.
|
|
|
|
|
Thank you for your reply;Is this what you meant by Initialization:
private Mock<IRaceRepository> _mockRepository;
private ModelStateDictionary _modelState;
private IRaceService _service;
[TestInitialize]
public void Initialize()
{
_mockRepository = new Mock<IRaceRepository>();
_modelState = new ModelStateDictionary();
_service = new RaceServiceRepository(new ModelStateWrapper(_modelState), _mockRepository.Object);
}
Unfortunately it still gives me Object not set to an instance on an object error
|
|
|
|
|
Then throw us a bone and do some debugging. Find out which line is throwing this exception. Until you do this, we can't help.
|
|
|
|
|
That's one of the easiest errors to track down. One of the objects you're using is null. It's that simple.
Use the debugger to find out which one. You're getting this error because you're code is assuming that every property and method you're calling is returning an object. One or more of them returned null.
Step through the code line by line in the debugger and hover the mouse over each and every variable to see what it's value is.
|
|
|
|
|
You can set the development environment (Visual Studio) to break where the exception was originally throw (if it's re-thrown) by changing the following setting: "Debug->Exceptions..." and check the Thrown column for "Common Language Runtime Exceptions".
modified 12-Feb-22 21:01pm.
|
|
|
|
|
Goodmorning,
I would like to start my form having the mouse set in the form area (in any position is ok, but in the form) at the start.
Is it possible?
Thanks
|
|
|
|
|
Windows Forms? If so, just set MouseLocation to your desired location.
|
|
|
|