800 Posted Topics

Member Avatar for remya1000
Member Avatar for Shodow

After beating my head into the wall 1,000 times over when working with listview, I have discovered an easy way. By: [CODE] Dim index as String For Each sItem As ListViewItem In DatabaseListView.SelectedItems index = sItem.Text Next 'this will select the item at the start of the row that is …

Member Avatar for Reverend Jim
-1
290
Member Avatar for artemix22

Create a datatable: [CODE] 'Where table name is the table in the db. Dim dt As DataTable = ds.Tables("tablename") Dim newRow As DataRow 'Setting up the table for the data newRow = dt.NewRow() 'You should replace "column1" and "column2" with the column name in your db. newRow("column1") = TextBox1.Text newRow("column2") …

Member Avatar for artemix22
0
149
Member Avatar for mrbungle

As reverend stated. It is much easier to create a settings variables such as ServerIP that holds the value from the server ip text box. That way, on form_exit you can call: [CODE] with My.Settings .ServerIP = txtServerIP.text .Save end with [/CODE] That way you can call it on the …

Member Avatar for M.Waqas Aslam
0
201
Member Avatar for Begginnerdev

Hello my fellow Daniwebaholics! I know it is kindof off the wall, but I need help converting a piece of C# code to VB.net. I know a little C#, but not enough to be able to convert complex syntax from one to the other. Here is the code in C#: …

Member Avatar for Begginnerdev
0
363
Member Avatar for Mits14

Wrap your code in a try/catch and like this: [CODE] try 'Your code here catch ex as exception msgbox(ex.message) end try [/CODE] This will tell you what line your error is on.

Member Avatar for Begginnerdev
0
785
Member Avatar for trisha0906

You will need to create table with an integer field with a default of 0. On form_load you will want to pull the value from the database and add 1 to it. On form_close you will want to save that value back to the database. You can use my previous …

Member Avatar for trisha0906
1
2K
Member Avatar for bhavan kamble

You will want to create a data table form the database. Then you will use the selected index of the combobox to pull from the datatable. Example... Select Case cbMenu.SelectedItem Case 1 TxtRate.Text = dt.Rows(0).Column(1) ...... This will get the value stored in the second column of the corrosponding table …

Member Avatar for bhavan kamble
0
2K
Member Avatar for srm2010
Member Avatar for srm2010
0
188
Member Avatar for jasleen_kaur

Which program are you using to create the setup script? You need to pack the .exe in the setup, not the solution. The .exe can be found in the project bin/release folder. You will need to package all libraries that are not a commonly installed library too. To do this, …

Member Avatar for Reverend Jim
0
157
Member Avatar for morrish7

You will need to first create a connection to the database. [url]http://www.connectionstrings.com/[/url] [URL="http://www.daniweb.com/software-development/vbnet/threads/407064"]Database Code Sample[/URL] Then you will want to create a data table containing the values from the database. You will then populate the combobox with the datatable column desired.

Member Avatar for Begginnerdev
0
123
Member Avatar for yumyam09

Try this usefull website. [url]http://www.connectionstrings.com/[/url]

Member Avatar for Begginnerdev
0
202
Member Avatar for nad_nadi27
Member Avatar for Begginnerdev
0
120
Member Avatar for neh555

You can also use my previous post [URL="http://www.daniweb.com/software-development/vbnet/threads/407064"]here[/URL] for a quick overview of connecting to a database with an oledb client.

Member Avatar for Begginnerdev
0
90
Member Avatar for clflyer
Member Avatar for PF2G

Have you tried: [CODE] If cmd.ExecuteNonQuery() = False Then 'Your code here End If [/CODE]

Member Avatar for adam_k
0
124
Member Avatar for rhone0809

If you are wanting ID's to be unique, you might want to think about making it a primary key. Thus making it not possible to have multiples. Then you can wrap your insert in a try catch, the client will handle the "No duplicate keys" message.

Member Avatar for Begginnerdev
0
212
Member Avatar for bluehangook629

You could try something like this: [CODE] My.Settings.GCRConnectionString = "new string info here" My.Settings.Save() [/CODE]

Member Avatar for bluehangook629
0
2K
Member Avatar for thebigbroski

You can use this as a reference. [url]http://minnie.tuhs.org/CompArch/Tutes/week02.html[/url]

Member Avatar for Begginnerdev
0
54
Member Avatar for yumyam09

You can do what archelle stated by this simple if statement. [CODE] If conn.State = ConnectionState.Open Then conn.Close() conn.Dispose() End If [/CODE]

Member Avatar for archelle
0
170
Member Avatar for jaimin4829
Member Avatar for SimplyFred
0
136
Member Avatar for ng5

Are you creating X dynamicly during run time or is X a public variable that is created on form load?

Member Avatar for codeorder
0
2K
Member Avatar for neh555

What hericles is saying is true. I have found this out the hard way.

Member Avatar for Pgmer
0
248
Member Avatar for roottybrian

You could also write a tiny app with a text box. The user puts the sql command in the text box and presses a button. The button will fire off code that will bind the text string to a command and ExecuteNonQuery.

Member Avatar for roottybrian
0
116
Member Avatar for ng5
Member Avatar for ng5
0
345
Member Avatar for khizer03
Member Avatar for lbgladson

Could wrap the whole thing in a while loop too. [CODE] Dim ex As String = "" While ex <> "exit" 'your code here Console.WriteLine("Type exit to exit the application") ex = Console.ReadLine() End While [/CODE]

Member Avatar for Begginnerdev
0
252
Member Avatar for aaronoafc

