Posts
 
Reputation
Joined
Last Seen
Ranked #139
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
96% Quality Score
Upvotes Received
198
Posts with Upvotes
153
Upvoting Members
59
Downvotes Received
5
Posts with Downvotes
5
Downvoting Members
5
68 Commented Posts
~174.22K People Reached
About Me

I am a web developer that deals mostly in .NET and C#. My prior background was working in VB6 and VBA. I know my way around data and code, but I'll not pretend to know as much as I want to know.

Interests
Programming! Music and video games.
PC Specs
Dell Studio 17 laptop running Windows 7, plenty powerful enough for my needs.
Favorite Tags
vb.net x 110
c# x 36
xml x 18
mssql x 14

376 Posted Topics

Member Avatar for Duki

I went out for a salad for lunch, came back with a stromboli. Hey, it happens. Washing it down with a nice, tasty Coke.

Member Avatar for Dani
22
17K
Member Avatar for zambetta

[CODE] List<int> list = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; Random random = new Random(); var sortedList = list.OrderBy(i => random.Next()).ToList(); foreach (int i in sortedList) Console.WriteLine(i); // split list into 2 var group1 = sortedList.Take(5); var group2 = sortedList.Skip(5).Take(5); Console.Read(); [/CODE]

Member Avatar for adajames
0
1K
Member Avatar for mikecole79

In VBA, there is/was an ActiveCell.Offset method, but it was more complicated than that. It would be ActiveCell.Offset(rowcount, columncount).Range("A1").Select. The "A1" was sort of like a grounding value, giving it the proper frame of reference. That may or may not be proper description for it, but I knew whenever I …

Member Avatar for jackflint
0
435
Member Avatar for elmbrook

[CODE] Type type = Type.GetType("WindowsFormsApplication1.Form2"); object obj = Activator.CreateInstance(type); (obj as Form).Show(); [/CODE]

Member Avatar for mohamed.a.salim.31
0
946
Member Avatar for jazz_vill

[QUOTE=jazz_vill;1120831]Ok here's my code: is there another way to improve this code? so I dont have to this routine in every letter?[/QUOTE] The ASCII values for A-Z are 65 to 90. You could loop over those integers to search for your characters. Easier still, you could create a string of …

Member Avatar for Reshma_2
0
2K
Member Avatar for Damon88

