476 Posted Topics
Re: You could use two ArrayLists. For each ArrayList as an item in another ArrayList. The "outer" ArrayList contains the rows, and the "inner" ArrayList contains the columns. [CODE] Dim arrRows As New ArrayList For Each row As DataRow In <datatable>.Rows Dim arrCols As New ArrayList arrCols.Items.Add(row("first column")) arrCols.Items.Add(row("second column")) arrCols.Items.Add(row("third … | |
Re: It depends on the context. If all you want is to find out if an email address is valid and properly formatted, then you should look into using regular expressions. There are tons of examples out there. Just google "vb.net regex email validation" (without the quotes). | |
Re: Unfortunately, those properties cannot be overridden. Otherwise you could have have used the DefauleValue attribute. You can however create your own properties with those names and use any default values you wish. [CODE] <DefaultValue(True/False)> _ Public Property AllowUserToAddRows() As Boolean Get Return MyBase.AllowUserToAddRows End Get Set(ByVal value As Boolean) MyBase.AllowUserToAddRows … | |
Re: Most computers today have the Microsoft XPS Document Writer. You can print to that. It creates an XPS file at a location that you choose, that you can view and share with others. | |
Re: Change this line: [CODE]cat.Create("Provider=Microsoft.ace.OLEDB.12.0;Data Source=C:\Customer\Customer.accdb")[/CODE] to this: [CODE]cat.Create("Provider=Microsoft.ace.OLEDB.12.0;Data Source=C:\Customer\Customer.accdb:Database Password=<password>")[/CODE] | |
Re: There are three ways you can do that (as far as I know). 1: On the child form you can enable or disable a form in the designer. 2: In the code of the child form, you can type: Me.Enabled = True/False 3: In the code of the MDI container, … | |
Re: I think it would be easier to add an ID and a runat="server" attribute to the TD and change the class from codebehind. Just put a default class there, run the IF statement in the codebehind code and change the class from there. | |
Re: You misspelled DISTINCT in "SELECT DISTICT Media Type FROM Libraries". | |
Re: Visual Studio 2010 does not provide the necessary tools for upgrading a VB6 project. In order to do that, you must first upgrade the project in a previous version of Visual Studio, and then upgrade THAT project with VS2010. Check this [URL="http://msdn.microsoft.com/en-us/library/bszew91f.aspx"]article[/URL]. And the only way to upgrade your VB6 … | |
Re: In your search method you're reading the query directly into a datatable, which you then use as a datasource for the datagridview. But in the update method you're using a dataset as the source for the da.Update method. The dataset has not been filled with a datatable named "Tracker". I … | |
Re: Have you tried using HttpWebResponse.ResponseUri? [CODE] Dim response As HttpWebResponse Dim resUri As String response = request.GetResponse resUri = response.ResponseUri.AbsoluteUri [/CODE] | |
Re: You might be able to use the WindowState to enable the second form. Just check to see if the current forms new WindowState is Minimized. [CODE] Private Sub Form_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged If Me.WindowState = FormWindowState.Minimized Then 'Create or transfer control to second form … | |
Re: Try this. It's very simple, and it won't keep track of which textbox you remove. [CODE] Private btnID As Integer = 1 Private txtTop As Integer = firsttextBox.Top Private Sub addButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles addButton.Click Dim txtBox As New TextBox txtBox.Name = "txt" & buttonID … | |
Re: [CODE] If Not System.IO.File.Exists("<path and filename>") Then If MessageBox.Show("The database file cannot be found. Would you like to browse for it?","Missing database file", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then 'Create an OpenFileDialog here and use the path for the connection string Else Return End If End If [/CODE] | |
Re: Google is your friend. Try this: [url]http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/dd860b19-ea95-4701-9a5a-1fd7fab81c98/[/url] | |
Re: Enclose your code in a Try...Catch statement. [CODE] Private Sub aMethod() Try 'Your code goes here Catch ex As Exception MessageBox.Show(ex.Message, "An error has occured") End Try End Sub [/CODE] | |
Re: If the item has been added at the same place in both the TreeView and the ListView, then you can make a note of the index of the selected item in the ListView before you delete it. You can then use that index to locate the corresponding node in the … | |
Re: Most likely it's quite wise to read the FireBirdSQL FAQ. [url]http://www.firebirdfaq.org/faq19/[/url] It's SQL, but you can execute SQL programmatically from VB.NET. | |
Re: You can do the same thing using a DataReader object. Simply state the criteria in a SQL query and count the rows. This is just a suggestion.... [CODE] Dim con As New OleDbConnection("<onnection string>") con.Open() Dim com As New OleDbCommand("SELECT COUNT(*) FROM <table> WHERE <column4> = 'No' AND <some other … | |
Re: Try this... [CODE] ListView1.Items(<index>).Selected = True ListView1.Select() 'Important line [/CODE] | |
Re: In order to calculate the average of a column in MS Access, you need to use the AVG function. [CODE]SELECT [Student ID], [First Name], [Last Name], and so on, AVG([Project#1]) AS avg1, AVG([Project#2]) AS avg2, AVG([Project#3]) AS avg3 FROM <table>[/CODE] This will calculate the average of ALL rows, unless you … | |
Re: I'm using a single method for resizing images in both directions. It returns a BitMap object that you can use on wherever you like. [CODE] public BitMap ResizeBitMap(BitMap source, Size newSize) { //Get the source bitmap BitMap bm_source = source; //Create a bitmap for the result BitMap bm_dest = new … | |
Re: If the table that you want to save the data to is the same table that you use to populate the DataGridView, then I suggest that you use databinding to bind the DataGridView to a DataTable. You can find several solutions for databinding right here on DaniWeb. Every time that … | |
Re: Swing a cat. :) Although. If there's even a slight chance that a computer might be used by more than one user, you should seriously consider using the CommonApplicationData folder. | |
Re: Take a look at this project: [URL="http://www.codeproject.com/KB/printing/datagridviewprinter.aspx"]The DataGridViewPrinter Class[/URL] It might also be possible to use it with a ListView. | |
Re: If you're using Internet Explorer, you can use the Page menu and select View Source (or the View menu and select Source). In FireFox, go to Tools->Web Developer and select Page Source (or press CTRL+U). In Google Chrome, click the wrench and go to Tools and select View Source. | |
Re: You can put this method in a Module, and call it from the form containing the ListView. I've commented on what's going on in the code. [CODE] ''The listview is provided as a referenced argument Public Sub PopulateListViewFromAccess(ByRef lv As ListView) 'Create a connection string to the MS Access database. … | |
Re: I'm sorry to say, No. Any timer, either on an ASP.NET page or in an Ajax method, are tied to be run while in an opened browser. The only way I can think of would be if you could have a script available, that takes care of sending those newsletters, … | |
Re: That blog was written in 2008, perhaps they have made some updates since then. I noticed in one of the comments below that "request.Version" has another value. If you take a look in "PayPalSvc.wsdl" and locate the entry "ns:version" you might find the correct value to use. | |
Re: Do you remember the connection string I gave you in your previous post "Need Help"? Try using that one instead. If I recall correctly, the constant DATA_SOURCE already contains "data source=JAKE-PC\SQLEXPRESS", so what you have done in your StingBuilder is declare the data source twice. It's redundant, and causes errors. … | |
Re: You should consider moving that code onto a button click event. Otherwise the query will be fired for every keystroke you use in the textbox. And you are very close to the solution, my friend. :) Notice my lack of use of the SqlConnection object. It will work anyway, because … | |
Re: If you wanna move or copy files from one location to another using your program, there are easier ways than using FileStream. [CODE] Imports System.IO Private Sub FileCopy() Dim strFileSource As String = "C:\Temp\sourceFile.txt" Dim strFileDestination As String = "C:\Temp\destinationFile.txt" File.Copy(strFileSource, strFileDestination) End Sub Private Sub FileMove() Dim strFileSource As … | |
Re: Check this site: [url]http://connectionstrings.com/sql-server-2008[/url] | |
Re: Is her computer in the same environment as your own computer? Perhaps her computer is behind a firewall (or Windows Firewall) that requires her ftp client to connect using Passive FTP. Perhaps you should consider using a custom ftp client for your application. [URL="http://www.codeproject.com/KB/IP/Active-Passive-FTP-Client.aspx"]Take a look at this FTP client[/URL]. | |
Re: You need to grab the handle of the application for which you want to save the document. In order to achieve this, you need to use Windows API to grab and perform. [CODE] ''' A couple of APIs <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _ Private Shared Function FindWindow(ByVal lpcClassName As String, ByVal … | |
Re: You could use the method GetProcessesByName in order to determine if a certain process is running. It returns an array of processes containing all instances of a certain named process, for example "wmplayer". If the Length of the array is greater than 0, then that particular process is running. This … | |
Re: My first thought is that when you deploy the program, the CreateDirectory method may not have sufficient rights to create a folder on the hard drive, and thus skips the call to InitiateDownload. Have you tried running it as Administrator? My second thought is that you may wish to add … | |
Re: There is really no sure way to programmatically determine whether or not another program can be run. The only way to really it is to actually try to execute the file. On that front, you can use the Shell commands FileNotFound exception error in order to determine if the file … | |
Re: If you install the Visual Basic PowerPack for Visual Studio you will get access to various shape controls, like the OvalShape. You can use that to mark parts on your image, and indicate that it's clickable by changing the cursor whenever you hover on it. | |
Re: You can use a DataView to filter, sort and search through a DataTable. Here is an example of how to filter using a DataView: [url]http://vb.net-informations.com/dataview/filter-dataview.htm[/url] | |
Re: Here is a suggestion: [CODE] Dim list As New List(Of DataRow) 'Your generic list of DataRow Dim list1() As DataRow = New DataRow() {} Dim list2() As DataRow = New DataRow() {} 'Begin by copying the first three elements in the list to a new array list.CopyTo(0, list1, 0, 3) … | |
Re: You were very close to the solution, my friend. [CODE] Dim dr As New DataGridViewRow dr.CreateCells(gridname) gridname.Rows.Add(dr) [/CODE] | |
Re: You can create a SQL file (a textfile) that you then can read and exexute at runtime and direct it towards an Access 2007 database file. Here is an example of how to create it using ADOX (Microsoft ADO Ext): [url]http://www.vbforums.com/archive/index.php/t-251384.html[/url] | |
Re: Why not just create a random integer between 1 and 9, throw it into a string and then add a "0." in front of it? That would give you the 0.1, 0.2 and so on, as a String. Once that is done, you can convert the string into a double. … | |
Re: In addition to adding the reference to Microsoft Outlook 14, make sure that you also import the namespace Microsoft.Office.Interop. Then you can use this code to create a mail message. [CODE] Dim oApp As New Outlook.Application() Dim oMsg As Outlook.MailItem oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem) oMsg.To = "[email protected]" oMsg.Subject = "mail subject" … | |
Re: Assuming that column1 contains a path to the picture. Here's what you can do. First change the property AllowDragDrop to True for all the pictureboxes. Then add this code: [CODE] Dim bMouseIsDown As Boolean = False Private Sub DataGridView1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseDown If e.Button … | |
Re: Yes, I would revise that code into something like this. [CODE] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim playerdrivers As New ArrayList Dim destination As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\f1data\bin\array.txt" Dim FileReader1 As New StreamReader(destination) Dim Contents1 As String Dim index As Integer = … | |
Re: It doesn't really matter which database source that you use (SQL Server (any edition), Access, Excel, Oracle and so on). As long as you can get the relevant data into a DataTable, then all you have to do is use that as the DataSource for the crystal report. | |
Re: Try changing [ICODE]conn.GetSchema("TABLES")[/ICODE] into this: [ICODE]conn.GetSchema("Tables", New String() {Nothing, Nothing, "TABLE"}[/ICODE] And skip setting the ValueMember and DisplayMember properties. Solution provided by [URL="http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/d2eaf851-fc06-49a1-b7bd-bca76669783e"]this[/URL] thread. | |
Re: [ICODE]x = system.io.path.getfilename(track)[/ICODE] will only give you the filename. If you want to display only the filename, but still have access to the full path, then I suggest that you add a second, hidden, ListBox where you store the full path and filename. And every time that you add another … |
The End.