The above suggestion is correct, The program might also be terminating to fast for you to see. Try wrapping the program with a while. Like this: [CODE] Sub Main() Dim uservalue As String Dim ex As String = "" While ex <> "exit" Console.WriteLine("What football team do you support? Oldham, …

Member Avatar for Begginnerdev
0
131
Member Avatar for Begginnerdev

I have recently written a VB.NET application and I am stuck on the deployment. I can't use the ClickOnce, because the program has to be installed on the machine under program files, therefore, I use InnoSetup. My problem is that the application requires sqlclient and .net 4.0 to be installed, …

Member Avatar for Begginnerdev
0
814
Member Avatar for AquaNut

You could store all your data in an array in the text boxes "TextChanged" event procedure. Then use a statement like: [CODE] Dim tmp As String If (arrayname[i].getLength() = 8) Then tmp = arrayname[i] arrayname{i] = "0" + tmp End If [/CODE] looping through the array checking each value.

Member Avatar for Reverend Jim
0
213
Member Avatar for ng5

You can also do: [CODE] Public Class Form1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Form2.Show() Form2.TextBox1.Text = Me.TextBox1.Text 'Where Me references Form1 - the TextBox1 from Form1 End Sub End Class [/CODE]

Member Avatar for ng5
0
162
Member Avatar for trisha0906

If you wanted to limit the number of spaces, you can use Kothaisaravan's method, and incrememnt a counter every time they press the space bar. Then use an if statement with the counter = number and use the replace.

Member Avatar for trisha0906
0
113
Member Avatar for VB 2012

If you mean this: [url]http://www.componentfactory.com/product?id=3[/url] Then no, it is not "Free". It is just a 60 day trial.

Member Avatar for VB 2012
0
105
Member Avatar for lcfjoertoft

See this article: [url]https://discussions.apple.com/thread/2502445?start=0&tstart=0[/url]

Member Avatar for Begginnerdev
0
61
Member Avatar for Hussam Alahmadi

You will need to compare the values in the array, storing the higest in a temp value. After that then you will need to search the array for that value and increment a counter every time you find that value.

Member Avatar for stultuske
0
143
Member Avatar for gerchi152

What Jim is saying is correct. You will have to clear the list every time you change the combo box. That way you have a "fresh piece of paper" to load the new data back on.

Member Avatar for gerchi152
0
1K
Member Avatar for ulasoc
Member Avatar for kikic
Member Avatar for Begginnerdev
0
195
Member Avatar for nedrosat

Here is a good reference for grid views. The project also contains printing if needed. [URL]http://www.knowdotnet.com/articles/printgriddemo.html{/URL]

Member Avatar for Netcode
0
138
Member Avatar for sigridish

If you want a "watermark" on a form, you can use a label with the text color very close the the default form color.

Member Avatar for Begginnerdev
0
39
Member Avatar for YungSoprano

[CODE] OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & spath & ";Persist Security Info=True") [/CODE] Your connection string might be incorrect, it looks like it is missing some things. Here is a good reference for connection strings: [url]http://www.connectionstrings.com/excel[/url]

Member Avatar for YungSoprano
0
208
Member Avatar for dennis_ian

You can also try: [CODE] e.Graphics.DrawString("COUNTER 17" & Environment.NewLine & "Your number is " & Environment.NewLine & iTicket, TextBox1.Font, Brushes.Blue, 50, 50) [/CODE]

Member Avatar for Begginnerdev
0
88
Member Avatar for pankaj.garg
Member Avatar for pankaj.garg
0
1K
Member Avatar for Begginnerdev

I am having a problem with a datareader. [CODE] Do While myData.Read itmListItem = New ListViewItem() strValue = IIf(myData.IsDBNull(0), "", myData.GetValue(0)) itmListItem.Text = strValue For shtCntr = 1 To myData.FieldCount() - 1 If myData.IsDBNull(shtCntr) Then itmListItem.SubItems.Add(" ") Else itmListItem.SubItems.Add(myData.GetString(shtCntr)) End If Next shtCntr view_data.DatabaseListView.Items.Add(itmListItem) Loop [/CODE] I have used message …

Member Avatar for lolafuertes
0
287
Member Avatar for Begginnerdev

Hello, I have one more question. I am connectinag to SQL Server 2008, not express, and I keep getting the "login failed for user "..."" The connection string I am using is: [CODE] Dim connStrg As String = "Data Source=" _ & ServerAdressTextBox.Text & _ ";Initial Catalog=" & _ DatabaseNameTextBox.Text …

Member Avatar for Begginnerdev
0
2K
Member Avatar for razree

You can use something like the following: [CODE] if condition1 or condition2 or condition3 or condition4 Then Else End If [/CODE]

Member Avatar for Begginnerdev
0
194
Member Avatar for RaoxFaello

If using Visual Studio: Open visual Studio Create a new Project -> Windows Forms Application Give the project a name and create it. This will show you a blank form labeled form1 with nothing on it. To add another form go to Project - > Add Windows Form to add …

Member Avatar for Begginnerdev
0
89
Member Avatar for Begginnerdev

A co-worker and I are trying to compile a VB.Net / ASP.Net application on another machine. We are getting two different sets of errors. One set of errors lists 103 undefined statements with no library missing. The other error is, " It is an error to use a section registered …

0
84
Member Avatar for jgehlot09

I think that you have to make a header file containing that function. I would not quote me on this. You might want to find one of the more advanced C users. Hope this helps!

Member Avatar for jephthah
0
234
Member Avatar for Begginnerdev

Hello, I am still green to the C programming language. I am writing a multi-dimensional array program to store strings into an array. The program requires error checking to avoid overflow. I am using Visual Studio 2008. I am using a Windows O/S. The program runs fine on the first …

Member Avatar for Ancient Dragon
0
108

The End.