376 Posted Topics
Re: You haven't set the connection property of your command object. [CODE] cmd.Connection = con; [/CODE] | |
Re: We got there during the Clinton years. Not sure exactly how, but it happened. And then tax cuts, two wars, economic malaise, complete meltdowns, etc. You know, end of the world type stuff. It really went south quick, didn't it? | |
Re: You're testing it on the text changed event for each of the textboxes, but you're testing each textbox at the same time. Naturally, when you put a number in the first textbox but the second and third are still empty, those textboxes will fail the test and you'll get your … | |
Re: If reverse() is a void, then it's not what you want to pass into a println call. Further, if the signature of reverse is [ICODE]void reverse(int units)[/ICODE], then you need to pass in an integer in order to be able to use it. I don't know what the intent of … | |
Re: adatapost is a beast on the .NET forums. If a thread goes ignored for any length of time, count on adatapost to post [i]something[/i] for the thread starter, even if it is just a link to where more information is available. Of course, many of the threads are all the … | |
Re: [CODE] Elemente hidrogen = new Elemente(); [/CODE] Move this inside of your button click handler. As you're doing it now, you're instantiating it outside of the handler and then showing it inside. When you close the form, the instance has been disposed. That's the error you're getting, trying to work … | |
Re: You can build your website look and design in anything. At my place of employment, all of the designers work in Dreamweaver, and then I have to go through the mess of HTML that Dreamweaver creates and insert the dynamic functionality that the project requires. It doesn't matter where the … | |
Re: Dates need to be delimitted, like strings. In Access, the standard delimitter for a date is the pound (#) sign. [CODE] sql = "SELECT * FROM tblStudents WHERE theorydate >= #" & theorydateexpired & "#" [/CODE] The other option is to use a parameterized query. [CODE] sql = "SELECT * … | |
Re: You can develop a web service in ASP.NET and consume it in a desktop application written in C#. Deploy the web service, add a service reference in your C# app, and off you go. | |
Re: That basically means the web.config file supplied with BlogEngine.NET includes some settings that are application-level. The fact that you are seeing the error means that you have the blog off of the root directory of your site, probably like the following? [url]www.yoursite.com/blog[/url] Is that correct? If so, the blog subdirectory … | |
Re: You can add an event handler to the calendar's SelectionChanged event to validate the date. Example: [CODE] <form id="form1" runat="server"> <div> <asp:Calendar ID="calDemo" runat="server" OnSelectionChanged="calDemo_SelectionChanged" /> <asp:Label ID="lblDemoError" runat="server" ForeColor="Red" /> </div> </form> [/CODE] [CODE=vb.net] Protected Sub calDemo_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs) Dim selectedDate As DateTime = … | |
Re: Welcome to DaniWeb. Is this for a class? Have you been introduced to loops at all? There are a number of ways you could potentially tackle this problem. Try something, try to think and program through it yourself. If you get stuck, post your code and let us see where … | |
Re: Please use code tags! The formula for a conversion to Celcius would be C = (F - 32) / 1.8 So the boiling point of water would be (212 - 32) / 1.8, which would evaluate to 100. Incorporate that into your code. | |
Re: [CODE] PostcodeArray(ArraySize) = nextPostcode; [/CODE] That's not how you work work with an array. Use square brackets instead of parentheses. However, for this particular exercise, the array simply is not going to suit your needs. List<T> of the System.Collections.Generic namespace would be more appropriate. An example usage is below. [CODE] … | |
Re: If someone asked me about the binary search bug, I'd assume they werre talking about a new computer virus being attached to grandma's email. To be honest, if someone asked me to [I]write[/I] a binary search routine on a white board, I'd stare at them blankly and assure them that … | |
Re: [QUOTE=bombasstic;1128206]and so, i have a division, beetween 2 integer, i need that the result number has only max 1 number after comma, how?[/QUOTE] Look into Math.Round if you want to keep the value as numeric or number.ToString(format) if the result can be a string. | |
Re: Show us what you have written so far! | |
Re: Maybe look into regular expressions. Example: [CODE] Sub Main() Dim rgx As New System.Text.RegularExpressions.Regex("^[a-zA-Z]+$") Console.WriteLine(rgx.IsMatch("ABC")) Console.WriteLine(rgx.IsMatch("A12")) Console.Read() End Sub [/CODE] | |
Re: [QUOTE=nasir.ud;1127071]here are the code for insert into database byte[] data = null; FileInfo fInfo = new FileInfo(sPath); long numBytes = fInfo.Length; FileStream fStream = new FileStream(sPath, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fStream); data = br.ReadBytes((int)numBytes); return data;[/QUOTE] You should be able to cut that down to a single line … | |
Re: Is Total supposed to be a running sum or is it simply the current total as reflected by the current credit and debit amounts? In either case, I would look up [B]triggers[/B] and modify your Total value whenever a row as updated. | |
Re: Here's an example in VB and C#. This is adapted from the [URL="http://blogs.crsw.com/spence/articles/1595.aspx"]first result[/URL] I found in google for "create code on the fly C#". [CODE] Imports System.CodeDom Imports System.CodeDom.Compiler Imports System.Reflection Module Module1 Sub Main() Dim provider As CodeDomProvider = New Microsoft.VisualBasic.VBCodeProvider() Dim compiler As ICodeCompiler = provider.CreateCompiler() Dim … | |
Re: As another suggestion, what sense does it make to try to divide 11212 by 11211? That's what would happen as a result of your loop [CODE] for (int i = 2; i < number; i++) [/CODE] Think about what would actually be a good [I]lesser-number[/I] to test through. When could … | |
Re: Do you ever have a statement to the effect of [CODE] GraphData = trackGraph; [/CODE] or vice versa? Because from that point forward, you'll be referencing the same object in memory (or so the program will have you believe). [CODE] class Program { static void Main(string[] args) { CoOrdData GraphData … | |
Re: 1) Please type in complete English with proper punctuation. 2) We don't do your homework for you, please post what you already have written and/or specific sections that are giving you difficulty. | |
Re: I assume this is an ASP.NET implementation using C#? Here is an example of toggling on/off a button based on a checkbox. [CODE] <%@ Page Language="C#" AutoEventWireup="true" CodeFile="checkboxdemo.aspx.cs" Inherits="checkboxdemo" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> function activateButton(chk) { … | |
Re: [CODE=vb]ActiveWorkbook.SaveAs(fileName)[/CODE] | |
Re: [QUOTE=tjsail;1121453]the sample text is the variable hitInput. What I am looking to gather is The two names ("Guardian of Water" and "Kyton's Rebuke [BH]"), the *hit* (minus the *'s) and the first 108. and when you say "build it incrementally" what do you mean? TJ[/QUOTE] He means start small and … | |
Re: You've probably been in a programming class for a few weeks, right? What have you learned so far and how do you think you could apply it to this assignment? Start with that, and post it if you get stuck. Then we may be willing to point you in a … | |
Re: Gosh, I didn't see that coming. | |
Re: The problem is in your cases inside the switch. Specifically, you're missing a space between "case" and the value your testing for. | |
Re: You're selecting two non-aggregated fields and only grouping on one. For the query to execute properly, you need to group on each field that is not an aggregate or a function. But as for this example, consider dropping the Group By clause in favor of Select Distinct. | |
Re: My password is always the day of the week my password was created. I tell people that, too, because it's not like they'll know what day of the week I created it. That makes it secure. Extremely secure. | |
Re: That would be expected for reference types, but not for value types. Sounds like it could be an order-of-operation problem, don't you think? Post the code, let's see what's going on. | |
Re: [QUOTE=upadhyayakta;1123720]hi i need code for some programme.[/QUOTE] [code=c#] using System; class Program { static void Main(string[] args) { Console.WriteLine("Hello World"); } } [/code] EDIT: [code] Imports System public Class Program Shared Sub Main() Console.WriteLine("Hello, World!") End Sub End Class [/code] That's an open source program, by the way. Use it … | |
Re: Use the StreamWriter class. [CODE] Dim writer As New System.IO.StreamWriter(fileName, False, System.Text.Encoding.Default) [/CODE] | |
Re: You may be looking for the TimeSpan class. DateTime.Subtract(another Date) will return a TimeSpan, and from that you can obtain the difference in hours, minutes, seconds, etc. Example: [CODE] Dim startTime As DateTime = New DateTime(2010, 2, 5, 18, 0, 0) Dim endTime As DateTime = New DateTime(2010, 2, 5, … | |
Re: [QUOTE=ticktock;1121549]Oh so that's what it's called, I'm sorry sir, I thought that if I created a class of my own (or data type?) I could call it an abstract data type. Deeply sorry.[/QUOTE] An abstract class is a class that is not meant to be instantiated on its own but … | |
Re: The problem could be here. [CODE] string sqlEmployeeSearch = "Select F_Name from tblEmployee WHERE F_Name = "+txtUsername.Text+""; [/CODE] In your Access database, the F_Name is probably text, correct? Assume the value of txtUsername is DaniWeb. Your constructed SQL statement would be [CODE=mssql] Select F_Name from tblEmployee Where F_Name = DaniWeb … | |
Re: [QUOTE=Helium;1121852]Is this for orcale? I'm using MYSQL :) any way this dose not make it. It should be something like UPDATE table SET id = id + 1 the id + 1 should be something that make the value increase Sequentially[/QUOTE] That would be for SQL Server, as you asked … | |
Re: That code isn't converting the field to a datetime, but to a char(10). Replace char(10) with DateTime and see what you get. Your date format is going to cause a problem when doing the default conversion. However, by consulting [URL="http://msdn.microsoft.com/en-us/library/aa226054(SQL.80).aspx"]this link[/URL] you can see the proper numeric code to use … | |
Re: [QUOTE=mikeandike;1121528]Hi, How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria - Thanks[/QUOTE] Have you not been introduced to If-Then-Else blocks? [CODE] If (Condition) Then Do Something Else 'Optional Do SomethingElse End If [/CODE] | |
Re: Look into ADO.NET. Specifically, the database connection, data adapter, and command objects. Find out what type of database you will be working with (Access? MySQL? SQL Server?) and the best family of objects to use to connect to the database. Next, look into methods to retrieve the data. DataReaders are … | |
Re: [QUOTE=bonnysammy;1117924]I need it displayed within a table. Is there a way to add the button this way and still have it in a table?[/QUOTE] You can put an asp: PlaceHolder element wherever you want the radio buttons to appear on your page and give it an ID. Example: [CODE] <div> … | |
![]() | Re: I believe what you want to do is use the FindControl method. You can programmatically piece together your control's ID and then retrieve that control. This is an example: [CODE] <div> <asp:Button ID="btnDemo" runat="server" OnClick="btnDemo_Click" Text="Demo" /> <asp:Button ID="btnTarget" runat="server" Text="Target" /> </div> [/CODE] [CODE=C#] protected void btnDemo_Click(object sender, EventArgs … ![]() |
Re: [CODE] string url = "http://www.google.com" HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string output = reader.ReadToEnd(); [/CODE] That's a quick way to get your content. As for parsing it out, you can probably look into regular expressions or, as you said, simply doing it … | |
Re: There should be a many-to-many relationship between services and orders. You would implement that with a joining table. [B]Service[/B] IDService (+whatever other fields relevant to the service) [B]Order[/B] IDOrder (+whatever other fields relevant to the order) [B]OrderedServices[/B] IDOrderService IDOrder IDService (+whatever other fields relevant to the line item) So for … | |
Re: System.Globalization has support for many calendars of the world, but I don't know if an Ethiopian calendar is among them. You may need to define your own struct to represent a date. The following code sample is in C#, and I apologize but I do not have a moment to … | |
Re: [QUOTE=rohini.vangury;1119387]its not corrupt the stack trace gives the following error: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length any1 any idea's?[/QUOTE] That's not much of a stack trace to go on. What's leading up to that? If you could post the full stack trace of the error and … |
The End.