41 Archived Topics
Remove Filter There has been a noticeable increase in people asking where to start C# recently. So I have been across a couple of forums and pulled together a list of some useful links and resources. # Web Tutorials # [Home and Learn Tutorial](http://www.homeandlearn.co.uk/csharp/csharp.html) [CodeProject Tutorial P1](http://www.codeproject.com/Articles/219869/Object-Oriented-Programming-in-Csharp-NET) [CodeProject Tutorial P2](http://www.codeproject.com/Articles/222295/Object-Oriented-Programming-in-Csharp-NET-Part-2) [CodeProject Tutorial … | |
I am currently creating a product lookup system for a project of mine, however from reading around it has come to my attention that an OLEDB connection will not handle the SQL query below as it will not handle more than a simple "SELECT, FROM". Table: tbl_ProductInformation Field: Product_Name CurrentEntry … | |
Howdy I have a timespan that contain in excess of 24 hours. For the example lets use a value of 1 day 6 hours and 32 minutes. I would like to get this into a string that displays "30:32". Have so far tried something along the lines of `string.Format("{0}:{1}", TimeSpan.TotalHours, … | |
Using code from StackOverflow: HttpWebRequest webRequest; void StartWebRequest() { webRequest.BeginGetResponse(new AsyncCallback(FinishWebRequest), null); } void FinishWebRequest(IAsyncResult result) { webRequest.EndGetResponse(result); } How do you access the response to the request? | |
Hi So I have a silverlight 5 front end and some PDF generating code that is not silverlight compatible and so needs to sit server side and is called via WCF. I am struggling to work out how to return the PDF data back to the silverlight application and effectively … | |
Ok time for the 2nd dumb question of the day that I should probably already know the answer too.. I have `string.Format(" {0, -22} | {1, 5} of {2, -5} | {3, 5}% | ` where `{3}` is a double that is being used for a percentage. The longest allowed … | |
So I have recently come across `string.Format("{0, x}", "Word")` for aligning strings, with demonstration code that works fine in the CMD. Does this also function correctly when pumping text to a label? I am finding that it does not behave as expected and instead misaligns the text. Using an example … | |
I've inherited some code utilising the bootstrap framework. I'm currently seeing some odd behaviour where no matter what date was last picked, the date picker always seems to open showing the month of July. Is there any particular places in the code I should be looking to see if anything … | |
Howdy So I have a set of data coming back from a process with five different pieces of data per entry in the set. Are there any fancy ways you can generate some kind of look-a-like report on the fly in WCF, else what would be the best way to … | |
I have the following $subUsername = trim($_POST["user"]); $sql = "SELECT userID, username, password FROM user WHERE username = ':user')"; $q = $conn->prepare($sql); $q->bindParam(':user', $subUsername); $q->execute(); $result = $q->fetch(PDO::FETCHASSOC); print_r($result); echo "</p>"; print_r($subUsername); echo "</p>"; print_r($subPassword); However `$result` is always just an empty array, if I run the SQL on the … | |
Me again... So now I am confused... I have a form: <form action="addanimal_submit.php" method="post" enctype="multipart/form-data" style="padding-left:10px"> <p>Name: <input type="text" name="name"></p> <p>Date of Birth: <input type="text" name="dateofbirth"></p> <p>Description: <input type="text" name="description"></p> <p>Available For Adoption? <select type="text" name="available"> <option value="1" selected>Yes</option> <option value="0">No</option> </select> </p> <p>Image Of Animal:</p> <p><input type="file" name="fileToUpload"></p> <input … | |
So I currently have a listbox which dynamically generates its members from the database. It has name and id set to "availablePets". When one of the items in the list is clicked I want to populate some other fields on the screen by quering the database for the rest of … | |
Think I am going mad here.. So I have a working website setup in IIS. This was all configured by a previous developer. We have a set of reports that you can browse to by going to localhost/Reports/ReportName, the underlying directory structure in IIS is actually Reports/Views/ReportName/index.cshtml. I have added … | |
Hi All We are having an issue where a WSDL is loading another WSDL into it when we call it. This call takes a while on the first call which normally causes failures across the application during testing. One option we are looking into is pre-caching the WSDL in IIS … | |
... but I can't for the life of me figure it out. I have an object that comes from an application which has a Status property, and within that property is Name and Key. So I can do things like `object.Status.Name = x`. I have created another of these objects … | |
So I am currently working with custom silverlight extensions for a SAP application. The extension kicks off a an async WCF request and waits for the response. During which time I try the following: waitWindow = new RadWindow(); waitWindow.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterScreen; waitWindow.BorderThickness = new Thickness(0); waitWindow.Content = new View.WaitWindowTest(); waitWindow.ShowDialog(); … | |
So I am currently working in ASP.Net and a bit stuck. I obtain the full html that I wish to render into the tab from a WSDL request and then need to find a way to load a new tab in the browser and display that information. I have currently … | |
Doing some revision for a university exam being sat at the end of the week. Got my head around most of the BigO stuff I think apart from calculating the BigO equations like the below. T(n) = 1000040 T(n) = 45n^2 + 3n/1000 + 18(log n) Could anyone explain the … | |
IQueryable<CustomObject> obj = (from table in db.TableName orderby table.ObjectId descending select new CustomObject { //Properties mapped here }).Skip((pageNumber - 1) * pageSize).Take(pageSize); The above is a stripped down version of the query I am running. It is missing about 10 joins and then just the bulk mapping of the object, … | |
Quite rare to see me post in the Java forum but have been picking it up as part of a long-distance university course I am doing. I am currently trying to read in an ASCII coded .txt file and output it but am seeing some funny characters showing up. The … | |
Other half's laptop just trying to clean it up a bit as very slow. Do these logs look okay? Have deleted all the stuff flagged up in the malware scans but they just seemed to be some social search engine rubbish. Any pointers appreciated in advance, Mike | |
I've been toying with some code for the last thirty mins to try move a substring from one cell to another. In debug I can see the correct contents being picked up and moved to the new cell and even got a save prompt popup when running over line 31. … | |
So after seeing the typing test Dani so kindly made the other day and put on the site I decided to kill some time writing a simple application to practice my typing on. I have a RTB containing the text which I'm highlighting as I go type letters to show … | |
Afternoon all, I currently am loading an XSD file from a physical file into memory to validate an XML file. However on loading the file it is containing such escape characters as `\r\n` to keep the formatting the document was originally in. This then causes an exception when loading the … | |
This will sound like a homework assignment, it sort of is, but isn't. Anyway! I have created a simple address book application with a CSV backend. This utilises a Person class to store the contacts details and an AddressBook class storing the list of Person. Within the code we have … | |
The following suggestions will help the process of answering threads in the most efficient manner. 1. Do not hijack other member's threads, you will not get replies, instead start your own question. 2. What have you tried? We are not here to mock mistakes and showing effort made will make … | |
Say I have the below example, the syntax is based off constuctor chaining for clarity (and my cluelessness). public static void Feed() : this("Unknown"){} public static void Feed(string FoodType) { if (Food != "Unknown") Console.WriteLine("{0} eats some {1}.", Name, Food); } How would I actually implement this for methods? It … | |
I am currently running a live 'in-memory' XSLT transformation using the following code XmlDocument XmlDoc = new XmlDocument(); XmlDoc.LoadXml(DS.GetXml()); XslCompiledTransform XsltTranformation = new XslCompiledTransform(); XsltTranformation.Load(@"C:\Users\maskew\Desktop\XSLTMapping.xsl"); Stream XmlStream = new MemoryStream(); XmlDoc.Save(XmlStream); //Stream is still blank after this line XmlReader XmlRdr = XmlReader.Create(XmlStream); MemoryStream stm = new MemoryStream(); XsltTranformation.Transform(XmlRdr, null, stm); … | |
So me and a colleague at work are trying to decide upon a mini-project to do, simply to see how differently we would code it. Has anyone got a good resource for such ideas, or even have some themselves, that are semi-challenging and do-able in about a day? Cheers, | |
I'm after some advice really. I wish to create an application for myself and a friend using DropBox as a means to store and sync a CSV with data in. Is it possible to programatically search through a computers directory to locate folder called 'Dropbox' without hardcoding its location? If … | |
Does anyone know if this is possible and if so how I would go about it, as it has currently got me stumped completely! Thanks in Advance, Mike | |
Firstly I will say im a complete and total novice when it comes to XSLT and XML so this could be a very obvious mistake on my behalf. [CODE] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="node()"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="TestNode"> <RenamedNode> <xsl:copy-of select="."/> </RenamedNode> </xsl:template> </xsl:stylesheet> [/CODE] When … | |
I currently need to be able to read through an XML document, find certain nodes and either delete them (and child nodes) or edit the nodes name and possibly value. What would be the best way of going about this? XPath? XSLT? XMLReader/XMLWriter? My Code/XML contents cannot be posted though. | |
Hi all, I am looking to have a long process running in the background to my main form with a timer ticking on the main form animating the elipsis on the end of some text. Was looking for some insight into the best way to go about this and any … | |
Hi there, I have two tables in my data entity model accessed by StaffDB. Staffs contains: StaffID FirstName LastName Address Town County Postcode YearJoined CurrentGrade Role Ratings contains: RatingID StaffID Date Rating1 (automatic to avoid conflict with table name also of rating) Comments These are linked by StaffID. I am … | |
Hi all, The project I am currently working on is an Address Book which works off a csv (specification takes the mick as a database would be so much easier), the method to write the lines of information into the CSV is in the class DataLayer and takes a String: … | |
Hi all, My program is proving Kaprekar's Constant - 6174. To do this I will need to store values exactly how they come out without losing any preceding 0's which int has a habit of cutting off. For example: Number to store exactly: 0147 Int stores: 147 A googling session … | |
The code for this is: [CODE=VB.NET]'IMAGE HANDLING Dim bytes() As Byte = DS.Tables("Location").Rows(0).Item(4) Dim ProductImage As Image = Image.FromStream(New System.IO.MemoryStream(bytes)) pic_ProductImageDisplay.Image = ProductImage pic_ProductImageDisplay.Load()[/CODE] The error occurs line 3 stating "ArgumentException was unhandled: Parameter is not valid." Any idea on a solution to this problem? ![]() | |
My project I am working on is a product location system for a large supermarket. My current issue is that the map I am using to display the product location is assembled from rectangle objects which I will then change the colour of when required. The array storing the locations … | |
The program is currently trying to pull information from three different database tables and compiling the information onto one screen, to do this i am using three different connections and a function to handle the data at each stage. The issue is as my code hits PageLoadStage of "2" and … | |
As the title suggests, i am trying to pull a bitmap image stored in a table location with an OLEObject type to my picture box on the form. The code i am using is as following: [CODE=VB.NET]img_ProductPicture.Image = DS.Tables("LocationInfo").Rows(0).Item(5)[/CODE] The error i am receiving is an InvalidCastException: Unable to cast … |
The End.