800 Posted Topics
Re: Can you post the code you are using to sort? | |
Re: 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 … | |
Re: 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") … | |
Re: 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 … | |
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#: … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: Do you have a code snippet we can look at to help troubleshoot? | |
Re: 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, … | |
Re: 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. | |
Re: Try this usefull website. [url]http://www.connectionstrings.com/[/url] | |
Re: Look at [URL="http://www.connectionstrings.com/"]this[/URL] usefull website. | |
Re: 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. | |
Re: Are you using any DBMS? | |
Re: Have you tried: [CODE] If cmd.ExecuteNonQuery() = False Then 'Your code here End If [/CODE] | |
Re: 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. | |
Re: You could try something like this: [CODE] My.Settings.GCRConnectionString = "new string info here" My.Settings.Save() [/CODE] | |
Re: You can use this as a reference. [url]http://minnie.tuhs.org/CompArch/Tutes/week02.html[/url] | |
Re: 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] | |
Re: What kind of file are you trying to open? Is it an office file, text file, datatbase, picture or what? | |
Re: Are you creating X dynamicly during run time or is X a public variable that is created on form load? | |
Re: What hericles is saying is true. I have found this out the hard way. | |
Re: 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. | |
Re: Can you post the code that is fired when the user changes the index? | |
Re: Did you add the setting the My Project > Settings tab? | |
Re: 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] | |
Re: 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, … | |
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, … | |
Re: 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. | |
Re: 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] | |
Re: 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. | |
Re: 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. | |
Re: See this article: [url]https://discussions.apple.com/thread/2502445?start=0&tstart=0[/url] | |
Re: 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. | |
Re: 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. | |
Re: You could change int to long [CODE] long nbr1=0,nbr2=0,result=0,rest=0; [/CODE] | |
Re: Here is a good reference for grid views. The project also contains printing if needed. [URL]http://www.knowdotnet.com/articles/printgriddemo.html{/URL] | |
Re: If you want a "watermark" on a form, you can use a label with the text color very close the the default form color. | |
Re: [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] | |
Re: 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] | |
Re: You can use [CODE]Me.WindowState = FormWindowState.Maximized[/CODE] | |
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 … | |
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 … | |
Re: You can use something like the following: [CODE] if condition1 or condition2 or condition3 or condition4 Then Else End If [/CODE] | |
Re: 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 … | |
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 … | |
Re: 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! | |
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 … |
The End.