646 Posted Topics

Member Avatar for bpacheco1227

You can sort three numbers without an array. But your prof/teacher may have wanted an array-based solution. So put those numbers in an array and you have a solution which can easily handle also four integer's sorting . VB.NET arrays have a Sort-method: Array.Sort(MyIntArr) which sorts your array in ascending …

Member Avatar for Muhammad Faruqi
0
3K
Member Avatar for devloper

[ICODE]myPath = HttpContext.Current.Server.MapPath("somePath");[/ICODE] and remember to add reference to [ICODE]System.Web[/ICODE]

Member Avatar for devloper
0
168
Member Avatar for Captain_Jack

There are two ways to do it. First is to wait [CODE=VB.NET]copyProcess.Start("C:\Program Files\Internet Explorer\iediagcmd.exe") copyProcess.WaitForExit(10000) ' Wait until finished or timeout after ten secs[/CODE] for the process to exit. Second is to wait event which a process raises when finished: [CODE=VB.NET]Private WithEvents copyProcess As Process ' Declare process ' Event …

Member Avatar for Captain_Jack
0
1K
Member Avatar for thetraeller94

Back to the OP's question. If I do remember right, Explorer won't let you open C:\Users\NN folder unless you're NN. It's a good programming practice not to ask user to have admin rights for your app. It's totally waste of time because standard users do not know admin password and …

Member Avatar for NetJunkie
0
2K
Member Avatar for techlawsam

