376 Posted Topics

Member Avatar for scranton

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 …

Member Avatar for scranton
0
124
Member Avatar for dre-logics

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 …

Member Avatar for dre-logics
0
214
Member Avatar for rahmet

1) Please use code tags! 2) See below. [code]oda.Fill("Tab3",ds); // <--- wrong order. DataSet first, string second.[/code]

Member Avatar for rahmet
0
2K
Member Avatar for tqmd1

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 …

Member Avatar for apegram
0
111
Member Avatar for TommyTran

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 …

Member Avatar for apegram
0
92
Member Avatar for suizhun

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.

Member Avatar for apegram
0
128
Member Avatar for vivek4020

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.

Member Avatar for sknake
0
1K
Member Avatar for evanguiton

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 …

Member Avatar for evanguiton
0
158
Member Avatar for niro_fernando

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 …

Member Avatar for niro_fernando
-1
76
Member Avatar for Psychoticus

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 …

Member Avatar for apegram
0
1K
Member Avatar for rutaba
Member Avatar for rutaba
0
74
Member Avatar for TommyTran

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 …

Member Avatar for apegram
0
98
Member Avatar for TommyTran

[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]

Member Avatar for Ranx
0
94
Member Avatar for TommyTran

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) …

Member Avatar for vbnetskywalker
0
133
Member Avatar for jeeter19

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 …

Member Avatar for apegram
0
83
Member Avatar for buzzykerbox

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 …

Member Avatar for apegram
0
110
Member Avatar for Bagleys

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 …

Member Avatar for Bagleys
0
194
Member Avatar for iamai

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() …

Member Avatar for iamai
0
85
Member Avatar for stevetaylor15

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 } …

Member Avatar for stevetaylor15
0
258
Member Avatar for avirag

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 …

Member Avatar for apegram
0
234
Member Avatar for TommyTran

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 …

Member Avatar for vbnetskywalker
0
123
Member Avatar for TommyTran
Member Avatar for Mitja Bonca

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 …

Member Avatar for Mitja Bonca
0
156
Member Avatar for satiss7pwr

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 …

Member Avatar for apegram
0
103
Member Avatar for mixelplik

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 …

Member Avatar for mixelplik
0
196
Member Avatar for funfullson

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 …

Member Avatar for apegram
0
98

The End.