For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have built an aplication wich interacts with a webserver as if it were a browsing user. It can log in, browse products and select a product to buy. Unfortunately when it comes to actually buying the product the server returns just the logintoken and the shopping cart is still empty.
I suppose the session cookie is not sent.
Is there any way I can debug the httpclienthandler? I am a beginner in Programming and I hoped there was a way similar to Chome debugger console.
I am experiencing issue with split method. When I try split something like this:
06302017;37;Denver; Other Non-Interest Expense from RI item 7.d. : Travel Expense=$88,799. Excess public-facing website address listings f rom
RC-M line 8.b.: sparkalpha.com, www.getsparkalpha.com, www.getsparkalpha.com, www.sparkalpha.com; 07282017;Other; RCM; M4b
The tab that occurs is not my doing but what actually happens with that mass of string and I believe it is causing my problem. It splits this in half into two different arrays. This is problematic because each item separated by a ';' corresponds to a field so it causes an out of bounds error. Any suggestions on how to get it to keep the 8 different strings within the split? Based on how my program is run, I cannot make a special case of this and expect it to work well.
By the way, I didn't write the line that I'm trying to split so I cannot fix it myself. I am grabbing a file from a website location and then splitting it so that the data can be used for a database.
Thank you for your help.
I'm currently taking in the file through a Streamreader and then running a method which has the split method. It works for all other lines except that one. It's because of the tab that inconveniently gets thrown in. I'm trying to use C# right now. I will see if CSV reader is any better.
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
var buffer = Windows.Security.Cryptography.CryptographicBuffer.ConvertStringToBinary( "The first sentence", Windows.Security.Cryptography.BinaryStringEncoding.Utf8); await Windows.Storage.FileIO.WriteBufferAsync(sampleFile, buffer);
var buffer = Windows.Security.Cryptography.CryptographicBuffer.ConvertStringToBinary( "The first sentence", Windows.Security.Cryptography.BinaryStringEncoding); await Windows.Storage.FileIO.WriteBufferAsync(sampleFile, buffer);
var buffer = Windows.Security.Cryptography.CryptographicBuffer.ConvertStringToBinary( "The first sentence", Windows.Security.Cryptography.BinaryStringEncoding.Utf8); await Windows.Storage.FileIO.ReadBufferAsync(sampleFile, buffer);
Var buffer = Windows.Security.Cryptography.CryptographicBuffer.ConvertStringToBinary( "The first sentence", Windows.Security.Cryptography.BinaryStringEncoding.Utf8); await Windows.Storage.FileIO(sampleFile);
Ah well, the timing of my response is coincidental, I wasn't actually waiting until someone posted it, but just that that was the answer I was waiting for, being the best IMO. I read the thread about a minute after your answer.
Besides, I couldn't remember what the method was called and certainly couldn't be bothered to look it up. It's Friday and I'm just observing today, not participating.
In my first C# console application I want to avoid COM problems and therefore I'm registering the IOleMessageFilter to handle any threading errors.
Well this wouldn't be a question without the problem part so here we go:
IOleMessageFilter newFilter = new MessageFilter();
IOleMessageFilter oldFilter = null;
int test = CoRegisterMessageFilter(newFilter, out oldFilter);
if (test != 0)
_isRegistered = true;
This never goes past the Debug.Fail, but I can't understand why as the message is not very explanatory by itself:
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
at SysConfig.MessageFilter.Register() in c:\...\MessageFilter.cs:line 42
at SysConfig.DTE.CreateDTE(Boolean ideVisible, Boolean suppressUI, Boolean userControl) in c:\...\DTE.cs:line 50
at SysConfig.Program.SysConfigM(Int32 i) in c:\...\Program.cs:line 163
at SysConfig.Program.SetNumberOfM() in c:\...\Program.cs:line 136
at SysConfig.Program.MenuHandler() in c:\...\Program.cs:line 48
at SysConfig.Program.Main(String args) in c:\...\Program.cs:line 26
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
What could happen?, searching about CoRegisterMessageFilter is very fun as it doesn't show a lot of information...
And... I've just copied the class from an example, and called Register()...
I'm trying to automate Visual Studio, in most cases the program flow works perfectly.
In some other cases it fails during calls to the Visual studio DTE...
In the manual from the manufacturer of the software I'm using they state that I should implement that COM Message Filter and they explain how to do it... Even they provide a sample that I've pasted directly into my code...
Anyone can see what's wrong given the message?
Should I add any dependency or similar thing into my project to get this working?
Being ultra-novice in C# I can't see where to search now...
And I truly would like not to add wait timers everywhere...
Please note that message filters can only be applied to STA-Threads and only one filter can be applied to each thread. Multithreaded apartments, for example console applications, cannot have message filters. These applications need to run in a STA-Thread to apply a message filter.
Now it seems the next step is to learn how to make a console application to run in a STA-Thread... well first I should know what is a STA-Thread...
Thank you for your answer Richard, I'll read about that GetLastError function. I guess it works like the one in C/C++ so it should be easy to get extra information.
But... reading the second link... it seems they are using a console application... let's see if I can get something there...
I have yet to take the time to learn EF, but I do have a few questions:
1). How does EF know if the data on an entity has been changed, and if so, in what way? For example, if I create a new instance of an entity, populate it, then send it to the repo, how does the repo know to do an insert instead of an up date?
2) When I query something and get back an entity, then change something on the entity, how does EF know what has changed? Does the entity contain old/new values somehow?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
There is a definite line of distinction between your operational entity and your persistent one; I think that's the piece missing in your puzzle.
Nothing is done automatically. If you want to do an upsert you generally need to code that, otherwise you're performing inserts or updates. If you want to modify a persistent entity with values on one that you've been working with, you need to pass it as an update.
Using an ORM like EF doesn't mitigate the need to have decision points about how you manipulate and update data, it just un-tethers the need to have SQL in the mix.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli