376 Posted Topics
Re: Look into abstract properties. Example: [CODE] class Program { static void Main(string[] args) { MyDerived myDerived = new MyDerived(); myDerived.ID = "A"; myDerived.TestProperty = "OK"; } } public abstract class MyBase { public string ID { get; set; } public abstract string TestProperty { get; set; } } public class … | |
Re: RecordID is an auto-incremented primary key, it allows only unique entries. Once you've executed the first time and populated that field, you cannot use that value again. Consider doing an insert statement on specific fields [CODE=mysql]Insert Into Table2 (Articlenr, Articlename) Select Articlenr, Articlename From Table1[/CODE] If it is important to … | |
Re: 1) Please use code tags! 2) See below. [code]oda.Fill("Tab3",ds); // <--- wrong order. DataSet first, string second.[/code] | |
Re: How much help are you needing? If you're needing to know what SQL functions to use, that's simple. Min, Max, Count. If you need to know the full SQL statement(s) to use, how to connect to the database and retrieve the data and then display it on the screen, that's … | |
Re: To add to what adatapost said, if you're using Visual Studio 2008 / VB 2008 Express at home, you'll have .NET 3.5. If the school is running Visual Studio 2005, it will be 2.0. If that's the case, go back through your threads and look at my suggestions and see … | |
Re: IFNULL(x, y) is a MySQL function that will return x unless it is null, in which case it returns y. I'm not sure of a SQL Server equivalent. | |
Re: Change your access modifier on x to public. [CODE]public int x;[/CODE] And then you can access individual elements like this: [CODE]theStruct[0, 0].x = 50;[/CODE] Although for all I've read, people tend to frown upon mutable value types. | |
Re: Are you getting an exception or just no data at all? In a hastily constructed scenario, I got an exception when using brackets the way you did around my parameter name. If you are getting an exception, consider changing @[WeekEnd] to @WeekEnd throughout the function. I cannot find the documentation … | |
Re: You want to design a page to be viewable across as many monitors and screen resolutions as possible without (a) breaking the format or (b) causing horizontal scrolling. With new computers and widescreen monitors, many people are opting for larger displays and greater resolutions, but there are still many people … | |
Re: To add to what vbnetskywalker posted, you can use System.OperatingSystem to get basic information. [CODE] Sub Main() Dim osInfo As System.OperatingSystem = System.Environment.OSVersion Console.WriteLine(osInfo.Platform.ToString()) Console.WriteLine(osInfo.VersionString) Console.Read() End Sub [/CODE] It's not going to spit out "Windows 7" or "Windows 2000", but you can consult the following link for more information … | |
Re: Domesticated Professionals ...all of our professionals are house-broken! | |
Re: After the first input box, you're going to want to validate that the input is an integer (you can use IsNumeric() or, better yet, Int32.TryParse()) and if it is, then proceed to the next part. If not, repop the original input box. Also check that the integer is greater than … | |
Re: [CODE] Sub Main() Dim original As String = "Reverse Me" Dim temp As Char() = original.ToCharArray() Array.Reverse(temp) Dim reversed As String = New String(temp) Console.WriteLine(reversed) Console.Read() End Sub [/CODE] | |
Re: Take a look at this example. [CODE] Sub Main() Dim mystring As String = "This is a string" Dim chars As Char() = mystring.ToCharArray() For i As Integer = 0 To chars.Length - 1 Dim c As Char = chars(i) If (AscW(c) <> 32) Then c = ChrW(AscW(c) + 2) … | |
Re: If this website is yours, you can iterate through the directory structure with an ASP.NET page. I assume by the nature of the question, however, that you're wanting to go through other people's structures. The answer is no, there is no way to get every directory in their website. You … | |
Re: On the topic of testing numerics, there is a performance penalty to using try/catch blocks as your testing method. IsNumeric is a fine VB-specific alternative. Another option and one that is available across VB and C# is the Int32.TryParse method. Consider the following code: [CODE] Imports System.Diagnostics Module Module1 Sub … | |
Re: Did you store the item in the CheckedListBox as a string or as a FileInfo? It seems as if it's a string. If so, there are 2 quick options. Rewrite the code that put the objects in the list so that they are added as FileInfo objects, or simply establish … | |
Re: To use course() in the manner that fits the implementation of the class, you would need to establish an instance of the class. [CODE] Dim mytest As New test() mytest.course = x(0) [/CODE] To use it the way you are [I]trying [/I]to use it, you would need to make course() … | |
Re: You're going to want to test if the property exists before you try calling .ToString() on it and assigning it to your variable. One method you may want to explore is the following [CODE] DirectoryEntry de = resEnt.GetDirectoryEntry(); if (!de.Properties.Contains("msExchHomeServerName")) { // code for when property does not exist } … | |
Re: HashSet<T> is something that could speed things up here. It was introduced with .NET 3.5, and it's like a dictionary but with a single field instead of a key/value pair, but it is incredibly fast for what you are trying to do due to the way it indexes things (of … | |
Re: Are you familiar with loops? For Each, specifically? How about arrays? If so, you might want to try a loop wrapped around an array of characters. You can create that array with a string's .ToCharArray() method. yourStringVariable.ToCharArray() You can then convert each individual character to an integer and do whatever … | |
Re: Look up the String.Replace(...) function. :) | |
Re: There's probably something you can do with SQL Server date formatting functions. An alternative would be to reference your date like this [CODE] string sql = "Select Count(*) From MyTable Where MyDate >= @datemin and MyDate < @datemax"; [/CODE] In this case, @datemin would be the date you want, @datemax … | |
Re: A couple of things. You're only establishing the checkbox array in the Page_Load event and not on a postback. The button click event happens during a postback. Inherently, the array will not exist for the event. I would suggest using a CheckBoxList on your presentation page instead of your approach … | |
Re: The runtime is doing integer math on your division and then casting the result to a double afterwards. As such, 2 / 12 in integer math will equal 0, and then that's what your double will store. You've already seen you can get the result you expect by casting everything … | |
Re: Check your connection string to verify you are using the appropriate format for your database and authentication settings. For a connection to a SQL Server 2008 Express database on my machine here, I use the connection: Server=********\SQLEXPRESS;Database=mysitedb;Trusted_Connection=True; For a connection to a hosted SQL Server 2005 database using SQL Server … |
The End.