Does this proof of concept fit your needs? [CODE=C#] static void Main(string[] args) { string fileName = @"C:\Work\test.bmp"; string fileNameCopy = @"C:\Work\test2.bmp"; Byte[] buffer = File.ReadAllBytes(fileName); MemoryStream stream = new MemoryStream(buffer); try { File.Delete(fileName); Console.WriteLine("Original file deleted."); } catch { throw ; } Bitmap bitmap = (Bitmap)Bitmap.FromStream(stream); bitmap.Save(fileNameCopy); bitmap.Dispose(); stream.Dispose(); …

Member Avatar for dwimage
0
2K
Member Avatar for yobotiks

Here's a way of doing it. It involves creating a public function to update the list data in your main form, and creating a constructor overload in the second form to accept a parameter of the type of the main form. Then on a button click event on the second …

Member Avatar for ddanbe
0
2K
Member Avatar for mercury113

[CODE] Dim result As DialogResult = MessageBox.Show("Some text", "Some caption", MessageBoxButtons.OKCancel) If result = Windows.Forms.DialogResult.OK Then 'do something ElseIf result = Windows.Forms.DialogResult.Cancel Then 'do something else End If [/CODE]

Member Avatar for avtaars
0
222
Member Avatar for JamesGeddes

You should probably look at writing a web service. Create the service on your website, add a reference to it in your offline project (it will generate the proxy classes you need), and then you can interact with it. Here's a sample web service implementation: [CODE] using System.Collections.Generic; using System.IO; …

Member Avatar for softwareskill
0
770
Member Avatar for buffalo0

Here is a method to read it using LINQ to XML (System.Xml.Linq). This will create an IEnumerable(of T), where T is an anonymous type. [CODE] Sub Main() Dim xml As String = "<?xml version=""1.0"" encoding=""utf-8""?>" _ & "<pupil>" _ & "<name>Test Name</name>" _ & "<tagid>00000000000000000001</tagid>" _ & "</pupil>" Dim document …

Member Avatar for softwareskill
0
5K
Member Avatar for ncaatrackstar

You can use reflection to load an assembly at runtime. Consider this code compiled into Foo.dll [CODE] namespace Foo { public class Bar { public string Blah() { return "Blah"; } } } [/CODE] And then in another program [CODE] using System; using System.Reflection; class Program { static void Main(string[] …

Member Avatar for BhuvanRam
0
561
Member Avatar for mania_comp

This is the first I've heard of this, but stackoverflow says it happens when you use the publish utility within Visual Studio. I have no idea if that's true or not. [url]http://stackoverflow.com/questions/2148125/why-does-app-offline-htm-keep-appearing-in-my-web-project[/url] From a link off that link, there's also this blurb "SQL Server 2005 express edition does not support …

Member Avatar for anandd
0
2K
Member Avatar for ddanbe

I don't know how applicable this may be, but it's interesting nonetheless. Here's an article on using GDI+ and doing color transformations with a matrix of floats. [url]http://www.aspfree.com/c/a/C-Sharp/Performing-Color-Transformation-Operations-in-Csharp-GDIplus/[/url] I also don't know of any (other) methods to tweak colors besides, as you said, simply messing with the RGB values. As …

Member Avatar for pvladov
0
1K
Member Avatar for sillyboy

Right now, I'm listening to a compilation of various Royksopp tracks off the Melody AM, The Understanding, and Junior albums.

Member Avatar for Helianthus
0
5K
Member Avatar for panpwintlay

My algorithm below is similar to what slogfilet suggested: I consider using anything beyond the square root of the integer candidate to be redundant and a waste of time to use as a test divisor. I'm not accepting user input, nor am I writing the prime numbers to the screen, …

Member Avatar for Momerath
-1
1K
Member Avatar for prakashmca07

DataGrids, Repeaters, etc., do not have to be used with database connections, they can be bound with other collections. Take this example: [CODE] <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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></title> </head> <body> <form id="form1" runat="server"> <div> <asp:DataGrid …

Member Avatar for rispy
0
123
Member Avatar for amby

Your assumption is correct. [CODE]StringBuilder[] empDetails = new StringBuilder[100];[/CODE] This line establishes an array of StringBuilder references, but you still need to create instances of objects for each array element (*or at least any element you intend to actually use). [CODE] for (int i = 0; i < empDetails.Length; i++) …

Member Avatar for Brindha.s
0
223
Member Avatar for adkool

I use IE mostly, FF occasionally (usually just to test something). IE meets my needs.

Member Avatar for crunchie
2
896
Member Avatar for kat-spn

1) Don't assume the input should be an integer. If you want to calculate the number of coins required, you should allow for dollars [I]and[/I] cents. Use a [ICODE]double[/ICODE] or [ICODE]decimal[/ICODE] data type instead. 2) For validation, use the .TryParse(string input, out result) method. The method itself returns a bool, …

Member Avatar for Chaitanya Dhote
0
955
Member Avatar for Gaurav arora

Here is an example using an order table. You take the top 1 from the top N [I]in reverse order[/I]. [CODE] select top 1 OrderTotal From (select top 10 OrderTotal from orders order by ordertotal desc) x Order By x.OrderTotal [/CODE] Let's say my top 10 OrderTotals (in descending order) …

Member Avatar for crishlay
0
248
Member Avatar for akamini

[CODE] sql = "SELECT * FROM tblBookings WHERE StudentID = " & Target And "Paid =" & Target2 [/CODE] The word [I]And[/I] should be inside your quotes. [CODE] sql = "SELECT * FROM tblBookings WHERE StudentID = " & Target & " And Paid = " & Target2 [/CODE] And …

Member Avatar for raffy3
0
346
Member Avatar for expvice

Is there a reason you want to convert the pages from programmable ASP.NET to static HTML? I would use a URL rewriting solution instead to get all the programmability of ASP.NET while also having SEO-friendly URLs. There are canned solutions available (built into IIS7 or you can use a tool …

Member Avatar for elaek
0
198
Member Avatar for jake1496

My favorite game of recent months is Dragon Age: Origins, which I played on Xbox 360 but it also available on PC and PS3. Mass Effect 2 (360 and PC) is also a good recent game. All time? I'm going with Star Wars: Knights of the Old Republic. [I]This post …

Member Avatar for davidlouis88
-8
863
Member Avatar for ana12
Member Avatar for Ancient Dragon

That reminds me of a video from a few years ago that has unfortunately been taken down from youtube and I can't find it elsewhere. The short version is that a guy tied a rope to his truck and dragged a GameCube along the road for several miles, with it …

Member Avatar for dexter737
0
164
Member Avatar for zortec

I had a Mazda Protege once. It was a good little car; it had 225,000 miles on it when I traded it in towards a new car a few years ago. This was a 1994 Protege, so I can't attest to current quality, but that one served me well.

Member Avatar for dexter737
0
361
Member Avatar for ana12

I went to a doctor for medical advice and a healthy eating recipe. He gave me green eggs and spam. Should have known not to go to Dr. Seuss.

Member Avatar for dexter737
-5
219
Member Avatar for ana12

I think a good time to have pasta would be during breakfast. Would you agree, ana12?

Member Avatar for dexter737
-11
324
Member Avatar for cwarn23

[QUOTE=GrimJack;1102621]Most common computer problem is the interface between the chair and the keyboard[/QUOTE] Ah, ye olde PEBKAC error.

Member Avatar for efmesch
1
175
Member Avatar for PierlucSS

I wouldn't use a repeater to generate XML, but that's just me. If you want to continue down that path, I would advise you to explore the repeater's ItemDataBound event and take care of the binding of the second repeater within the code behind of the page. As for another …

Member Avatar for sohelelite
0
124
Member Avatar for faizahamed

sir i want you to show some effort and [URL="http://www.daniweb.com/forums/announcement58-2.html"]read the rules[/URL]

Member Avatar for Nick Evan
0
120
Member Avatar for Ancient Dragon
Member Avatar for thewannabe

You can use LINQ to XML (System.Xml.Linq namespace) to parse the XML file. [CODE] string xml = @"<rsp stat=""ok""> <photos page=""1"" pages=""8951"" perpage=""100"" total=""895061""> <photo id=""4503248539"" owner=""33965274@N08"" secret=""b60e5fcc27"" server=""2774"" farm=""3"" title=""alright, tia"" ispublic=""1"" isfriend=""0"" isfamily=""0""/> <photo id=""4503259303"" owner=""49065542@N00"" secret=""1765234706"" server=""4053"" farm=""5"" title=""French Bulldog"" ispublic=""1"" isfriend=""0"" isfamily=""0""/> <photo id=""4503856822"" owner=""33703729@N08"" secret=""36e52001bc"" …

Member Avatar for microtrends
0
313
Member Avatar for thuyson

Try casting the left side. [CODE] if((bool)dataGridView1.Rows[i].Cells["Checked"].Value ==true) [/CODE]

Member Avatar for andrewll2
0
271
Member Avatar for neithan

Did not read the whole thread, but about the Next(0, 1), if you read the intellisense documentation, you should notice that the second parameter (the 1, in this case) is the *exclusive* upperbounds. You are in essence asking for a random integer between 0 and 0. If you want 0 …

Member Avatar for apegram
0
91
Member Avatar for Code_GrasssHopp

[CODE] // given array and filename string[] array = { "apple", "banana", "cherry" }; string filename = @"C:\Temp\arrayfile.txt"; // short version using (StreamWriter writer = new StreamWriter(filename)) { foreach (string item in array) writer.WriteLine(item); } // short, short version File.WriteAllLines(filename, array); [/CODE]

Member Avatar for Code_GrasssHopp
0
707
Member Avatar for Kekosavar

[CODE] // option 1, use where clause to filter and AddRange to append non-null items to existing list List<Example> list = new List<Example>(); list.AddRange(data.Where(item => item != null)); // option 2, use where clause to filter data and then convert to list List<Example> list = data.Where(item => item != null).ToList(); …

Member Avatar for Kekosavar
0
94
Member Avatar for niemo

Here are two methods, one being a LINQ one-liner, the other being similar to Edward's with a dictionary. [CODE] static T GetMostFrequentWithLinq<T>(IEnumerable<T> list) { return list.GroupBy(val => val).OrderByDescending(grp => grp.Count()).Select(grp => grp.Key).First(); } static T GetMostFrequent<T>(IEnumerable<T> list) { Dictionary<T, int> dictionary = new Dictionary<T, int>(); int maxCount = 0; T …

Member Avatar for EricTetz
0
1K
Member Avatar for EricTetz

Look at the generic Func<TResult> delegate system. You can do something like this [CODE] class Program { static void Main(string[] args) { Func<int> function = GetFunction(); Console.WriteLine(function()); Console.Read(); } static Func<int> GetFunction() { return () => Foo(); } static int Foo() { return 1; } } [/CODE] For more info, …

Member Avatar for EricTetz
0
359
Member Avatar for procomp65

So just so we're clear, you have a string, you split it up into chunks of 4 characters each, but it's basically an array of strings? Why not just loop through the elements, test each one, and for each one that contains an illegal character, simply set the element equal …

Member Avatar for AnthonyMG
0
149
Member Avatar for papanyquiL

You have never created an instance of StreamWriter. Your declaration is [CODE]public static StreamWriter writer;[/CODE] In the IrcBot class, but you've never at any point said [CODE] writer = new StreamWriter(somepath); [/CODE] Or otherwise obtained a StreamWriter instance. Fix that error, give it another try, and report back if you …

Member Avatar for papanyquiL
0
138
Member Avatar for coop123

[CODE] DateTime.Now.ToString(); // want hours, minutes, seconds only? DateTime.Now.ToString("HH:mm:ss"); [/CODE]

Member Avatar for apegram
0
87
Member Avatar for DaveTran

No, || and && will short circuit. In an ||, if the left hand side evaluates to true, there is no need to evaluate the right hand side. Similarly, if the left evaluates to false in an &&, the right also becomes a useless check. As such, each will short …

Member Avatar for DaveTran
2
200
Member Avatar for nsutton

Try something like [CODE] Random random = new Random(); int index = random.Next(0, array.Length); // list.Count for List<T> string value = array[index]; // where array is string[] [/CODE]

Member Avatar for nsutton
0
744
Member Avatar for bbman

If an object you use implements the IDisposable interface and has a Dispose method, you want to be in the habit of using it so the object can clean up its resources. The recommended way of doing so is to simply wrap the usage of the object in a using …

Member Avatar for apegram
0
104
Member Avatar for sdhawan

If you could describe your problem a bit more. But in general, if you are adding reference types as keys, the comparison is going to be made between references rather than the unique nature of the information being referenced. For example, if I have a Hashtable where I am storing …

Member Avatar for sdhawan
0
117
Member Avatar for Nerathas

Try something like this [CODE] static int GetSumOfPositiveValues(int[] array, int index) { int sum = 0; if (index < array.Length - 1) sum += GetSumOfPositiveValues(array, index + 1); if (array[index] > 0) sum += array[index]; return sum; } .. int[] array = { 10, -5, 5, -6, -9 }; int …

Member Avatar for apegram
0
113
Member Avatar for surajrai
Member Avatar for apegram
0
140
Member Avatar for epicasian

Sure, consider this example. [CODE] string input = "0008 0006 0007 0005 0003 0000 0009"; int[] array = input.Split().Select(s => int.Parse(s)).ToArray(); foreach (int i in array) Console.WriteLine(i); [/CODE]

Member Avatar for JOSheaIV
0
119
Member Avatar for Nerathas

There may be a better method than this. In fact, I'm almost positive I've seen one, but here's an idea. This one uses .NET 4 and the new Tuple, but it can be easily adapted to use a concrete class or perhaps out parameters. [CODE] using System; using System.Collections.Generic; using …

Member Avatar for Sodabread
0
136

The End.