Search Results

Search found 4472 results on 179 pages for 'vb'.

Page 66/179 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • How can I hide a property from going into the form designer file?

    - by user460334
    I am working in VB.NET 2010 Framework 2.0. I don't want to allow some properties from going into form's designer file but the those properties will present on the form(property grid). The behavior of these properties will be same always. I used the following code: <DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> Public Property GradientBegin() As Color = Color.Red But the problem I am facing is that - on the property grid after changing the "GradientBegin" color to other than RED and compiling the program, it is replacing the new changed value to RED again. So I am not able to change the color actually. How can I achieve this? Thanks for any reply in advance.

    Read the article

  • Simple, but I'm stuck ....Updating a DataSet using code

    - by user2518039
    I have a simple Windows form in VB: textbox bound thru an adapter and a bindingsource to my dataset. I have a button that on Click I want it to update the database. The form loads and the first data row shows in the textbox, I change the text then click my button but no update happens. Any ideas what I'm doing wrong, or how I should do this?? Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.AToolsTableAdapter.Fill(Me.Qedsandb_TroyDataSet.aTools) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click AToolsTableAdapter.Update(Qedsandb_TroyDataSet.aTools) End Sub End Class

    Read the article

  • Calling a method on a Object says "disallows late binding"

    - by Maury Markowitz
    I have a calls called DtaDate that stores an integer "key", a string name, a string for the date, and a Date object that is created from that string. I have some code that needs to accept a date-like object. I'd like the user to be able to pass in anything date like - a Date object which I'll extract the information from, another DtaDate, a string with the date in it, or even the key, which I'll use to look up the DtaDate from a collection. So I have this: Friend Sub New(NameIn As String, DateFormulaIn As String, Optional FromDateIn As Object = Nothing) [stuff that works] [check that we got a FromDateIn...] If TypeOf FromDateIn Is DtaDate Then fdk = FromDateIn.Key Ans.FromDate = fdk VB tells me that "Option Strict On disallows late binding". The other cases, where a string or integer is the TypeOf, I use CInt or CStr. But this is the first time I've actually run into a case where the casting is a non-base type. What's the trick?

    Read the article

  • How does one receive and post text messages on a website, a la Twitter?

    - by Jason
    I've looked around at pretty much all the SMS posts here on SO and the best answer I've come up with so far is ZeepMobile. The only problem is, they're "in beta" and aren't readily accepting users. Is there a workaround for this, maybe receiving an email via text (kind of like how TwitPic does it?) somehow and parsing it? Basically all I want to do is have people text the site so that their message posts... I don't need to send any messages (actually I would prefer not to). Pretty much the same functionality as Twitter (same functionality, but no I'm not building a Twitter-esque service because I am not crazy). PS this will be a VB.NET ASP.NET 3.5 solution. Anyone have any ideas? Thanks

    Read the article

  • Looking for an example of selecting a row(s) with multiple columns from a grid view and add them to

    Here is the situation dealing with a vb.net website, I have students who will be enrolled into a course. The student grid view has many columns like client_no, student_name, date_of_birth, address, etc. There are over 100000 students so I will need to filter the student grid view to find the correct student to enroll in the course. Once they are found, the user selects them and somehow moves them to the enrolled grid view. If a student drops out then they would be removed from the enrolled grid view. This process needs to be easy to understand and use. Are there any examples available or other suggestions on how to do this?

    Read the article

  • Looking for a better alternative to linklabels

    - by user986086
    Please see the two long linklabels below (please ignore the black lines above) Linklabels' length is made dynamically during runtime, and as seen, could be that it's too long and overlapping other text we have (there is another text where you see 'Differences'). My questions are: a) Can I limit the maximum length of a linklabel? b) Is that possible to use a scrollbar with a linklabel (or any similar control) in case that it's too long? e.g. setting it to 200 pixels, and in case it's longer, the user has to scroll the horizontal scroller and see end of the text. I'm using VB.NET on Visual Studio 2008 THANK YOU

    Read the article

  • unit testing methods with arrays as argument

    - by Ryan
    I am porting over some C++ assembly to VB that performs demodulation of various waveforms. I decided to go the unit test route instead of building a test app to get a feel for how testing is performed. The original demodulation code accepts an array that is the waveform along with some other arguments. How should one go about performing a test on something that has an array as an argument? Is it acceptable to generate fake data in a file and read it in at the beginning of the test? On a side note - The original C++ code was written because we were performing math that we couldn't do in VB6 so we had to cross boundaries between C++ and VB6 and arrays were used. Is there a "better" way of handling large amounts of data in the .NET world that us VB6 programmers may not yet be privy to? Or if we aren't crossing that managed/un-managed boundary, should we be representing our data as objects instead? Thanks all!

    Read the article

  • open program once with multiple files as arguments from explorer

    - by Jonathan
    I have a program that works when, a file is opened with it using the right click menu in explorer. But if I select multiple files and then right click and open with my program then it opens multiple instances of my program, instead of just passing the multiple files as arguments to a single instance. The program is written in vb.net but is not a windows form, it is just a module, so I can to tick the Single instance option in the properties in Visual Studio. So how do I open multiple files from explorer context menu in a single instance.

    Read the article

  • populating a gridview with a button's click event

    - by david padi
    hi I have a page that has two dropdownlists(one for the locations, and the other for departments), an employee search textbox and a button. On the other page, I have a gridview. Now, what i want to archieve is that when a user types an employee's name in the textbox control, selects a location from the location dropdownlist, and a department from the departments dropdownlist, and click the button(search), the gridview on the other page must show the reqiured information of a SINGLE employee. Only one row must show. I have created a database for the employees. I know how to do this with the autopostback but i have not tried it using a button's click. NB: the gridview should show only one row of a selected employee. I'm using ASP.NET VB Your help will high apprecaited.

    Read the article

  • Preserving NULL values in a Double Variable

    - by Sam
    Hi, I'm working on a vb.net application which imports from an Excel spreadsheet. If rdr.HasRows Then Do While rdr.Read() If rdr.GetValue(0).Equals(System.DBNull.Value) Then Return Nothing Else Return rdr.GetValue(0) End If Loop Else I was using string value to store the double values and when preparing the database statement I'd use this code: If (LastDayAverage = Nothing) Then command.Parameters.AddWithValue("@WF_LAST_DAY_TAG", System.DBNull.Value) Else command.Parameters.AddWithValue("@WF_LAST_DAY_TAG", Convert.ToDecimal(LastDayAverage)) End If I now have some data with quite a few decimal places and the data was put into the string variable in scientific notation, so this seems to be the wrong approach. It didn't seem right using the string variable to begin with. If I use a double or decimal type variable, the blank excel values come across as 0.0. How can I preserve the blank values? Thanks

    Read the article

  • All of a Sudden , Sql Server Timeout

    - by Adinochestva
    Hey Guys We got a legacy vb.net applicaction that was working for years But all of a sudden it stops working yesterday and gives sql server timeout Most part of application gives time out error , one part for example is below code : command2 = New SqlCommand("select * from Acc order by AccDate,AccNo,AccSeq", SBSConnection2) reader2 = command2.ExecuteReader() If reader2.HasRows() Then While reader2.Read() If IndiAccNo <> reader2("AccNo") Then CAccNo = CAccNo + 1 CAccSeq = 10001 IndiAccNo = reader2("AccNo") Else CAccSeq = CAccSeq + 1 End If command3 = New SqlCommand("update Acc Set AccNo=@NewAccNo,AccSeq=@NewAccSeq where AccNo=@AccNo and AccSeq=@AccSeq", SBSConnection3) command3.Parameters.Add("@AccNo", SqlDbType.Int).Value = reader2("AccNo") command3.Parameters.Add("@AccSeq", SqlDbType.Int).Value = reader2("AccSeq") command3.Parameters.Add("@NewAccNo", SqlDbType.Int).Value = CAccNo command3.Parameters.Add("@NewAccSeq", SqlDbType.Int).Value = CAccSeq command3.ExecuteNonQuery() End While End If It was working and now gives time out in command3.ExecuteNonQuery() Any ideas ?

    Read the article

  • Monitor multiple variable amounts of processes' start and exit

    - by ron975
    I need some code to monitor the start and exit of processes. For example, assume I have a config file with 3 processe names, lets say, foo.exe, bar.exe and abc.exe. How I imagine this be done would be to create 3 threads and somehow listen to each process individually with a timer in each thread, and then do something afterwards. However, I would need to dynamically create threads and timers, as the config file is meant to be modifiable. I can work with VB.NET or C# Code. Thanks.

    Read the article

  • Get length of a Dictionary

    - by StealthRT
    Hey all i am new at this Dictionary class in VB.net. I am wanting to reteive how many items in the Dictionary array there are: But doing this: Dim showNumber As Integer = tmpShows.Length Does not seem to yield 4 as it should? The code for the Dictionary i have is this: Dim all = New Dictionary(Of String, Object)() Dim info = New Dictionary(Of String, Object)() info!Station = .SelectSingleNode(".//span[@class='channel']").ChildNodes(3).ChildNodes(2).InnerText info!Shows = From tag In .SelectNodes(".//a[@class='thickbox']") Select New With {.Show = tag.Attributes("title").Value, .Link = tag.Attributes("href").Value} Dim tmpShows = all.Item(info!Station) Dim showNumber As Integer = tmpShows.Length What am i missing in order to get the 4 length i am looking for?

    Read the article

  • phpMySql connection

    - by Eiriko Pedroza
    PL = VB.net Issue: format of the initialization string does not conform to specification starting at index 17 connection string: objconn.ConnectionString = ("server=" & txtServer.Text & ";" _ & "user id=" & "'" & txtUserId.Text & ";" _ & "password=" & txtPassword.Text & ";" _ & "database=try") Try objconn.Open() MsgBox("Connected") objconn.Close() Catch ex As Exception MsgBox(ex.ToString) End Try -objconn is declared as new mysqlconnection every time I run the application and try to login, i keep on receiving this error message, I already double checked my line of connection string. im using 'localhost' as server and 'root' as username, password is blank. thank you in advance for your response

    Read the article

  • C# Deserializing to a dictionary<string, Object>

    - by lovecraft
    I'm writing a C#/VB application to connect to a database and do stuff with the data. I was given this code to take a serialized byte array and deserialized it, which is then written to a Dictionary The line of code is: Dictionary<string, Object> DictionaryEmployee = (Dictionary<string, Object> Deserializer(byteArrayEmp)); The errors I'm getting are exceedingly unhelpful. "Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement" if I mouse over Object and "Using the generic type 'System.Collections.Generic.Dictionary' requires 2 type arguments if I mouse over Dictionary.

    Read the article

  • Why is ValidateInput(False) not working?

    - by xenosyde
    I am converting an application I created using webforms to the asp.net mvc framework using vb.net. I have a problem with one of my views. I get the yellow screen of death saying "A potentially dangerous Request.Form value was detected from the client" when I submit my form. I am using tinymce as my RTE. I have set on the view itself ValidateRequest="false" I know that in MVC it doesn't respect it on the view from what I've read so far. So I put it on the controller action as well. I have tried different setups: <ValidateInput(False), AcceptVerbs(HttpVerbs.Post)> _ ...and... <AcceptVerbs(HttpVerbs.Post), ValidateInput(False)> _ ...and like this as well... <ValidateInput(False)> _ <AcceptVerbs(HttpVerbs.Post)> _ Just to see if it made a difference, yet I still get the yellow screen of death. I only want to set it for this view and the specific action in my controller that my post pertains to. Am I missing something?

    Read the article

  • Problems with MembershipUser / System.Web.ApplicationServices when upgrading to .net 4

    - by DaveK
    I have a large vb.net web project that I am trying to updgrade to .net4/VS2010. During compile I get the following error: 'System.Web.Security.MembershipUser' in assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has been forwarded to assembly 'System.Web.ApplicationServices'. Either a reference to 'System.Web.ApplicationServices' is missing from your project or the type 'System.Web.Security.MembershipUser' is missing from assembly 'System.Web.ApplicationServices'. I researched the issue and the error is accurate. I added a reference to System.Web.ApplicationServices but I am still having problems. The project does not seem to recognize that the reference has been added. Intellisense will not pick it up, I can not use it in an Import statement, etc ... The assembly is listed in the compile section of my web.config: <assemblies> ... <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> Any ideas?

    Read the article

  • "Microsoft.ACE.OLEDB.12.0 provider is not registered" [RESOLVED]

    - by Azim
    I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb. In the database project I have a function which retrieves a data table as follows private class AdminDatabase ' stores the connection string which is set in the New() method dim strAdminConnection as string public sub New() ... adminName = dlgopen.FileName conAdminDB = New OleDbConnection conAdminDB.ConnectionString = "Data Source='" + adminName + "';" + _ "Provider=Microsoft.ACE.OLEDB.12.0" ' store the connection string in strAdminConnection strAdminConnection = conAdminDB.ConnectionString.ToString() My.Settings.SetUserOverride("AdminConnectionString", strAdminConnection) ... End Sub ' retrieves data from the database Public Function getDataTable(ByVal sqlStatement As String) As DataTable Dim ds As New DataSet Dim dt As New DataTable Dim da As New OleDbDataAdapter Dim localCon As New OleDbConnection localCon.ConnectionString = strAdminConnection Using localCon Dim command As OleDbCommand = localCon.CreateCommand() command.CommandText = sqlStatement localCon.Open() da.SelectCommand = command da.Fill(dt) getDataTable = dt End Using End Function End Class When I call this function from my Word 2007 Template project everything works fine; no errors. But when I run it from the console application it throws the following exception ex = {"The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."} Both projects have the same reference and the console application did work when I first wrote it (a while ago) but now it has stopped work. I must be missing something but I don't know what. Any ideas?

    Read the article

  • Getting Error System.Runtime.InteropServices.COMException

    - by Savan Parmar
    Hey All, I am using Vb.Net to Create Labels in Microsoft. For that i am using below mantioend Code. Public Sub CreateLabel(ByVal StrFilter As String, ByVal Path As String) WordApp = CreateObject("Word.Application") ''Add a new document. WordDoc = WordApp.Documents.Add() Dim oConn As SqlConnection = New SqlConnection(connSTR) oConn.Open() Dim oCmd As SqlCommand Dim oDR As SqlDataReader oCmd = New SqlCommand(StrFilter, oConn) oDR = oCmd.ExecuteReader Dim intI As Integer Dim FilePath As String = "" With WordDoc.MailMerge With .Fields Do While oDR.Read For intI = 0 To oDR.FieldCount - 1 .Add(WordApp.Selection.Range, oDR.Item(intI)) Next Loop End With Dim objAutoText As Word.AutoTextEntry = WordApp.NormalTemplate.AutoTextEntries.Add("MyLabelLayout", WordDoc.Content) WordDoc.Content.Delete() .MainDocumentType = Word.WdMailMergeMainDocType.wdMailingLabels FilePath = CreateSource(StrFilter) .OpenDataSource(FilePath) Dim NewLabel As Word.CustomLabel = WordApp.MailingLabel.CustomLabels.Add("MyLabel", False) WordApp.MailingLabel.CreateNewDocument(Name:="MyLabel", Address:="", AutoText:="MyLabelLayout") objAutoText.Delete() .Destination = Word.WdMailMergeDestination.wdSendToNewDocument WordApp.Visible = True .Execute() End With oConn.Close() WordDoc.Close() End Sub Private Function CreateSource(ByVal StrFilter As String) As String Dim CnnUser As SqlConnection = New SqlConnection(connSTR) Dim sw As StreamWriter = File.CreateText("C:\Mail.Txt") Dim Path As String = "C:\Mail.Txt" Dim StrHeader As String = "" Try Dim SelectCMD As SqlCommand = New SqlCommand(StrFilter, CnnUser) Dim oDR As SqlDataReader Dim IntI As Integer SelectCMD.CommandType = CommandType.Text CnnUser.Open() oDR = SelectCMD.ExecuteReader For IntI = 0 To oDR.FieldCount - 1 StrHeader &= oDR.GetName(IntI) & " ," Next StrHeader = Mid(StrHeader, 1, Len(StrHeader) - 2) sw.WriteLine(StrHeader) sw.Flush() sw.Close() StrHeader = "" Do While oDR.Read For IntJ As Integer = 0 To oDR.FieldCount - 1 StrHeader &= oDR.GetString(IntJ) & " ," Next Loop StrHeader = Mid(StrHeader, 1, Len(StrHeader) - 2) sw = File.AppendText(Path) sw.WriteLine(StrHeader) CnnUser.Close() sw.Flush() sw.Close() Catch ex As Exception MessageBox.Show(ex.Message, "TempID", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try Return Path End Function Now when i am running the programm i am getting this error.I tried hard but not able to locate what could be the problem the error is:- System.Runtime.InteropServices.COMException --Horizontal and vertical pitch must be greater than or equal to the label width and height, respectively. Even though i tried to set the Horizontal and vertical pitch programatically but it gives same err. Plz if any one can help

    Read the article

  • Understanding ItemsSource and DataContext in a DataGrid

    - by Ben McCormack
    I'm trying to understand how the ItemsSource and DataContext properties work in a Silverlight Toolkit DataGrid. I'm currently working with dummy data and trying to get the data in the DataGrid to update when the value of a combo box changes. My MainPage.xaml.vb file currently looks like this: Partial Public Class MainPage Inherits UserControl Private IssueSummaryList As List(Of IssueSummary) Public Sub New() GetDummyIssueSummary("Day") InitializeComponent() dgIssueSummary.ItemsSource = IssueSummaryList 'dgIssueSummary.DataContext = IssueSummaryList ' End Sub Private Sub GetDummyIssueSummary(ByVal timeInterval As String) Dim lst As New List(Of IssueSummary)() 'Generate dummy data for lst ' IssueSummaryList = lst End Sub Private Sub ComboBox_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Dim cboBox As ComboBox = CType(sender, ComboBox) Dim cboBoxItem As ComboBoxItem = CType(cboBox.SelectedValue, ComboBoxItem) GetDummyIssueSummary(cboBoxItem.Content.ToString()) End Sub End Class My XAML currently looks this for the DataGrid: <sdk:DataGrid x:Name="dgIssueSummary" AutoGenerateColumns="False" > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding ProblemType}" Header="Problem Type"/> <sdk:DataGridTextColumn Binding="{Binding Count}" Header="Count"/> </sdk:DataGrid.Columns> </sdk:DataGrid> The problem is that if I set the value of the ItemsSource property of the data grid equal to IssueSummaryList, it will display the data when it loads, but it won't update when the underlying IssueSummaryList collection changes. If I set the DataContext of the grid to be IssueSummaryList, no data will be displayed when it renders. I must not understand how ItemsSource and DataContext are supposed to function, because I expect one of those properties to "just work" when I assign a List object to them. What do I need to understand and change in my code so that as data changes in the List, the data in the grid is updated?

    Read the article

  • ASP.NET Setting Culture with InitializeCulture

    - by Helen
    I have a website with three domains .com, .de and .it Each domain needs to default to the local language/culture of the country. I have created a base page and added an InitializeCulture Protected Overrides Sub InitializeCulture() Dim url As System.Uri = Request.Url Dim hostname As String = url.Host.ToString() Dim SelectedLanguage As String If HttpContext.Current.Profile("PreferredCulture").ToString Is Nothing Then Select Case hostname Case "www.domain.de" SelectedLanguage = "de" Thread.CurrentThread.CurrentUICulture = New CultureInfo(SelectedLanguage) Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(SelectedLanguage) Case "www.domain.it" SelectedLanguage = "it" Thread.CurrentThread.CurrentUICulture = New CultureInfo(SelectedLanguage) Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(SelectedLanguage) Case Else SelectedLanguage = "en" Thread.CurrentThread.CurrentUICulture = New CultureInfo(SelectedLanguage) Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(SelectedLanguage) End Select End If End Sub This is fine. The problem now occurs because we also want three language selection buttons on the home page so that the user can override the domain language. So on my Default.asp.vb we have three button events like this... Protected Sub langEnglish_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles langEnglish.Click Dim SelectedLanguage As String = "en" 'Save selected user language in profile HttpContext.Current.Profile.SetPropertyValue("PreferredCulture", SelectedLanguage) 'Force re-initialization of the page to fire InitializeCulture() Context.Server.Transfer(Context.Request.Path) End Sub But of course the InititalizeCulture then overrides whatever button selection has been made. Is there any way that the InitialCulture can check whether a button click has occurred and if so skip the routine? Any advice would be greatly appreciated, thanks.

    Read the article

  • DataGridView not displaying data in ToolStripDropDown

    - by jblaske
    I'm utilizing the code posted by Jesper Palm here: http://stackoverflow.com/questions/280891/make-user-control-display-outside-of-form-boundry /// <summary> /// A simple popup window that can host any System.Windows.Forms.Control /// </summary> public class PopupWindow : System.Windows.Forms.ToolStripDropDown { private System.Windows.Forms.Control _content; private System.Windows.Forms.ToolStripControlHost _host; public PopupWindow(System.Windows.Forms.Control content) { //Basic setup... this.AutoSize = false; this.DoubleBuffered = true; this.ResizeRedraw = true; this._content = content; this._host = new System.Windows.Forms.ToolStripControlHost(content); //Positioning and Sizing this.MinimumSize = content.MinimumSize; this.MaximumSize = content.Size; this.Size = content.Size; content.Location = Point.Empty; //Add the host to the list this.Items.Add(this._host); } } I've translated it to VB: Public Class PopupWindow Inherits System.Windows.Forms.ToolStripDropDown Private _content As System.Windows.Forms.Control Private _host As System.Windows.Forms.ToolStripControlHost Public Sub New(ByVal content As System.Windows.Forms.Control) Me.AutoSize = False Me.DoubleBuffered = True Me.ResizeRedraw = True Me._content = content Me._host = New System.Windows.Forms.ToolStripControlHost(content) Me.MinimumSize = content.MinimumSize Me.MaximumSize = content.MaximumSize Me.Size = content.Size content.Location = Point.Empty Me.Items.Add(Me._host) End Sub End Class It works great with a PictureBox showing its information. But for some reason I cannot get the DataGridView to display anything when it is in the popup. If I pull the grid out of the popup it displays all of its information fine. If I pause during debug, the grid shows that it has all the data in it. It's just not displaying anything. Does anybody have any ideas?

    Read the article

  • More efficient way to find media item in WMP media library?

    - by RoseOfJericho
    Hello, all. I am messing around with the WMPLib component provided by Windows Media Player 12 (wmp.dll) in VB.NET with .NET Framework 3.5 SP1. I am trying to retrieve a media item from my media library based on its name (assuming there are no duplicate names). At the moment, I'm grabbing the entire media library, and looping through every media item, and quitting the loop when I've found the correct media item. This works well (except for when a media item with that name cannot be found), but I was hoping there was a more efficient way of doing this. Here is my code so far: Public Class WMPTest Private myWMP As WMPLib.IWMPCore Private myMediaCollection As WMPLib.IWMPMediaCollection Private myTrack As WMPLib.IWMPMedia Private allTracks As WMPLib.IWMPPlaylist Public Sub New() ' This call is required by the Windows Form Designer. InitializeComponent() ' Add any initialization after the InitializeComponent() call. myWMP = New WMPLib.WindowsMediaPlayer myMediaCollection = myWMP.mediaCollection allTracks = myMediaCollection.getAll Dim theTrack As WMPLib.IWMPMedia = findTrack("Yellow Submarine") MessageBox.Show(theTrack.name) End Sub Public Function findTrack(ByVal strTrackName As String) As WMPLib.IWMPMedia For i As Integer = 0 To (allTracks.count - 1) If allTracks.Item(i).name = strTrackName Then myTrack = allTracks.Item(i) Exit For End If Next 'myTrack is now the track that we wanted to retrieve Return myTrack End Function End Class So what I really want is a way to optimize findTrack() to do its thing without looping through the entire media library (which could be huge). Anyone have a clue?

    Read the article

  • How do I keep Visual Studio's Windows Forms Designer from deleting controls?

    - by Sören Kuklau
    With several forms of mine, I occasionally run into the following issue: I edit the form using the designer (Visual Studio 2008, Windows Forms, .NET 2.0, VB.NET) to add components, only to find out later that some minor adjustments were made (e.g. the form's size is suddenly changed by a few pixels), and controls get deleted. This happens silently — event-handling methods automatically have their Handles suffix removed, too, so they never get called, and there's no compiler error. I only notice much later or not at all, because I'm working on a different area in the form. As an example, I have a form with a SplitContainer containing an Infragistics UltraListView to the left, and an UltraTabControl to the right. I added a new tab, and controls within, and they worked fine. I later on found out that the list view's scrollbar was suddenly invisible, due to its size being off, and at least one control was removed from a different tab that I hadn't been working on. Is this a known issue with the WinForms Designer, or with Infragistics? I use version control, of course, so I can compare the changes and merge the deleted code back in, but it's a tedious process that shouldn't be necessary. Are there ways to avoid this? Is there a good reason for this to occur? One clue is that the control that was removed may have code (such as a Load event handler) that expects to be run in run time, not design time, and may be throwing an exception. Could this cause Visual Studio to remove the control?

    Read the article

  • Make a Crystal Report with data fetched from two differents tables

    - by Selom
    Hi, Im using vb.net and I need to fetch data from two different tables and display it in form of report. These are the schemas and data of my two tables: CREATE TABLE personal_details (staff_ID integer PRIMARY KEY, title varchar(10), fn varchar(250), ln varchar(250), mn varchar(250), dob varchar(50), hometown varchar(250), securityno varchar(50), phone varchar(15), phone2 varchar(15), phone3 varchar(15), email varchar(250), address varchar(300), confirmation varchar(50), retirement varchar(50), designation varchar(250), region varchar(250)); INSERT INTO personal_details VALUES(1,'Mr.','Selom','AMOUZOU','Kokou','Sunday, March 28, 2010','Ho',7736,'024-747-4883','277-383-8383','027-838-3837','[email protected]','Lapaz Kum Hotel','Sunday, March 28, 2010','Sunday, March 28, 2010','Designeur','Brong Ahafo'); CREATE TABLE training( training_ID integer primary key NOT NULL, staff_ID varchar(100), training_level varchar (60), school_name varchar(100), start_date varchar(100), end_date varchar(100)); INSERT INTO training VALUES(1,1,'Primary School','New School','Feb 1955','May 1973'); INSERT INTO training VALUES(2,1,'Middle/JSS','Ipmc','Feb 1955','May 1973'); Im trying to fetch and display data from the tables above the following way: Dim rpt As New CrystalReport1() Dim da As New SQLiteDataAdapter Dim ds As New presbydbDataSet ds.EnforceConstraints = False If conn.State = ConnectionState.Closed Then conn.Open() End If Dim cmd As New SQLiteCommand("SELECT p.fn, t.training_level FROM personal_details p INNER JOIN training t ON p.staff_ID = t.staff_ID", conn) cmd.ExecuteNonQuery() da.SelectCommand = cmd da.Fill(ds) rpt.SetDataSource(ds) CrystalReportViewer1.ReportSource = rpt conn.Close() My problem is that nothing displays on the report unless I take off either the training fields or the personal_details fields from the report. Need your help. Thanks

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >