419 Posted Topics
Re: Try using the CellClick event not CellContentClick event handler. Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvEmployee.CellClick TextBox1.Text = dgvEmployee.Rows(e.RowIndex).Cells(0).Value.ToString() TextBox2.Text = dgvEmployee.Rows(e.RowIndex).Cells(1).Value.ToString() TextBox3.Text = dgvEmployee.Rows(e.RowIndex).Cells(2).Value.ToString() End Sub | |
Re: I take it that you are using VS2008 or ealier when we still had deployment projects. The only way that I know that the "Add Project Output Group" dialog would be empty is if the startup project is the only one in the soultion that holds the setup project. . Does this mean that you first fill a datatable from the database and then set the dgv.DataSource equal to the datatable? If so, that … | |
Re: I'm not sure if this is applicable to your situation, but take a look at : http://cgeers.com/2008/02/03/monitoring-a-smartcard-reader/ | |
Re: Here are two options: This one whould update after you leave the first column. private void dgv1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) return; if (sender is DataGridView && e.ColumnIndex == 0) { DataGridView dgv = (DataGridView)sender; if (dgv1.Equals(dgv)) { // set the value as needed dgv.Rows[e.RowIndex].Cells[2].Value = … | |
Re: I suggest that you take the time to go through this information: [Working with Datasets in Visual Studio](http://msdn.microsoft.com/en-us/library/8bw9ksd6%28v=vs.100%29.aspx) In particular, the walkthroughs at the bottom of the [Dataset Designe](http://msdn.microsoft.com/en-us/library/314t4see(v=vs.100).aspx)r topic. | |
Re: I like using datatables and a rowfilter for this type of stuff. Here is a simple example. I manually loaded the DataTables, but you would do this with your file contents. You could also do your text files as xml and load the table directly with the xml definition. Most … | |
Re: Personally I prefer VB.Net. If your goal is improve marketable skills in a few weeks and you already have a C background, it will be much easier for you to pick-up C#. Unfortonately, VB is viewed by many as an inferior language (even though it essentially equal to C#). MS … | |
Re: Running a search on "HttpContext.Current null" I cam across this article that may explain what you are seeing. http://odetocode.com/Articles/112.aspx | |
Re: On which button click did the error occur? Here are some recommended changes: Private Sub OpenFileDialog1_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) ' Dim strm As System.IO.Stream delete this and the next line ' strm = OpenFileDialog1.OpenFile() TextBox1.Text = OpenFileDialog1.FileName.ToString() If Not (strm Is Nothing) Then ' Display the image ' … | |
![]() | Re: try: `Dim swriter As New StreamWriter(Application.StartupPath & "\TeachersCourses.dat", append:=True)` ![]() |
Re: That's a new error message to me :/ Usually it's along the lines of cannot delete file blah blah... Are you sure you do not have an instance of the program running? It may have crashed and did not fully unload from memory and release the file. Sometimes you will … | |
Re: I am going to assume that you mean adding a video to the embedded resources. From the menu, goto Project->Properties. Then select the "Resources" tab. Next Select "Add Rersource"->"From Existing File". You can then select your video file. The file will be inserted with the File Name minus the extension … | |
Re: Assuming that the field is stored as a DateTime type, If dr.IsDBNull(5) Then TxtAppointmentdate.Text = "" Else TxtAppointmentdate.Text = dr.GetDateTime(5).ToShortDateString() End If | |
Re: Tinnin, Why are you going through all this work just to read in values from an Excel file? What does converting it to a CSV format gain you? You could use the Excel interop to read the values directly. Alternatively, you could use ADO.Net to read the files without any … | |
Re: Do you mean play an embedded file? If, so I believe you will first have to write the file out to the disk first and then point the media player to that file. | |
Re: Use one of these forms of parsing: ` i = Integer.Parse("1")` - will throw an exception if conversion is not possible ` Integer.TryParse("1", i)` - will not throw exception, leaves i unchanged | |
Re: I think the problem that you where having is the order that that you where adding the parameters. OleDB ignores the parameter names and substitutes them in sequential order. In the SQL CommandText, you could type pretty much any unquoted text where it expects a value and it will treat … | |
Re: I believe you are going to have to normalize and strip the diacritics from the string first. see: http://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net You could add new column to your datatable with the processed string and then do the row filter against that processed string. Or you could use LINQ to create a list … | |
Re: see: [Anchor controls and resizing userform](http://www.andypope.info/vba/Anchor.htm) | |
Re: >infor = false I think that should be `Info=false;` | |
Re: Sure it is doable! You just have to code it. :)) Here is a crude implementation of a custom textbox with this capability. You have to double click on a item to select it. You could change that to single click if you want. You may need to change the … | |
Re: UKnod, That code is just plain nasty! :( It appears that you want to add a new record to the History table in the database. You have created a dataset (ds5) elsewhere in your code. Does your code need to access the dataset's History table elsewhere, or do you create … | |
Re: >System.Data.OleDb.OleDbConnection' cannot be converted to 'System.Data.SqlClient.SqlConnection To be blunt about what BegginnerDev alluded to: >Which warrants the question, why are you cross calling the SQLClient and OLEDB libraries? change: `Dim constr as new OleDb.OleDbConnection` to: `Dim constr As New SqlConnection` Also, why are you creating and immediately disposing the adapter … | |
Re: >I want to set the focus only the first time the form is loaded, from that point on I want the tab control to dictate the navigation. Then use either the Form.Shown event or Form.Load event. | |
Re: Just posting this as a FYI as a potential source for low cost reference books, if you don't have a problem buying used books. For the one deceptikon referenced: http://www.biblio.com/search.php?author=cormen&title=Introduction+to+Algorithms&keyisbn=&format= p.s.: I should mention that they can be shipped from all over the world, so it may take a few … | |
![]() | Re: Is the dgv StudentList backed by a datatable? If so, add a boolean column (call it Selected)to the datatable then create two dataviews. Then create two dataviews filtered on the new column being either true (Selected) or false and use the dataviews as the datasource for the respective datagridviews. Then … |
Re: give this pattern a try Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted If WebBrowser1.Url = e.Url Then ' this is the one you want ' run your code against WebBrowser1.Document End If End Sub | |
Re: Are you using a relative or absolute path. If it is a relative path, it will be relative to the current working directory. Try adding this to your code to retrieve the PictureBox's error reason. Private Sub CompanyLogo_LoadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles CompanyLogo.LoadCompleted If e.Error IsNot … | |
Re: [HOW TO: Determine Printer Status and Print Job Status from Visual Basic](http://support.microsoft.com/kb/202480) | |
Re: "Sender" typically is the control prompting the call to the event handler method. Cast it to the type of control you hope it is after a bit of chgecking first. Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) If sender IsNot Nothing AndAlso TypeOf sender Is Label Then … | |
Re: > now the question is how can i get the that name to be used in my query? > using loop? > i will use it to be the name of my table i want to search. > >I hope you understand what i mean. Nope!, I do not understand. … | |
Re: Since you state that you are using a VB Express Edition, this question should be moved to the VB.Net forum. Depending on the volume of data and security needs, you could use any of the options you listed, but I would stay away from using Excel files since that option … | |
Re: You should calculate the monthly payment once based on the initial loan amount and not in your loop based on remaining balance. Are you using the Financial Class from the VisualBasic Namespace? If so, then your usage is incorrect and you should review the [documentation](http://msdn.microsoft.com/en-us/library/xxkhsh9h.aspx). | |
Re: >But when i run the setup to install it in another computer which is a 64bit. My project didnt connect to the database which is access. The most likely issue is that the target install can not find the DB provider. If you are using the Jet provider, your application … | |
Re: Hi Dj, I know that this type of error can be frustrating, but it is happening for a logical reason. When you start application, an instance of Form1 is created. During it's creation the form level variables are created first. The problem is occuring with this statement: `Dim myUri As … | |
Re: >If StatusDate.Year <> "1900" Then Assuming "StatusDate" is a DataTime structure, then the "Year" method should be returning an integer value and not a string. Put `Option Strict On` at the top of your code and see how many other issues the IDE flags for you. I'm not saying this … | |
Re: look at your code with a bit of formatting. Do Until rs.EOF If rs!RegNo = Text2.Text Then If IsNull(rs("Name")) Then answer = MsgBox("The Register Number You Entered Didnt Provide All The Inforamtion Do you still Want to Display the Details", vbYesNo + vbExclamation, "Alert") If answer = vbYes Then Text1.Text … | |
Re: > xlWorkBook = xlApp.Workbooks.Add > ' first worksheet > If xlApp.Application.Sheets.Count() < 1 Then > cmd.CommandText = "Select * From students" > cmd.Connection = connection > da.SelectCommand = cmd > da.Fill(dt) > dgrid.DataSource = dt > location = SaveFileDialog1.FileName > xlWorkSheet = CType(xlWorkBook.Worksheets.Add(), Excel.Worksheet) > xlWorkSheet = xlWorkBook.Sheets("Students") I believe … | |
Re: Don, No offense intended, but you need to get more of the basics (no pun intended) under control first. Learn to use the debugger. It is there for reason it and is your best friend. [Debugging User Interface Reference](http://msdn.microsoft.com/en-us/library/vstudio/cwzf7x3e%28v=vs.100%29.aspx) Set a break-point in your code and inspect the variable's contents … | |
Re: You need to retrieve the command-line arguments, if any, and test the first argument. It should be the file that launched the application. Dim fi As IO.FileInfo ' used to test for file properties If My.Application.CommandLineArgs.Count > 0 Then fi = New IO.FileInfo(My.Application.CommandLineArgs(0)) If fi.Exists Then Select Case fi.Extension.ToLower Case … | |
Re: Your main problem is that the checkbox is not very amenable to using an image to indicate the checked state. You are trying to paint over the box and that is always going to look strange. Here is a custom control that I hammered out quickly based on a Button. … | |
Re: @Jim, right idea, but wrong laguage. This forum is for VB4 through VB6, not VB.Net. Dim Lines() As String Lines = Split(linereadfromcomm, vbNewLine) ' determine number of text items extracted from linereadfromcomm ' so that you do not try to reference an array element that does ' not exist when … | |
Re: Not sure of what use this would be, but for OLEDB connections you could do it like this: Private Sub Search() Dim conn As New OleDb.OleDbConnection("Your Connection String ") conn.Open() ' get all tables filtered to user tables Dim dbTables As DataTable = conn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "Table"}) … | |
Re: Perhaps something like this will work for you. Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With ListView1 .Alignment = ListViewAlignment.SnapToGrid .AllowDrop = True .AutoArrange = False .Scrollable = False .View = View.LargeIcon End With End Sub Private Sub ListView1_ItemDrag(ByVal sender As Object, … | |
Re: [Pie Chart in WPF](http://www.c-sharpcorner.com/uploadfile/mahesh/pie-chart-in-wpf/) | |
Re: > `PopulateGridView(.SelectedValue.ToString());` SelectedValue will be a DataRowView and not the Text displayed in the combobox. Use: `((DataRowView)comboBox1.SelectedValue).Row["TABLE_NAME"].ToString()` or I guess you could just use comboBox1.Text. Also, it would probably be a good idea to dispose of the datagridview data source before re-assigning it to a new DataTable. if (dataGridView1.DataSource != … | |
Re: vbBack is string value try Asc(vbBack) |
The End.