800 Posted Topics
Re: You can try to force the software to use 32 bit datatypes with a statement like this. Try '...Your Code. Dim shortVal As Short 'Replace this with your short variable. Dim i32Converted As Int32 = Convert.ToInt32(shortVal) 'Commit the 32bit value to the database. '...Your Code to update database. Catch ex … | |
Re: You have to update the datasource of the datagrid view. A DataAdapter will do the job: Dim da As OleDB.OleDBDataAdapter(New OleDB.OleDBCommand("SELECT * FROM TabelName",MyDbConnection)) 'Make sure the connection passed in is open. da.UpdateCommand = New OleDBCommandBuilder(da).GetUpdateCommand()' If not you will have to open the connection before calling this line. da.Update(MyDataGridViewSource) … | |
Re: This will be an extremely complex thing to do it VB.NET, but [here](http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm) is an example for SQL Server (Syntaticly Close to Access) | |
Re: If the items that are in the access database combobox are infact in a table, then yes. If not, you will need to create a table, drop the data in, bind the data, and fill the combobox. [Here](http://www.codeproject.com/Articles/3665/Data-binding-concepts-in-NET-windows-forms) is an example of DataBinding to help you understand the concept. | |
Re: You can also try using a [Masked Text Box](http://msdn.microsoft.com/en-us/library/kkx4h3az.aspx). | |
Re: I honestly hope you don't think some one is going to help with a **Spam bot**. | |
Re: Do you have code that draws the chart, or are you using some kind of office interopt to draw it? | |
Re: If you are using a Query to fill that report (99.99% sure you are at some point) I would check that Query for parameters than need to be passed in. [Here](http://stackoverflow.com/questions/542510/how-do-i-create-a-parameterized-sql-query-why-should-i) is an example. | |
Re: Do you have code that fires on exit click? If so: I would start there. Step through the code and see where it stops. If not: I would start with Cleaning/Rebuilding the Solution. Build > Clean Build > Rebuild It has worked for me a few times. | |
Re: [AutoPostBack](http://www.w3schools.com/aspnet/prop_webcontrol_textbox_autopostback.asp) and [IsPostBack](http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx) | |
Re: If you are wanting the button - you can try to reference the last clicked button to figure out which one was clicked. Example: Dim btnLastClicked As New Button Private Sub Button2_Click(sender As Object,e As EventArgs) Handles Button1.Click btnLastClicked=CType(sender,Button) 'btnLastClicked will now reference Button1 End Sub Private Sub Button2_Click(sender As … | |
Re: You can do as Jim has said and shave a VERY small amount of time off by placing everything inside of the If statement: If MsgBox("Do you want to Delete?", MsgBoxStyle.YesNo, "Confirm") = MsgBoxResult.Yes Then Dim cmd As new OleDBCommand("",con) cmd.CommandText = "DELETE FROM [" & EBU2DB_LOB & "] " … | |
Upon resizing an anchored combobox - I noticed the text was always selected. This sparked the initiative to fix this problem. (Microsoft decided not to) So by extending the combobox class we can fix this. The following class can be dropped into a form for designer manipulation or as a … | |
Re: Can you have something like this: Do While True strVarName = ds.Tables("MyTable")(iRow)("varname") strVarValue = ds.Tables("MyTable")(iRow)("varvalue") If Execute(strVarName, strVarValue) Then Exit Do 'If the function returns True, the loop will exit. Loop Private Function Execute(ByVal sVarName As String, ByVal sVarValue As String) As Boolean 'Your code here End Function Or am … | |
Re: Under your project's settings you can set the targeted deployment platform. Project > YourProjectNameHere Properties > Compile > Change Configuration to Release > Change Platform Et Voila | |
Re: Do you have crystal reports installed on the developer machine? If not - see [here](http://www.crystalreports.com/). If so - [Here](http://www.codeproject.com/Articles/9781/How-to-Load-and-Display-Crystal-Reports-in-VB-NET) is a great reference project on CodeProject. | |
Re: After a quick google search, I have found [an article](http://social.msdn.microsoft.com/Forums/is/windowsdirectshowdevelopment/thread/560fb66c-76f4-4d5d-87ec-90bc683120df) that may be of use to you. | |
Re: I think your problem may be just as George and tins have stated. I think you are simply passing in a string that may have an extra space or a character that's not expected. Step through and look at the autos to see what is happening with your code. | |
Re: ListViewItems are zero based. Therefore 0 will be column one, and 1 will be column two. | |
Re: Sounds more like a torjan/virus than a browser hijack. Try [Malwarebytes](http://www.malwarebytes.org/) - It's free and works great. | |
Re: You will have to keep track of total time elapsed that the application has ran. You can't assume the app will stay loaded into memory for 10 days - therefore you will have to look into storing the total time it has spent running. You can use Registry Keys, Serialized … | |
Re: If you are using datasets - You may have the problem of opening and closing a connection the same table multiple times. When I do this I declare one connection that will stay open until all operations are completed on that table - then close. If this is not the … | |
Re: You can simplify this code with something like this: Public Class Main Dim rnd As New Random Dim iNumberToGuess As Integer Private Sub btnEnter_Click(sender As Object, e As EventArgs) Handles btnEnter.Click Try If IsNumeric(txtAttempt.Text) Then If CheckGuess(CInt(txtAttempt.Text)) Then Dim res As DialogResult = MsgBox("Do you want to exit the application?", … | |
Re: Is the DGV databound? When you say it would be activating a checkbox and pressing a button, do you mean: 1) The user presses a check box 2) The user presses delete or 1)The application fires off a checkbox 2)The application fires off a button_click event | |
Re: What event are you firing the code at? | |
Re: Try setting the window parent of form2. 'Place a statement to check and launch. 'The check is to safeguard from InvalidOperation Exceptions. If Form2.Visible = False Then Form2.Show(Me) 'A simple call like: Form2.TextBox1.Focus() 'Will then focus the control desired. | |
Re: You can fix your problem by simply opening the connection to communitcate. Use Reverend Jim's Code and add the following line before da.Fill(ds) da.SelectCommand.Connection.Open() da.Fill(ds) | |
Re: You will have to look into using [Hooks](http://support.microsoft.com/kb/319524). | |
Re: Are you wanting to listen for events while the application has focus, or when the application is running and focus isn't required? If the first, then you just need to implement a timer/event lister on your form and place something like this in the timer.Tick event: Private iSecondsElasped As Integer … | |
Re: You might also want to look into using a data adapter do reduce the amound of code you have. For example: Private Sub UpdateData() 'You can place your select statment here... 'Don't worry about selecting certian columns... you will only edit the ones you want in the code below. Dim … | |
Re: If you want to search for all occurrances simultaneously, then you might want to check into [multithreading](http://www.codeproject.com/Articles/15104/Multithreading-with-VB-NET-A-beginner-s-choice). | |
Re: Have you verified that the ftp site allows folder creation? Also, you can clean the code with something like the following: private WebResponse CreateDirectory(string sDir) { try { FtpWebRequest req = FtpWebRequest.Create(sDir); req.Credentials = new NetworkCredential("username", "passw"); req.Method = WebRequestMethods.Ftp.MakeDirectory; WebResponse Response = req.GetResponse; return Response; } catch (Exception ex) … | |
Re: Kind of an OCD thing - but You can make your code a little cleaner with something like this: Dim iCount as Integer = 1 For Each t As TextBox In Me.Controls xlSheet.Cells(1,i).Text = t.Text i+=1 Next | |
Re: If the library's source code is not accessible - then you can't. Only if the function takes a structure in as a parameter can you pass it in. You would have to recreate the function. ( to overload the first ) If you **DO** have the source code, just modify … | |
Re: Try building a custom handler for it. 'Declare the textbox as so: Dim WithEvents txtBox1 As New TextBox Private Sub txtBox1_MouseDown(sender As Object, e As Windows.Forms.MouseEventArgs) Handles txtBox1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then MsgBox("Left mouse button was pressed!") ElseIf e.Button = Windows.Forms.MouseButtons.Right Then MsgBox("Right Mouse Button was pressed!") ElseIf e.Button … | |
Re: Well you need to do the following: 1) Sit down and figure out what data needs to be stored ( You **WILL** need a database ) 2) Choose the [database](http://en.wikipedia.org/wiki/Category:Types_of_databases) that's right for you. 3) Design your atomic tables ([1NF](http://en.wikipedia.org/wiki/First_normal_form),[2NF](http://en.wikipedia.org/wiki/Second_normal_form),[3NF](http://en.wikipedia.org/wiki/Third_normal_form)) 4) Desing your GUI (With the end user in mind) … | |
Re: I use the following methods when I am editing data: Dim Con as New OleDBConnection("MyStringHere") Dim da As New OleDBDataAdapter("SELECT * FROM table",Con) Dim ds As New DataSet Try Con.Open() da.Fill(ds,"MyTable") ds("MyTable").Rows(0)("ColumName") = Me.Jan_Revenue2.Text ds("MyTable").Rows(1)("ColumName") = Me.Feb_Revenue2.Text ds("MyTable").Rows(2)("ColumName") = Me.Mar_Revenue2.Text da.UpdateCommand = New Data.OleDb.OleDbCommandBuilder(da).GetUpdateCommand da.Update(ds.Tables("MyTable")) Catch ex As Exception MsgBox(ex.ToString) … | |
![]() | Re: [Here](http://codebetter.com/petervanooijen/2004/02/11/exporting-from-crystal-reports-to-pdf-word-excel-and-html/) is an example in C# ([Translate](http://www.developerfusion.com/tools/convert/csharp-to-vb/)) to use as a reference point. |
Re: You can find a code [translator](http://www.developerfusion.com/tools/convert/csharp-to-vb/) for C#/VB.NET that will translate the code into something you can understand. (Hopefully) | |
Re: Does rumType.ToString() return a value? Step through the code in debug, and use intellisence to check if it does. | |
Re: Try this to see if the byte value is generating an image correctly: Using msStream As New IO.MemoryStream(pictureData) picture = Image.FromStream(msStream) If IsNothing(picture) = False Then frm.PB1.Image = picture Else MsgBox("Picture returned nothing") End If End Using | |
Re: You can try something like this: Dim WithEvents MonthCalendar1 As New MonthCalendar Private Sub MC1_DateChanged(sender As Object, e As DateRangeEventArgs) Handles MonthCalendar1.DateSelected 'This will get the dates Dim dtStart As Date = e.Start Dim dtEnd As Date = e.End 'This will create a timespan from those dates. Dim dtRange As … | |
After seeing quite a few posts today asking about event handlers for dynamicly created controls, I have decided to give a little example for reference. **Note that you should check [Microsoft's Documentation](http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx#inheritanceContinued) ( or research from web ) of any control if you are struggling** | |
Re: The first column in a listview hold's the value placed in the LVI's .Text property. Example: |Record| Name | Age | Date | |.Text |SubItem|SubItem|SubItem| This being said - you need to change your code to reflect this: lvwItem = ListView 1. Items. Add (reader.G etString (0)) To: lvwItem.Text = … | |
Re: The easier solution would be to set the control's anchors in the desinger. This will cut down on code. Unles, of course, you are creating these controls on runtime. | |
Re: I am not fully understanding your question. If you are asking for the code you are so close. Something like this: If ComboBox1.Text.Contains("x") Then Dialog1.ShowDialog() End If If not, then what **ARE** you asking? Please explain in more detail. | |
![]() | Re: Declare the string in the application settings, then call that setting. Example: 'In Application Settings Name | Type | Scope | Value myCon|String|Application|'Your Connection String Here 'In code Dim con As New OleDBConnection(My.Settings.myCon) If the string is changed in the application settings - it is changed globally. |
Re: I must be a wizard! I set the form border style to none and then set the form to maximize on form load. Works like a charm for me. Do you have any special form drawing code? | |
Re: Is the datagridview databound? Do you have a project data source? | |
Re: Whichever can envelop the "in" crowd will be the victor. There is a lot of money to be made through the use hype. |
The End.