476 Posted Topics
Re: Why not convert the method into a function that returns a string. And then enclose the code in a Try...Catch statement. If the code should fail, then you can return the .ToString() of the exception object and examine what went wrong. Otherwise you just return an empty string. | |
Re: Even if the communication with Excel is threaded, the code should still be there. And you may not find any references to Excel interop, because there are other ways to communicate with Excel files. OleDb comes to mind, and also third-party components like GemBox Spreadsheet. Have you considered that these … | |
Re: I did a similar thing a while ago. What I did was hardcode a bunch of macro-type strings into the client, for example: "#PLAY#", "#STOP#" or "#PAUSE#". By sending the same string from the server and comparing the hardcoded string against the incoming string you can then call any other … | |
Re: Welcome to the world of .NET, friend. :) In my personal oppinion, although COM has it's uses, it has become a thing of the past. And unless you absolutaly need to access certain specialized code and functionality created in COM objects, you'll find almost everything you need in existing .NET … | |
Re: Have you tried clearing the DataGridView control each time you select that tab, before calling the PopulateAccess method? | |
Re: In the form load event, see if adding these three lines helps: [CODE] Me.SetStyle(ControlStyles.UserPaint, True) Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True) Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True) [/CODE] ![]() | |
Re: There is no way to [B]schedule[/B] a webservice. But you can easily create a reference to a webservice, and it makes no difference how it was created. In Visual Studio in the Solution Explorer, right click on the project and select Add Service Reference. Click on the button Advanced at … | |
Re: For it to be a .vb script, you cannot use another file extension. You can however re-assign .vb files to use Notepad, and keep .vbproj and .sln files assigned to Visual Studio. | |
Re: [CODE] Private Sub MethodThatCreatesDynamicPictureBoxes() 'Your code for dynamically creating picturebox AddHandler yourPicBox.Click, AddressOf picbox_Click End Sub Private Sub picbox_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Every time a picturebox is clicked, this variable will contain THAT picturebox Dim picBox As PictureBox = DirectCast(sender, PictureBox) 'Do something with the picBox … | |
Re: You can change the original cmd.CommandText text so that you incorporate both the insert and the select query using the EXISTS condition. Like so: [CODE] cmd.CommandText = "INSERT INTO tbl_curriculum (course_code,subj_code) VALUES ('" & txtCode.Text & "','" & txtScode.Text & "') WHERE NOT EXISTS (SELECT subj_code FROM tbl_curriculum WHERE subj_code … | |
Re: I think Access is a bit more picky and needs to be told explicitly what kind of JOIN you are performing. I suggest that you use either INNER JOIN or OUTER JOIN instead of just JOIN. For more detail I also suggest that you read up a bit about using … | |
Re: In order to add names from the database to the combobox you can more or less use the same code as for the search. Observe the change in the SQL string. [CODE] Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\~LaiLi~\My Documents\Visual Studio 2005\Projects\MoreWever\MoreWever\bin\Debug\Inventory.mdb" sql = "SELECT * FROM Profile" … | |
Re: Add [ICODE]Environment.NewLine[/ICODE] after each body line. A better way would be to do this: [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click Dim strSubject As String 'subject title Dim strBody As String 'Body of message strSubject = "Need Remote Pc Help" 'store subject in variable … | |
Re: Why not load the XML file into an XmlDocument? From there you can create an XmlNodelist and iterate through it until you find the node you're looking for. When you find it you can extract that XmlElement from the XmlNodelist and add some logic to extract the values. This is … | |
Re: Anything is possible. How are you populating the ListView in the first place? Can't you also add the information for column 1 and 2 during the population phase? If the folder is already known, then you can use the information in column 0 and call a function the performs the … | |
Re: What bold things? If you want to extract information from a HTML source, then the easiest solution would be to read the entire content into string using a StreamReader. Once that is done, you can use string functions, like IndexOf and SubString, to locate and extract the information. In other … | |
Re: All you need to do is to reformat the query into an UPDATE query. Like so: [CODE=VB] Dim cmd As New OleDbCommand("UPDATE tblPurchase_Order SET " _ "[Supplier_Id] = @Supplier_Id, [Address] = @Address, [Project_Id] = @Project_Id, " _ "[dtpDate] = @dtpDate, [Material_Id] = @Material_Id, [Material_Name] = @Material_Name, _ "[Unit] = @Unit, … | |
Re: In the Form_Close event, you can use [ICODE]e.Cancel = True[/ICODE]. That will cancel the closing of the form no matter how the user initiates the closing of the form. | |
Re: You would normally get a list of command line arguments from an application by using the /? or -h/--help arguments. | |
Re: Perhaps you could check to see if WinZip support command line arguments. If that is the case, then you can probably perform a standard extraction to a folder you choose. Then you can use Process.Start() to run that EXE file. If that is NOT the case, then you can check … | |
Re: The easiast way to do this would be to first fetch the information from the database then call a seconday method in order to update the database. [CODE]Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim connstr As String connstr = ConfigurationManager.ConnectionStrings("guest1").ConnectionString() Dim SQL As String … | |
Re: If you copy the contents of the DataGridView into an AdoDb recordset, then you can use this method to accomplish your goal. [URL="http://www.tek-tips.com/faqs.cfm?fid=6739"]http://www.tek-tips.com/faqs.cfm?fid=6739[/URL] | |
Re: Have a look at these sites: 1) [URL="http://www.dreamincode.net/forums/index.php?showtopic=37361"]http://www.dreamincode.net/forums/index.php?showtopic=37361[/URL] 2) [URL="http://www.codeproject.com/KB/vb/tracker.aspx"]http://www.codeproject.com/KB/vb/tracker.aspx[/URL] [QUOTE=pradeepc1;1165457]Hello all, 1) I want to know how to use the serial component in the toolbox of VB2008 express edition. 2) I want to how to plot a graph in VB2008 express edition.[/QUOTE] | |
Re: How about we shorten this code a bit... [CODE] Private Sub PnlDelete_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PnlDelete.MouseUp PnlDelete.BackgroundImage = My.Resources.BtnUp Try PnlDelete.BackgroundImage = My.Resources.POS_Btn_Up ListView1.SelectedItems(0).Remove() If File.Exists("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt") Then File.Delete("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt") End If Dim writer As New StreamWriter("C:\Program Files\POS\Autopay Terminal\BillPaymentRecords.txt", True) For Each item … | |
Re: If you need to run some code on the SQL Server, that needs to be dynamic. Why not use Stored Procedures. As you probably know, they can take arguments and perform different tasks. And thus, create a SP with some common code and perform some action based on what the … | |
Re: Perhaps if you check the number of items in the listview? [CODE] If ListView1.Items.Count = 0 Then paymentBtn.Enabled = False Else paymentBtn.Enabled = True End If [/CODE] | |
Re: Have you tried [B]WebBrowser1.Url.AbsolutePath[/B]? | |
Re: Well, since you are the author of this program then you are the only one who fully understand how the program works. So, you are the only one who can create the help form. | |
Re: Assuming that your datagridview is databound, and it's datasource is Me.Blood_bank_ds.st_name. Have you tried using a BindingSource object? [CODE] Public Class st_name Private source As New BindingSource Public Sub st_name_Load(.... DataGridView1.DataSource = source End Sub Private Sub Button2_Click(..... Me.St_nameTableAdapter.Fill(Me.Blood_bank_ds.st_name) 'This will update the bindingsource, and because it's already tied to … | |
Re: You need to iterate through all the rows in the listview, and compare the content of the cells in the first column with the content in the textbox. Like so: [CODE] For Each item As ListViewItem In listview1.Items If item.SubItems(0).Text = textbox1.Text Then MessageBox.Show("That name is already in the list.", … | |
Re: There are several ways to connect to a database on another computer. If the database is on a Microsoft SQL Server, then you have the System.Data.SqlClient namespace. If the database is an Access database, then you have the System.Data.OleDb namespace. So, assuming the the database is an MS SQL Server … | |
Re: label1.BackColor = Color.Transparent | |
Re: [CODE] combProductName2.SelecedIndex = combProductName2.FindExact(tbProductName.text) [/CODE] | |
Re: Yes, you can use the startup forms Form_Load event. If you call upon a second form to display as a dialog, then the execution of the Form_Load will "halt" until you close that second form. [CODE] Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim players … | |
Re: Assuming that you already have three columns in the listview. Here's how you can do that. [CODE] Dim xdoc As XDocument = XDocument.Load("url") Dim query = From rssFeed In xdoc.Descendants("item") _ Select Title = rssFeed.Element("title").Value, _ Description = rssFeed.Element("description").Value, _ Link = rssFeed.Element("link").Value For Each item In query Dim item … | |
Re: In order to determine the datatype, you first need to determine the content type. If the content type is String, then you need to find out if it's strictly numeric. And if that is the case, then the content can be cast as Integer/Double/Decimal, or else you have to do … | |
Re: Assuming that the "table" is a DataTable object, then adding columns is very easily done. [CODE] 'Assuming that the customer table is a DataTable object called dTable. 'First add the four new columns with a datatype of String dTable.Columns.Add("data1", GetType(String)) dTable.Columns.Add("data2", GetType(String)) dTable.Columns.Add("data3", GetType(String)) dTable.Columns.Add("data4", GetType(String)) 'Next, iterate through all … | |
Re: [CODE] Private Sub listview1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles listview1.Click If listview1.SelectedItems.Count > 0 Then 'If listview2 is databound listview2.DataSource = Nothing 'Else listview1.Items.Clear() PopulateDetailsView(listview1.SelectedItems(0).SubItems(0).Text) End If End Sub Private Sub PopulateDetailsView(ByVal condition As String) Dim SQL As String = "SELECT * FROM table WHERE item = … | |
Re: You should look into the uses of StreamReader and StreamWriter. [CODE=VB] 'Reading files Private Sub ReadFile(Filename As String) Dim stream As New IO.FileStream(Filename, IO.FileMove.Open) Dim sr As New IO.StreamReader(stream) Dim line As String = "" While sr.Peek <> -1 'Read until EOF line = sr.ReadLine End While sr.Close() stream.Close() End … | |
Re: I posted the answer to a similar problem i May. Perhaps it could be of some help: [URL="http://www.daniweb.com/forums/thread280800.html"]deleting a line from text file using VB.Net and edit[/URL] | |
Re: Basically, all you have to do is create a shortcut on each users desktop, pointing to the executable of your program. Ex: \\server\share\yourprogram.exe, or <network driveletter>:\yourprogram.exe For more information on how to deal with database concurrency issues, you might wanna google with these keywords: vb.net multiple users concurrency | |
Re: You can download icons from any free icon repository on the internet. Then go the project properties and select the Application tab. There you can see a dropdown box called Icon. Select <Browse...> from the list and select the icon image you just downloaded. Save. Aaaand, your done. :) | |
Re: I had some success using the [URL="http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html"]Oracle Data Access Components[/URL]. Just install and add a reference to Oracle Data Provider for .NET 2.0 10.2.0.2.20. Then, add the line Imports System.Data.OracleClient. | |
Re: For the first problem, locking the textbox. Add this event: [CODE] Private Sub BegBalance_Leave(ByVal sender As Object, ByVal e As EventArgs) Handles BegBalance.Leave If BegBalance.Text = String.Empty OrElse BegBalance.Text = "0" Then Exit Sub BegBalance.ReadOnly = True End Sub [/CODE] And then, in your RstButton click event. Add the line … | |
Re: It sounds like an indexing problem. Perhaps this article could be of some use: [URL="http://www.databasejournal.com/features/mssql/article.php/1443581/Index-Optimization-Tips.htm"]http://www.databasejournal.com/features/mssql/article.php/1443581/Index-Optimization-Tips.htm[/URL] | |
Re: If you mean that you would like to show the RTF data as a PDF, then there are ways to first convert the RTF into HTML. And from there you can use iTextSharp to convert the HTML into a PDF. [URL="http://www.codeproject.com/KB/recipes/RtfConverter.aspx"]Writing your own RTF converter[/URL] [URL="http://stackoverflow.com/questions/2593116/need-help-with-creating-pdf-from-html-using-itextsharp"]Need help with creating PDF … | |
Re: First create a crystal report and design it in the way you like. Then add these lines of code for whatever event you like to use for generating the report. Assuming that DT_Data can be cast as DataTable. [CODE] Dim crp As New CrystalReport1 crp.SetDataSource(DirectCast(DT_Data, DataTable)) [/CODE] | |
Re: SQL has a function called SUM(), which does exactly what the name implies. So, in your SQL string you can do this: [CODE=SQL] INSERT INTO dbo.RetailerBalance([BoothID], [GrandTotal], [Accumulated]) VALUES ('" & Form1.txtBoothID.Text & "','" & frmCurrentBalance.lblBalance.Text & "',SUM([GrandTotal])) [/CODE] | |
Re: This line: mySqlCommand = New SqlCommand("Select sno from cmtable,mysqlconnection") Move the quotation mark into this: mySqlCommand = New SqlCommand("Select sno from cmtable", mySqlConnection) | |
Re: Ok. From the beginning. From populating your combobox, selecting table and reading into DataGridView. This assumes that the database type is an MS SQL server. [CODE] Imports System.Data.SqlClient '''Read table names from database Private Sub ReadTables() Dim con As New SqlConnection("<connectionstring>") Dim com As SqlCommand = Nothing Dim dr As … |
The End.