No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
7 Posted Topics
Re: [QUOTE=aishapot;1642779]I put it in a module. Imports System.Data.SqlClient Module Module1 Public sqlconn As New SqlConnection Public sqlcmd As New SqlCommand [B]Public sqldr As SqlDataReader[/B] Public strsql As String [B]Public sqlda As SqlDataAdapter[/B] Sub connect() If sqlconn.State = ConnectionState.Open Then sqlconn.Close() sqlconn.ConnectionString = "data source=.\sqlexpress; integrated security=true; attachdbfilename=|datadirectory|\TESTING.mdf; user instance=true;" sqlconn.Open() … | |
Re: Hey, you could use something like this: [CODE]Dim path as string = "C:\Users\profile.DOMAIN" Dim Str as string() = path.substring(path.lastidexof("\")+1).split(".")[/CODE] with that you get Str with 2 values, the first one Str(0) should be profile, the second one Str(1) DOMAIN, now just use them as you please. | |
Re: Hi. Here are some alternate steps on how you can do it. 1. databind your datagridview in design mode 2. edit the desired column to make it a combobox column and add the items 3. then on the formload you can try this code : [CODE]Dim ds as new Dataset … | |
Re: You can get the value without the extra white spaces with the .trim method. [CODE]Dim Str as String() = Datagridview.Item(0,0).Value.ToString.Trim.Split(" ") [/CODE] Now you should have an array with 3 positions if the value has name, surname and last name. Also you can check the length of the resulting array … | |
Re: Pgmer already gave you the answer for your problem. Where you are doing this : [CODE] Private Sub ComboBoxSearchExist_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxSearchExist.SelectedIndexChanged bindingSource1.DataSource = Nothing bindingSource1.DataSource.Clear() End Sub[/CODE] you are just clearing the binding source, but not rebinding the datagridview to the cleared binding … | |
Re: Hey. You can try this code out, btw, i tried my best to understand your problem, and came out with this response, i hope it is kind of what you were looking for. (just adapt the first 3 lines of code and the last 2 to adapt to your database … | |
Re: Its really simple, the exception tells you everything. Before you can open a connection you need to assign the route of the connection string to the database. i.e. [CODE]Objconnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;" Objconnection.Open()[/CODE] |
The End.