476 Posted Topics

Member Avatar for swathys

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.

Member Avatar for Oxiegen
0
284
Member Avatar for bklynman01

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 …

Member Avatar for Oxiegen
0
82
Member Avatar for hamzah123

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 …

Member Avatar for Oxiegen
0
95
Member Avatar for vb6forever

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 …

Member Avatar for oreallabac
0
227
Member Avatar for lpmike

Have you tried clearing the DataGridView control each time you select that tab, before calling the PopulateAccess method?

Member Avatar for Oxiegen
0
121
Member Avatar for ashwinshenoy

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]

Member Avatar for Unhnd_Exception
0
3K
Member Avatar for aispg8

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 …

Member Avatar for Oxiegen
0
164
Member Avatar for wilko1995

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.

Member Avatar for Oxiegen
0
70
Member Avatar for fabio.bozzo

[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 …

Member Avatar for Luigiview
0
259
Member Avatar for cyberdaemon

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 …

Member Avatar for cyberdaemon
0
255
Member Avatar for jamshed ahmed

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 …

Member Avatar for jamshed ahmed
0
98
Member Avatar for lielee

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" …

Member Avatar for CrankyMero
0
166
Member Avatar for RMelnikas

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 …

Member Avatar for Oxiegen
0
152
Member Avatar for SuperFurryToad

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 …

Member Avatar for el_vala
0
2K
Member Avatar for Smalls

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 …

Member Avatar for Smalls
0
399
Member Avatar for Vhyr

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 …

Member Avatar for Vhyr
0
96
Member Avatar for TIP.Synergy

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, …

Member Avatar for TIP.Synergy
0
222
Member Avatar for NikRadSystem

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.

Member Avatar for NikRadSystem
0
289
Member Avatar for trpsjt2008

You would normally get a list of command line arguments from an application by using the /? or -h/--help arguments.

Member Avatar for Oxiegen
0
143
Member Avatar for MaddTechwf

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 …

Member Avatar for Oxiegen
0
106
Member Avatar for kanuri1

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 …

Member Avatar for crishjeny
0
295
Member Avatar for cintojose

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]

Member Avatar for Netcode
0
289
Member Avatar for pradeepc1

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]

Member Avatar for anandharaajan
0
227
Member Avatar for swathys

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 …

Member Avatar for Oxiegen
0
123
Member Avatar for Tommymac501

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 …

Member Avatar for Tommymac501
0
302
Member Avatar for swathys

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]

Member Avatar for Oxiegen
0
145
Member Avatar for chukka32
Member Avatar for Ruby Nadeeya

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.

Member Avatar for Oxiegen
0
110
Member Avatar for tanvirahmad4914

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 …

Member Avatar for Oxiegen
0
132
Member Avatar for arjen

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.", …

Member Avatar for arjen
0
208
Member Avatar for markdean.expres

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 …

Member Avatar for markdean.expres
0
165
Member Avatar for iqlas
Member Avatar for aldoc1

[CODE] combProductName2.SelecedIndex = combProductName2.FindExact(tbProductName.text) [/CODE]

Member Avatar for poojashah623
0
2K
Member Avatar for discovery-power

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 …

Member Avatar for codeorder
0
85
Member Avatar for Vhyr

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 …

Member Avatar for Oxiegen
0
97
Member Avatar for nutsxiera

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 …

Member Avatar for Oxiegen
0
105
Member Avatar for jcfans

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 …

Member Avatar for Oxiegen
0
87
Member Avatar for mogaka

[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 = …

Member Avatar for Oxiegen
0
81
Member Avatar for Simran Kaur

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 …

Member Avatar for Simran Kaur
0
1K
Member Avatar for swathys

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]

Member Avatar for swathys
0
120
Member Avatar for AirGear

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

Member Avatar for Oxiegen
0
107
Member Avatar for mogaka

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. :)

Member Avatar for Oxiegen
0
92
Member Avatar for tejaskirodiwal

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.

Member Avatar for Oxiegen
0
87
Member Avatar for danielketchum

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 …

Member Avatar for Oxiegen
0
81
Member Avatar for perryg30313

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]

Member Avatar for Oxiegen
0
132
Member Avatar for bhagawatshinde

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 …

Member Avatar for Oxiegen
0
126
Member Avatar for jcfans

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]

Member Avatar for Oxiegen
0
149
Member Avatar for swathys

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]

Member Avatar for swathys
0
118
Member Avatar for jacobyohannan10

This line: mySqlCommand = New SqlCommand("Select sno from cmtable,mysqlconnection") Move the quotation mark into this: mySqlCommand = New SqlCommand("Select sno from cmtable", mySqlConnection)

Member Avatar for Oxiegen
0
206
Member Avatar for gurupts

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 …

Member Avatar for Oxiegen
0
157

The End.