646 Posted Topics
Re: "Transaction" is a reserved word. Rename your table to "TransactionTable" or something like that. | |
Re: All the .NET methods and properties, that access file version data, are ReadOnly. Do you have only a single file to modify? If so, have you tried some hex editor (without messing up the original file of course)? | |
Re: [QUOTE]The HTML produced by word is bloated and pretty useless to any program other than word (But then you already know that)[/QUOTE] Yes, I do know that very well. First solution that came in to my mind is to search for a third-party component that would "parse" Word documents to … | |
Re: Hi Maliha! This is a VB.NET forum. Please re-post your question to DaniWeb's [URL="http://www.daniweb.com/forums/forum4.html"]Visual Basic 4 / 5 / 6 [/URL] forum. You will get the answer from there. | |
Re: [QUOTE]f[/QUOTE]??? Here's an example [CODE=VB.NET]Dim g As Graphics g = PictureBox1.CreateGraphics g.DrawLine(Pens.Blue, 0, 0, 20, 20) [/CODE] Take a look at System.Drawing.Graphics namespace. And use some googling to find tutorials and graphics programming examples. | |
Re: You already noticed that you couldn't do it in the way you first tried out. VB.NET doesn't have control arrays, it has control collections instead. Here's a one way to find matching text boxes. It uses Tag property and Name property to identify matching Alpha and Bravo text box [CODE=VB.NET]' … | |
Re: With a quick look I couldn't spot any error (in Edit function). I suggest setting a breakpoint to line [ICODE]MyOledbCommand.ExecuteNonQuery()[/ICODE], and before executing the command, check the properties of MyOledbCommand especially MyOledbCommand.CommandText. | |
Re: I rewrote the Client class and added a lot of (hopefully) helpful and understandable comments. I didn't check the rest of your code, but I hope you 'grasp' now more of the basics of the classes [CODE=VB.NET]Option Explicit On Option Strict On Public Class Client 'account information ' Local, private … | |
Re: [QUOTE]I worte a code for Palindrom and i am receiving error message could someone tell me where is the mistake is?[/QUOTE] Could you please tell, what error message you get? When you post your questions here, always include any error messages and/or describe the actual problem as detail as possible. … | |
Re: First, set a breakpoint at line [ICODE]conn.Open();[/ICODE], execute the line and check conn.State. It should be Open (or ConnectionState.Open) if your connection string is ok. Otherwise, recheck connection string like Ramy said. After you get your code work at that point, you have [ICODE]cmd.ExecuteNonQuery(); cmd.ExecuteScalar();[/ICODE] Since DELETE is not a … | |
Re: [QUOTE]Dim msgAnswer as MsgBoxResult msgAnswer = MsgBox ("Are your sure you want to Exit?",MsgBoxStye.YesNo,"Warning") If msgAnswer = MsgBoxResult.Yes Then End Elseif msgAnswer = MsgBoxResult.No Then Me.Close End If[/QUOTE] Here's the same code a bit more in VB.NET style than VB6 style [CODE=VB.NET]Dim msgAnswer As Windows.Forms.DialogResult msgAnswer = MessageBox.Show("Are your sure … | |
Re: Here's maybe a better sample code for you: [URL="http://www.codeproject.com/KB/vb/PanExample.aspx"]Pan / scroll an Image in VB.NET[/URL] by Anthony Queen. The code is very simple and doesn't use any API calls. | |
Re: My guess is that a 'Materials' can have many 'MaterialRequisitionDetail' (1-N relationship). Now, MaterialRequisitionOrder.requisition_no = 129 gives you a single 'MaterialRequisitionOrder'. 'MaterialRequisitionOrder.requisition_no' gives you a single 'MaterialRequisitionDetail.requisition_no' (1-1 relationship). 'MaterialRequisitionDetail.item_code' gives you many (four in this case) 'Materials' because of 1-N relationship between 'MaterialRequisitionDetail' and 'Materials'. If I'm right about … | |
Re: What do you mean by 'root directory'? You get most of the special directories with [ICODE]My.Computer.FileSystem.SpecialDirectories[/ICODE] property. [ICODE]Environment.SystemDirectory[/ICODE] property returns full path of the system directory. [ICODE]Environment.GetFolderPath(<SpecialFolder>)[/ICODE] function returns also special folders. Check those properties and the function. I'll think you'll find what you're looking for. | |
Re: A few obvious points are wrong with the code [CODE=VB.NET]cN = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\LVuserdb.accdb;Jet OLEDBatabase Password=1") myOleDbCommand = New OleDbCommand("SELECT StaffID,Password FROM Staff WHERE Staffid = '" & username & "' AND Password1 = '" & password & "'", cN) username = Me.staffid.Text password = Me.staffpass.Text[/CODE] First, get the user … | |
Re: I answered a similar question about listbox control and I assume that checked listbox behaves in the same way. Setting MultiColumn property doesn't actually provide you a control with desired number of columns. It still has a single list of items and while you add more items, it 'wraps' them … | |
Re: Here's a one way to do it[CODE=VB.NET] Dim StartDate As Date Dim DaysUntilToday As Integer Dim aRandomNum As Integer Dim oRandom As System.Random Dim aRandomDate As Date ' Start date (in my locale format) StartDate = CDate("1.1.2008") ' Number of days until today DaysUntilToday = System.DateTime.Now.Subtract(StartDate).Days ' Create a 'randomizer' … | |
Re: Here's a one [URL="http://www.w3schools.com/sql/default.asp"]SQL Tutorial[/URL]. You'll find the samples how to insert records and how to join the tables. | |
Re: This is for VB.NET 2005 and I hope it works in 2003 too [CODE=VB.NET]Private Sub PictureBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick ' Dim TempBitmap As New Bitmap(PictureBox1.Image) Dim MyColor As Color MyColor = TempBitmap.GetPixel(e.X, e.Y) MessageBox.Show("Pixel x=" & e.X & ", y=" & e.Y & ", … | |
Re: [QUOTE]I receive this error ""String or binary data would be truncated. The statement has been terminated""[/QUOTE]You have, for example, a field of type Varchar with size 100 and you're trying to insert a string value which length is longer than 100. For text boxes you can set the Maxlength property … | |
Re: Ramy has it right that Access is not a "real" database in the sense you can't have multiple users simultaniously. Since this a VB.NET (programming) forum, I guess you're building the system at the moment. I suggest taking a look at some other data storage. Like SQL Server or MySQL. … | |
Re: Q1: Open VB.NET. Then open your browser and navigate to [URL="http://www.google.com"]www.google.com[/URL] Q2: [QUOTE]Can a web browser be made..??[/QUOTE] Yes, it can be made. .NET has a WebBrowser control. [QUOTE]If so where do i find help resources.[/QUOTE] By googling [URL="http://www.google.com/search?q=webbrowser+control+vb.net"]webbrowser control vb.net[/URL] Q3: Yes. You can write parts of your application … | |
Re: You didn't mention which DB you're using. For help with connection strings, check [URL="http://www.connectionstrings.com/"]The connection string reference[/URL]. After that you may succeed in creating a new login. | |
Re: Since you want only the status code, you'll do well with webbrowser control. Another way to check the code is to use WebRequest and WebResponse. Here's something I ripped from my app (bugs included). It may be a bit overkill for your purposes (it returns the page HTML etc.) but … | |
Re: [QUOTE]it comes up with an error message saying "object reference not set to an instance of an object."[/QUOTE] That's because variable 'g' doesn't point to anywhere. You can make your drawing in a separate class but you'll have to provide some (control) to draw on. Here's an example how it … | |
Re: Here's a VB.NET version of the code above (this is a VB.NET forum :) ) Dim c As Char c = CChar(CStr(Integer.Parse(Hex, System.Globalization.NumberStyles.HexNumber))) and instead of '\r\n', use Environment.NewLine | |
Re: Yes, you do need a loop [CODE=VB.NET]Dim FoundAtPosition As Integer FoundAtPosition = RichTextBox1.Find("foo", RichTextBoxFinds.MatchCase) Do Until FoundAtPosition < 0 ' Highlight text ' Search next occurrence FoundAtPosition = RichTextBox1.Find("foo", FoundAtPosition + 1, RichTextBoxFinds.MatchCase) Loop[/CODE] | |
Re: This VB.NET forum. You'll get an answer if you re-post your question to [URL="http://www.daniweb.com/forums/forum61.html"]DaniWeb's C# forum[/URL] | |
Re: Call image's Save method[CODE=VB.NET] PictureBox1.Image.Save("C:\test.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)[/CODE] | |
Re: You may try [ICODE]SendKeys.Send("TEXT FROM VB")[/ICODE] instead of [ICODE]stdINwriter.WriteLine("TEXT FROM VB")[/ICODE] SendKeys.Send() sends keystrokes to the active window. However, it's not a very reliable method. If the process you started loses focus, it won't receive those keystrokes. | |
Re: Split function splits a string to substrings. Second argument is substring separator. For example[CODE=VB.NET] Dim Data() As String Data = Split("Comma,separated,values)", ",") 'Data(0) is "Comma" 'Data(1) is "separated" 'Data(2) is "values"[/CODE] | |
Re: And here's an example how to get an image from the file to a picturebox [ICODE]PictureBox1.Image = Image.FromFile("D:\image.jpg")[/ICODE] You'll have to set some properties of the picturebox to get the result you want. One important property is SizeMode [ICODE]PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage[/ICODE] | |
Re: Correct syntax is [ICODE]Dim imgbinarydata(imglen - 1) As Byte[/ICODE] Since arrays are zero-based, you use imglen - 1 to get an array with imglen elements. You should check that UploadFile.PostedFile.ContentLength is not zero to avoid errors: [CODE=VB.NET]Dim imgStream As System.IO.Stream = UploadFile.PostedFile.InputStream Dim imglen As Integer = UploadFile.PostedFile.ContentLength Dim imgcontenttype … | |
Re: You didn't said which DB you're using and do you store birth dates in date type or in textual data type. If the birth dates are stored as a text, you'll get matching records (January in this case) with following SQL select statement (just change correct table- and field-names): [CODE]SELECT … | |
Re: Set Name-property: [CODE=VB.NET]Dim TC As RichTextBox For I = 1 To 100 TC = New RichTextBox TC.Name = "RTBox" & I.ToString Me.Controls.Add(TC) Next I[/CODE]now you should have rt-boxes with names "RTBox1", "RTBox2", ..., "RTBox100". You'll refer to rt-boxes: [ICODE]Me.Controls.Item("RTBox1")[/ICODE] or cast control to RichTextBox type. For example [ICODE]CType(Me.Controls.Item("RTBox1"), RichTextBox).Multiline = … | |
Re: Here are the links: [URL="http://msdn.microsoft.com/en-us/library/ms950416.aspx"]Visual Studio 2005[/URL] you'll find VB.NET reference from there, and [URL="http://msdn.microsoft.com/en-us/library/bb966997.aspx"].NET Framework 2.0[/URL] is the .NET 2.0 reference. | |
Re: This doesn't exactly answer how to do it from the module, but shows how to create and dispose forms (from the "main" form) [CODE=VB.NET]' A global variable to "hold" the form Private aForm As Form Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' ' Create … | |
Re: You have to create StreamWriter in the append mode [CODE=VB.NET]Dim fileOut As New System.IO.StreamWriter(fileName, True)[/CODE] | |
Re: You will have to write your own control for that purpose. To get started take a look at the thread [URL="http://www.daniweb.com/forums/thread176182.html"]How to resize images at runtime using mouse...[/URL]. There's a "basic" zoomable picturebox user control. I'm not familiar with VB.NET 2008 (or .NET 3.x) which may support those features you … | |
Re: In your update statement [ICODE]UPDATE TIME SET Time_Out = " & timeout & " WHERE EXISTS (SELECT Sessions FROM TIME WHERE Sessions = Sessions)[/ICODE] condition [ICODE]EXISTS (SELECT Sessions FROM TIME WHERE Sessions = Sessions)[/ICODE] is true for each row because [ICODE]Sessions = Sessions[/ICODE] is always true. That's why your statement … | |
Re: Threading is something that comes with VB.NET. If I got it right, you're using VB6, which does not have "built-in" threading. Re-post your question to DaniWeb's [URL="http://www.daniweb.com/forums/forum4.html"]VB6 forum[/URL]. I'm sure you'll get an answer from there. I don't also think you'll need threading in a setup application. | |
Re: Take a look at SendKeys class in the VB.NET documentation. It might do what you're looking for. | |
Re: nescio99 has it right that you can't use ExecuteNonQuery() because you want to [B]query[/B] something from the database. Either use ExecuteScalar() to check if a record exists i.e. returned number of records equals one, like nescio99 suggested, or if you need some information from the record, use simple Execute. If … | |
Re: Here's how you kill current process: [CODE=VB.NET]Dim aProcess As System.Diagnostics.Process aProcess = System.Diagnostics.Process.GetCurrentProcess() aProcess.Kill() [/CODE]To kill a process with a specific ID, make the following change: [CODE=VB.NET]aProcess = System.Diagnostics.Process.GetProcessById(ThisID)[/CODE] I just wonder where you need this code... | |
Re: You're right about that you have to know the number of the days in a month. This snippet will add one month to a date and "modifies" date to be the last day of the month. In December it goes to the January of the next year. I used DateTime-picker … | |
Re: This is VB.NET forum. You'll find Daniweb's C# forum in [URL="http://www.daniweb.com/forums/forum61.html"]here[/URL]. You may also try Daniweb's site search (in upper right corner) with "import excel sheet". You're not the first one to ask that... | |
Re: I'm not sure where you need Dictionary object, but if you want a list of unique file names, here's how I would do it [CODE=VB.NET]Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim FileNames() As String Dim FileName As String FileNames = IO.Directory.GetFiles("c:\windows") For Each … | |
Re: A simple Q&D solution[CODE=VB.NET] Dim MyUrl As String = "<a href=""/profiles/13374222/"" title=""View The Admin's profile"">The Admin</a>" Dim StrArr() As String Dim i As Integer Dim UNum As Long StrArr = Strings.Split(MyUrl, "/") UNum = 0 For i = 0 To StrArr.GetUpperBound(0) If IsNumeric(StrArr(i)) Then UNum = CLng(StrArr(i)) Exit For End … | |
Re: Use DISTINCT keyword: [ICODE]SELECT DISTINCT Contractor FROM Companies[/ICODE] |
The End.