You have code outside class and ... quite a few other errors [CODE=C#] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Problem8Pg179 { public class GranolaSales { public static void Main() { const int NUMBER_OF_BARS = 12; const double NUMBER_OF_CASES = 5; const double ASSOCIATION_FEES = 0.10; string inputValue; …

Member Avatar for arunkumars
0
559
Member Avatar for frost1

You can use built-in Sort method [CODE=C#]// Declare an array with ten elements //int[] a = new int[20]; int[] a = new int[10]; Random rand = new Random(); for (int i = 0; i < 10; i++) a[i] = rand.Next(10000); for (int i = 0; i < 10; i++) Console.WriteLine(a[i]); …

Member Avatar for Ketsuekiame
0
438
Member Avatar for HBovenkamp

Here's a tip: Show wait cursor: [CODE]Me.Cursor = Cursors.WaitCursor[/CODE] and after the work is done return it to normal: [CODE]Me.Cursor = Cursors.Default[/CODE] If you have a statusbar in your form you may display text: "Loading..." or something like that. And the most important thing. If you have some long lasting …

Member Avatar for Art_95148
0
460
Member Avatar for codeorder

I didn't quite get that. Is it this you're trying to do: [CODE=VB.NET]With ProgressBar1 .Value = 50 End With With ProgressBar2 .Value = 50 End With[/CODE]to get into [CODE]With Each ProgressBar .Value = 50 End With Each[/CODE]

Member Avatar for codeorder
0
184
Member Avatar for raaif

How do you handle those diacritics or glyphs? As a Latin letters or some other way (like images)? I mean what kind of keyboard you use to write Maldivian? If Maldivian glyphs can be represented as Latin letters (just like Cyrillic letters can be represent), it shouldn't be hard to …

Member Avatar for raaif
0
372
Member Avatar for kylelendo

I've used only classic ASP and it had session variables. If asp.NET has similar method, the first thing in secure.aspx page is to check that "session variable". If it's set, let the user continue. If it's not set or not found, use page transfer to move user back to start …

Member Avatar for _Barakat_
0
102
Member Avatar for justMarshall

[QUOTE]to keep the MouseLeave event on the panel from firing when another control is crossed? Or another way to accomplish the same?[/QUOTE] You can't prevent that event. But instead of mouse leaving the panel, you should think where the mouse enters. I would assume that the mouse enters a form. …

Member Avatar for justMarshall
0
609
Member Avatar for casey_sunako

[QUOTE]the progressbar starts to load until and stops only when process.HasExited[/QUOTE] Process object doesn't raise any events except Exited. So there's no way to know what the process is doing. What sort of process you're dealing with?

Member Avatar for Teme64
0
508
Member Avatar for madhan
Member Avatar for Teme64
0
849
Member Avatar for ddanbe

With nested controls you must be aware which Controls collection you're dealing with. Also, Panel control doesn't support foreach syntax so you have to use for-loop [CODE=C#]Control c; for (int i=0; i<pnlDeadPcs.Controls.Count; i++) { c = pnlDeadPcs.Controls[i]; if (c is Button) { // Use Button c } } [/CODE] HTH

Member Avatar for Teme64
2
945
Member Avatar for x38class

No. There's not such thing. But you can use Node's Tag property to store extra information [CODE=VB.NET]Dim thisRoot As New TreeNode thisRoot.Tag = "C:\users\myname\My Documents\" . . . Dim rootPath As String rootPath = thisRoot.Tag.ToString()[/CODE] HTH

Member Avatar for Teme64
0
507
Member Avatar for [Prototype]

IMHO the first place to get information is [URL="http://msdn.microsoft.com/en-us/library/w0x726c2.aspx"]MSDN[/URL]. In your case especially [URL="http://msdn.microsoft.com/en-us/library/system.io.aspx"]System.IO Namespace[/URL] and [URL="http://msdn.microsoft.com/en-us/library/system.net.aspx"]System.Net Namespace[/URL]. MSDN is a reference or a documentation of the .NET Framework and not a tutorial but if you're familiar with programming you should find all you need from there. HTH

Member Avatar for Teme64
0
119
Member Avatar for diyez treze

You should have a different SQL clause depending on your search box. Procedure LoadPeople should start like this [CODE=VB.NET]Dim sqlQuery As String Select Case ComboBox1.SelectedValue.ToString() Case "Name" sqlQuery = "SELECT * FROM reservation ORDER BY Name" Case "Room type" sqlQuery = "SELECT * FROM reservation GROUP BY RoomType" End Select[/CODE]Since …

Member Avatar for Teme64
0
165
Member Avatar for amulgarg

Use [CODE=C#]Application.DoEvents();[/CODE] before calling [ICODE]Thread.Sleep()[/ICODE] HTH

Member Avatar for arunkumars
0
166
Member Avatar for raaif

That's because "eng" and "type" are attributes, not elements. Here's a bit fixed version: [CODE=VB.NET] Dim settings As XmlWriterSettings = New XmlWriterSettings() Dim writer As XmlWriter Dim i As Integer ' i was undeclared variable settings.Indent = True writer = XmlWriter.Create("D:\Translations", settings) ' Begin writing. writer.WriteStartDocument() ' Start tag for …

Member Avatar for raaif
0
184
Member Avatar for raaif

Have you tried this basic way to do it? [CODE=VB.NET]' Add some items ContextMenuStrip1.Items.Add("First") ContextMenuStrip1.Items.Add("Second") ContextMenuStrip1.Items.Add("Third")[/CODE] and when you handle the ItemClicked event: [CODE=VB.NET]Private Sub ContextMenuStrip1_ItemClicked(sender As Object, e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip1.ItemClicked Select Case e.ClickedItem.ToString() Case "First" ' Item with text "First" selected Case "Second" ' Item with text …

Member Avatar for raaif
0
7K
Member Avatar for adem87
Member Avatar for johmolan

There are pretty good examples in Microsoft's [URL="http://social.msdn.microsoft.com/Forums/en/Vsexpressvb/thread/72b5a038-912d-4455-929d-89eeb9984d7c"]MSDN site[/URL] about printing with .NET. CodeProject has this [URL="http://www.codeproject.com/KB/printing/MCLFormPrintControl.aspx"]Form Print Control[/URL] custom control for printing. I believe that you'll find either one as an easy to use solution. HTH

Member Avatar for Teme64
0
98
Member Avatar for aadarsh_khare

[QUOTE]"No of query values and destination fields are not the same"[/QUOTE] That's a very clear error statement. Did you check that your fields and values do match in SQL statement? You're storing everything as a string. Does your data contain apostrophe (') somewhere? If it does you have to replace …

Member Avatar for divyam_shukla
0
241
Member Avatar for benjaminhale

Add the user name and the password at the same time: [CODE=VB.NET]Dim AdUsr As String Dim AdPW As String AdUsr = UsrAdd.Text AdPW = PasswordAdd.Text ' Replace with correct textbox name AdUsr = AdUsr.Replace("'", "''") AdPW = AdPW.Replace("'", "''") ' If you allow apostrophe in the password Dim CommandUser As …

Member Avatar for benjaminhale
0
168
Member Avatar for AirWave

[QUOTE]my code can do that except when row and col are the same number. How can I fix that?[/QUOTE] Line 9: [ICODE]if (j + 1 == col)[/ICODE] [QUOTE]how can I store these values into a 2D array[/QUOTE] Add declaration: [ICODE]int[,] puzzle = new int[row, col];[/ICODE] Then add a new line …

Member Avatar for Teme64
0
100
Member Avatar for singhSP

Could you use a second table (YearTable) to hold year and count information: [CODE]YearCode YearCount 2009 1 2010 2 [/CODE] Now you could [ICODE]SELECT MAX(YearCount) AS YearVal FROM YearTable WHERE YearCode = 2010[/ICODE] Also [ICODE]SELECT MAX(YearCount) AS YearVal FROM YearTable WHERE YearCode = 2011[/ICODE] would return YearVal = DbNull. If …

Member Avatar for singhSP
0
237
Member Avatar for SyncMaster170

You can use InputBox :D Ok, trap some key event in form level: KeyPress, KeyDown or KeyUp. KeyDown or KeyUp might be most flexible choices. HTH

Member Avatar for ddanbe
0
106
Member Avatar for tfj

I think that line [ICODE]FullTypeName = Application.ProductName & "." & FormName[/ICODE] goes wrong because you use Application.ProductName which is "SQLtesting". Instead of that you should reference to assembly: [CODE=VB.NET]Imports System.Reflection Dim assemblyName As String = "<here's the name of your other assembly>" Dim oAssembly As Assembly = Nothing ' the …

Member Avatar for Unhnd_Exception
0
209
Member Avatar for TIP.Synergy

You could just try yourself if it can be done... Anyway, here's my test: [CODE=VB.NET]Dim newItem As ListViewItem ' Create sub item newItem = New ListViewItem newItem.SubItems.Add("first") ' Add one lv-item with one sub item ListView1.Items.Add(newItem) ' Show the value MessageBox.Show("ListView1[0,1] = " & ListView1.Items(0).SubItems(1).ToString()) ' Second listview ' Create …

Member Avatar for Teme64
0
259
Member Avatar for falconmick

VS2010 has C# just like previous VS versions have had. The same should be with Student Edition. Mine is free Express Edition and it has VB, C#, C++ and WebDev. Check that you have installed all components from the DVD disk and the installation folder has a "Microsoft Visual C# …

Member Avatar for ddanbe
0
168
Member Avatar for coolsasuke

You can try [URL="http://www.developerfusion.com/tools/convert/csharp-to-vb/"]Convert C# to VB.NET[/URL]. You can't convert a whole project at once. You have to build VB.NET version a piece by piece. HTH

Member Avatar for MartinPlatt
0
272
Member Avatar for Oneryavuz

[QUOTE]i have a little filesystem in my program[/QUOTE] If you use your own filesystem [U]and[/U] you don't need any Explorer integration, I would suggest using a new table or some hidden extra file with filenames and their explanations. The second approach may be much harder to program: use alternate data …

Member Avatar for Reverend Jim
0
183
Member Avatar for TIP.Synergy

This might be correct way to do it [CODE=VB.NET] Dim newItem As ListViewItem ' Start with four sub items newItem = New ListViewItem(New String() {"First", "Second", "Third"}) ListView1.Items.Add(newItem) ' Now add the fourth sub item ListView1.Items(0).SubItems.Add("Fourth")[/CODE] HTH

Member Avatar for NetJunkie
0
197
Member Avatar for Oneryavuz

[QUOTE]i searched little but i just can find copying strings[/QUOTE] That's exactly how file copy works! Open Explorer, select a file or few and try this code [CODE=VB.NET]If Clipboard.ContainsFileDropList() Then For Each fn As String In Clipboard.GetFileDropList() MessageBox.Show(fn) Next End If[/CODE] HTH

Member Avatar for NetJunkie
0
241
Member Avatar for Jesus Jacques

You can easily loop all your form's controls [CODE=VB.NET]' Put this code in the form (Me refers to (your) form now) Dim thisButtonName As String = "Button1" ' This is the name of the button you're looking for Dim isButtonVisible As Boolean = True ' This is the "visibility" value …

Member Avatar for Jesus Jacques
0
1K
Member Avatar for SyncMaster170

Here's how you get your row to variables: [CODE=C#]string firstName; string lastName; bool membership; DateTime cardDate; // Add first row dataGridView1.Rows.Add(); // Add some test data to 1st row dataGridView1.Rows[0].Cells[0].Value = "John"; dataGridView1.Rows[0].Cells[1].Value = "Doe"; dataGridView1.Rows[0].Cells[2].Value = true; dataGridView1.Rows[0].Cells[3].Value = DateTime.Now; // Get data from 1st row firstName = dataGridView1.Rows[0].Cells[0].Value.ToString(); …

Member Avatar for Teme64
0
626
Member Avatar for NetJunkie

I hope you get things started with this little snippet [CODE=VB.NET]Dim cmdProcess As Process cmdProcess = New Process() ' Dump all info from ipconfig command cmdProcess.StartInfo.Arguments = "/ALL" ' Run command: ipconfig cmdProcess.StartInfo.FileName = "ipconfig" ' Redirect stdout cmdProcess.StartInfo.RedirectStandardOutput = True ' Set to false, otherwise you can't redirect stdout …

Member Avatar for Teme64
0
542
Member Avatar for Oneryavuz

[CODE=VB.NET]Dim isItTime As Boolean = False Dim aDateFromReminder As DateTime = CDate("14.9.2011 7:00") ' This date comes from the reminder. I have to use Finnish datetime format Dim timeInterval As Integer = 48 ' How much earlier you need to be reminded, the unit is hours ' Compare the reminder's …

Member Avatar for Oneryavuz
0
64
Member Avatar for de Source

[QUOTE]how to transfer that user input in these text boxes[/QUOTE] Pass them in the URL. Here's a simple code with a nice Finnish twist [CODE=C#]double latitude = 0; // textBox1.Text double longitude = 0; // textBox2.Text string strURL = ""; bool isValidCoordinate = false; // use a flag to indicate …

Member Avatar for Teme64
0
171
Member Avatar for djjavo

Relative to what? I guess relative to your application. To be more precise, relative to the [U]current directory[/U]. Here's the code: [CODE=VB.NET]Dim FileName As String ' File is two levels up from the current directory FileName = "..\..\test.txt" ' Test if the file really exists If My.Computer.FileSystem.FileExists(FileName) Then ' Dump …

Member Avatar for djjavo
0
312
Member Avatar for GeekByChoiCe

[QUOTE]what should i write in the "InlineAssignHelper" function?[/QUOTE] Nothing. Don't use it. [CODE=C#]int arg1; int expr1 = arg1 = 16;[/CODE]is a very stupid way to set initial values to variables. It's the same as: [CODE=C#]int arg1 = 16; int expr1 = 16;[/CODE]and now the code is trivial to translate: [CODE=VB.NET]Dim …

Member Avatar for GeekByChoiCe
0
269
Member Avatar for XF15-Loader

First, use type casting when you convert text to number: [ICODE]dblYard = CDbl(txtYard.Text)[/ICODE] There are quite a few ways to format doubles as strings. But [ICODE]txtCost.Text = Format(dblCostA, 2)[/ICODE] is not syntactically correct (the latter parameter should be a string). You should use FormatNumber function instead. Anyway, here's some formatting …

Member Avatar for Teme64
0
102
Member Avatar for kylelendo

I suggest comparing checksums of the original file and the possibly corrupted file. Resulting hash values are easy to store and you can validate corrupted file even without the original file. .NET has a few suitable hash functions like SHA1 and SHA256 (see System.Security.Cryptography namespace). CRC32 is not provided but …

Member Avatar for Teme64
0
943
Member Avatar for PurpleHeaven

Read first [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]this[/URL]. Especially the part which says: [QUOTE]"Do provide evidence of having done some work yourself if posting questions from school or work assignments"[/QUOTE].

Member Avatar for AnkitGuru
0
125
Member Avatar for Sheryl99

You have to scale the image. The code below gets an image from the file and rescales its size down to fit in the PictureBox. [CODE=VB.NET] ' See http://www.vb-helper.com/howto_net_image_resize.html for the original code Dim PicBoxHeight As Integer Dim PicBoxWidth As Integer Dim ImageHeight As Integer Dim ImageWidth As Integer Dim …

Member Avatar for aamirnikkiaadil
0
5K
Member Avatar for pxndx

Use dictionary collection: [CODE=Csharp]// Dictionary, key is number from the list and the associated value is the number of times the key is found Dictionary<int, int> occurrences = new Dictionary<int, int>(); int[] test = new int[] { 1, 1, 1, 2, 2, 3, 4, 5, 6 }; // Debug data …

Member Avatar for thines01
0
2K
Member Avatar for tfj

You could use form's owner property. Calling Form99 would be [CODE=VB.NET]Form1 Form99.Show(Me) ' Me i.e. owner is now Form1 Form2 Form99.Show(Me) ' Me i.e. owner is now Form2[/CODE] To find out who's the caller (i.e. owner), read the owner property: [CODE=VB.NET]Private Sub Form99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) …

Member Avatar for tfj
0
152
Member Avatar for DisasterPiece

To read an image from the file to a picturebox control: [CODE=VB.NET]Me.PictureBox1.Image = Image.FromFile("C:\Temp\somepicture.jpg")[/CODE] I [U]guess[/U] that's what you were looking for. And remember to read codeorder's comment about your question...

Member Avatar for Teme64
-1
76
Member Avatar for onlinessp

[QUOTE]I am going to write a program which can calculate MD5 of a file even the file is in use[/QUOTE] if a file "is in use" means that someone has an exclusive lock to the file i.e. no one else can access the file until the lock's owner releases the …

Member Avatar for BatsIhor
0
180
Member Avatar for sandeepparekh9

And here's my VB.NET blog post "[URL="http://windevblog.blogspot.com/2008/08/convert-image-to-byte-array-and-vice.html"]Convert image to byte array and vice versa[/URL]" back from 2008. It has some additional comments to consider also with the C# version above.

Member Avatar for CsharpChico
0
278

The End.