Search Results

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

Page 100/179 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Why would an error get thrown inside my try-catch?

    - by George Johnston
    Why would my try-catch block still be throwing an error when it's handled? Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Try Here >> : _MemoryStream.Seek(6 * StartOffset, 0) _MemoryStream.Read(_Buffer, 0, 6) Catch ex As IOException // Handle Error End Try Edit: Cleaned the question up to remove the extraneous information.

    Read the article

  • Versioning issues with assemblies

    - by devoured elysium
    Let's assume I have two assemblies: MyExecutable.dll version 1.0.0 MyClassLibrary.dll version 1.0.0 Now, MyExecutable.dll currently uses MyClassLibrary.dll's classes and methods (which include some algorithms). Most of those algorithms were made on the run, being that later I'll want to refine them if needed. This means, I won't change the interface of those classes but the code itself will see some changes. The question at hand is, MyExecutable.dll will be expecting MyClassLibrary.dll 1.0.0 and I'll want it to use version 1.0.1 (or something like that). I don't want to have to recompile MyExecutable.dll(because actually there might be more than just one executable using MyClassLibrary.dll). Is there a solution for this problem? I've heard about the GAC, but if possible I'd like to stay away from it. Thanks

    Read the article

  • LINQ + Find count of non-null values

    - by Ashutosh
    I have a table with the below structure. ID VALUE 1 3.2 2 NULL 4 NULL 5 NULL 7 NULL 10 1.8 11 NULL 12 3.2 15 4.7 17 NULL 22 NULL 24 NULL 25 NULL 27 NULL 28 7 I would like to get the max count of consecutive null values in the table. Any help would be greatly appreciated. THanks Ashutosh

    Read the article

  • Getting data from a ListView into an array

    - by Joe
    I have a ListView control on my form set up like this in details mode: What I would like to do, is get all the values of the data cells when the user presses the Delete booking button. So using the above example, my array would be filled with this data: values(0) = "asd" values(1) = "BS1" values(2) = "asd" values(3) = "21/04/2010" values(4) = "2" This is my code so far: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim items As ListView.SelectedListViewItemCollection = _ Me.ManageList.SelectedItems Dim item As ListViewItem Dim values(0 To 4) As String Dim i As Integer = 0 For Each item In items values(i) = item.SubItems(i).Text i = i + 1 Next End Sub But only values(0) gets filled with the first data cell of the selection (in this case "asd") and the rest of the array entries are blank. I have confirmed this with a breakpoint and checked the array entries myself. I'm REALLY lost on this, and have been trying for about an hour now. Any help would be appreciated, thanks :) Also please note that there can only be one row selection at once. Thanks.

    Read the article

  • How to populate a listview in ASP.NET 3.5 through a dataset?

    - by EasyDot
    Is it possible to populate a listview with a dataset? I have a function that returns a dataset. Why im asking this is because my SQL is quite complicated and i can't convert it to a SQLDataSource... Public Function getMessages() As DataSet Dim dSet As DataSet = New DataSet Dim da As SqlDataAdapter Dim cmd As SqlCommand Dim SQL As StringBuilder Dim connStr As StringBuilder = New StringBuilder("") connStr.AppendFormat("server={0};", ConfigurationSettings.AppSettings("USERserver").ToString()) connStr.AppendFormat("database={0};", ConfigurationSettings.AppSettings("USERdb").ToString()) connStr.AppendFormat("uid={0};", ConfigurationSettings.AppSettings("USERuid").ToString()) connStr.AppendFormat("pwd={0};", ConfigurationSettings.AppSettings("USERpwd").ToString()) Dim conn As SqlConnection = New SqlConnection(connStr.ToString()) Try SQL = New StringBuilder cmd = New SqlCommand SQL.Append("SELECT m.MESSAGE_ID, m.SYSTEM_ID, m.DATE_CREATED, m.EXPIRE_DATE, ISNULL(s.SYSTEM_DESC,'ALL SYSTEMS') AS SYSTEM_DESC, m.MESSAGE ") SQL.Append("FROM MESSAGE m ") SQL.Append("LEFT OUTER JOIN [SYSTEM] s ") SQL.Append("ON m.SYSTEM_ID = s.SYSTEM_ID ") SQL.AppendFormat("WHERE m.SYSTEM_ID IN ({0}) ", sSystems) SQL.Append("OR m.SYSTEM_ID is NULL ") SQL.Append("ORDER BY m.DATE_CREATED DESC; ") SQL.Append("SELECT mm.MESSAGE_ID, mm.MODEL_ID, m.MODEL_DESC ") SQL.Append("FROM MESSAGE_MODEL mm ") SQL.Append("JOIN MODEL m ") SQL.Append(" ON m.MODEL_ID = mm.MODEL_ID ") cmd.CommandText = SQL.ToString cmd.Connection = conn da = New SqlDataAdapter(cmd) da.Fill(dSet) dSet.Tables(0).TableName = "BASE" dSet.Tables(1).TableName = "MODEL" Return dSet Catch ev As Exception cLog.EventLog.logError(ev, cmd) Finally 'conn.Close() End Try End Function

    Read the article

  • How to turn off Video Acceleration programatically.

    - by Stefan
    Im using the Windows Media Player OCX in a program runned on hundreds of computers (dedicated). I have found out that when video acceleration is turned on to "full", on some computers it will cause the video to fail to play correct, with green squares between movies and so on. Turn the acceleration to "None" and everything is fine. This program is runned on ~800 computers that will autoupdate my program. So I want to add to the startup to my program that it turns off the video acceleration. The question is, how do I turn off video Acceleration Programatically? All computers are running XP and at least the second service pack. It would take me ages to manually logg in to all those computers and change that setting so thats why I want the program to be able to do it automagically for me.

    Read the article

  • SQLite Transaction fills a table BEFORE the transaction is commited

    - by user1500403
    Halo I have a code that creates a datatable (in memory) from a select SQL statement. However I realised that this datatable is filling during the procedure rather as a result of the transaction comit statment, it does the job but its slow. WHat amI doing wrong ? Inalready.Clear() 'clears a dictionary Using connection As New SQLite.SQLiteConnection(conectionString) connection.Open() Dim sqliteTran As SQLite.SQLiteTransaction = connection.BeginTransaction() Try oMainQueryR = "SELECT * FROM detailstable Where name= :name AND Breed= :Breed" Dim cmdSQLite As SQLite.SQLiteCommand = connection.CreateCommand() Dim oAdapter As New SQLite.SQLiteDataAdapter(cmdSQLite) With cmdSQLite .CommandType = CommandType.Text .CommandText = oMainQueryR .Parameters.Add(":name", SqlDbType.VarChar) .Parameters.Add(":Breed", SqlDbType.VarChar) End With Dim c As Long = 0 For Each row As DataRow In list.Rows 'this is the list with 500 names If Inalready.ContainsKey(row.Item("name")) Then Else c = c + 1 Form1.TextBox1.Text = " Fill .... " & c Application.DoEvents() Inalready.Add(row.Item("name"), row.Item("Breed")) cmdSQLite.Parameters(":name").Value = row.Item("name") cmdSQLite.Parameters(":Breed").Value = row.Item("Breed") oAdapter.Fill(newdetailstable) End If Next oAdapter.FillSchema(newdetailstable, SchemaType.Source) Dim z = newdetailstable.Rows.Count 'At this point the newdetailstable is already filled up and I havent even comited the transaction ' sqliteTran.Commit() Catch ex As Exception End Try End Using

    Read the article

  • convert Arabic numerical to English

    - by hamitay
    i am looking for a way to convert the Arabic numerical string "??????????" to an English numerical string "0123456789" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dim Anum as string ="??????????" dim Enum as string =get_egnlishNum(Anum) End Sub private function get_egnlishNum(byval _Anum as string) as string '' converting code end function

    Read the article

  • Is there a Better Way to Retreive Raw XML from a URL than WebClient or HttpWebRequest? [.NET]

    - by DaMartyr
    I am working on a Geocoding app where I put the address in the URL and retreive the XML. I need the complete XML response for this project. Is there any other class for downloading the XML from a website that may be faster than using WebClient or HttpWebRequest? Can the XMLReader be used to get the full XML without string manipulation and would that be faster and/or more efficient?

    Read the article

  • How to seralize only some properties in .Net?

    - by Beta033
    This is for a web project so i have several classes that inherit from Web.UI. I only want to serialize very particular properties (basically, only local properties) I'm aware of the XMLIgnore property that can be placed on a property to ignore items, but this won't work in my context since that would require modifying a bunch of stuff that i really don't want to modify (and probably can't). So how do i tell the xml serializer to ignore everything except for X and Y or tell it to seralize just X and Y? i could just create my own xml in a string builder or something and if that's the only way, so be it. however i'm looking for a method that will employ the built in XML stuff. Thanks

    Read the article

  • Generic Lists copying references rather than creating a copiedList

    - by Dean
    I was developing a small function when trying to run an enumerator across a list and then carry out some action. (Below is an idea of what I was trying to do. When trying to remove I got a "Collection cannot be modified" which after I had actually woken up I realised that tempList must have just been assigned myLists reference rather than a copy of myLists. After that I tried to find a way to say tempList = myList.copy However nothing seems to exist?? I ended up writing a small for loop that then just added each item from myLsit into tempList but I would have thought there would have been another mechanism (like clone??) So my question(s): is my assumption about tempList receiving a reference to myList correct How should a list be copied to another list? private myList as List (Of something) sub new() myList.add(new Something) end sub sub myCalledFunction() dim tempList as new List (Of Something) tempList = myList Using i as IEnumerator = myList.getEnumarator while i.moveNext 'if some critria is met then tempList.remove(i.current) end end using end sub

    Read the article

  • Need Language/Career Path Advice

    - by Cain
    I am interested in getting a few Microsoft Certs and I am currently facing the option for .NET Framework app development language. My choices are C++, C#, and Visual Basic. I have some experience with Java and Visual Basic .NET but I honestly would like to know what the best would be for developing stand-alone applications in a workstation (local) environment. This is for my career and honestly, 90% of the developers are all experienced in the above three languages and I wanted to improve my chances of staying employed by learning/certifying myself on my own time.

    Read the article

  • VS2010 is removing code from designer without warning - causing issues

    - by schmoopy
    I have a WinForm with a pretty complex layout (has lots of controls, panels, etc.) Whenever i open the form the file is automatically checked out from source control and it removes anything in the designer file that refereces my menustrip or statusstrip ie: the following get removed (w/o warning) Me.MyMenuStip.SuspendLayout() Me.MyStatusStrip.SuspendLayout() Me.MyMenuStrip.ResumeLayout(False) Me.MyMenuStrip.PerformLayout() Me.MyStatusStrip.ResumeLayout(False) Me.MyStatusStrip.PerformLayout() The code still builds, but there are no Menu or Status items rendered. Any ideas on what i can do? I do not want to just remove/add the menustrip for instance cause i would loose all of my menu items (and there are a lot) Thanks in advance!

    Read the article

  • Can I get the item type from a BindingSource?

    - by Preston
    I would like to get the Type of item that a BindingSource is hooked up to or configured for. The BindingSource.DataSource property can be set to an object, list, or type. If it is a Type, it obviously does not have an bound item yet, but I would still like to get the Type. For a List, I need the item Type, not the list type. There is a method BindingSource.GetItemProperties, that accomplishes most of what I need. It gets the PropertyDescriptors for the Type, list item, or object specified by the DataSource and DataMember. The reason I ask, is that I have some components that I would like to re-use, but they are currently setup to work off of an item Type. The Type is mainly used to get PropertyInfos and then build a UI, but PropertyInfo and PropertyDescriptor is not exactly the same, so it is not immediately apparent that they can be reworked to use a PropertyDescriptor collection instead. Then there is cascading refactoring of everything already using these components and that adds up to a lot of work that I would rather not do. I've looked through the API docs for for a good way to do this, but so far I have not had any luck. Am I missing something or is this just something I can not or should not be doing?

    Read the article

  • Read assembly Guid

    - by ggonsalv
    Is it possible to read the GUID from the Assembly without actually loading it in the current App Domain. Normally Assembly.Load loads the DLL into the app domain. I just want to read the value. The description of the GUID is 'The following GUID is for the ID of the typelib ' if this project is exposed to COM <Assembly: Guid("DEDDE61CD-928E-4ACD-8C25-3B8577284819")>

    Read the article

  • How to run an "empty" Windows Application that only has a NotifyIcon?

    - by devoured elysium
    I want to make an Application that only has a NotifyIcon. It doesn't need to have at all a "Main" Form. When I want to achieve something like this, I just create an invisible form and run it, but would there be a more "elegant" way of doing this, I'd like to know it. How do you generally do this? This application can't be a Windows Service, as having the NotifyIcon and its Context Menus is important (each one of them will run a different command). Thanks

    Read the article

  • Regex problem ...

    - by carlos
    hello i have the next regex Dim origen As String = " /c /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt"" /cid:45 423 /z:65 /a:23 /m:39 /t:45rt " Dim str As String = "(^|\s)/p:""\w:(\\(\w+[\s]*\w+)+)+\\\w+.\w+""(\s|$)" Dim ar As Integer Dim getfile As New Regex(str) Dim mgetfile As MatchCollection = getfile.Matches(origen) ar = mgetfile.Count When i evaluate this it works, and gets the /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt"" that basically is the path to a file. But if I change the origen string to Dim origen As String = " /c /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt""/cid:45 423 /z:65 /a:23 /m:39 /t:45rt " Check that the end of the file is follow by "/cid:45" whitchs makes de patter invalid, but insted of getting a mgetfile.count = 0 the program is block, if i make a debug I got a property evaluation failed. Thanks for your comments !!!

    Read the article

  • Use LINQ to count the number of combinations existing in two lists

    - by Ben McCormack
    I'm trying to create a LINQ query (or queries) that count the total number of occurences of a combinations of items in one list that exist in a different list. For example, take the following lists: CartItems DiscountItems ========= ============= AAA AAA AAA BBB AAA BBB BBB CCC CCC DDD The result of the query operation should be 2 since I can find two combinations of AAA and BBB (from DiscountItems) within the contents of CartItems. My thinking in approaching the query is to join the lists together to shorten CartItems to only include items from DiscountItems. The solution would be to find the CartItem in the resulting query that occurs the least amount of times, thus indicating how many combinations of items exist in CartItems. How can this be done? Here's the query I already have, but it's not working. query results in an enumeration with 100 items, far more than I expected. Dim query = From cartItem In Cart.CartItems Group Join discountItem In DiscountGroup.DiscountItems On cartItem.SKU Equals discountItem.SKU Into Group Select SKU = cartItem.SKU, CartItems = Group Return query.Min(Function(x) x.CartItems.Sum(Function(y) y.Quantity))

    Read the article

  • Datetime problem in VB 2005

    - by haythamhamdy
    I am using VB2005 and SQL SERVER 2000. PVAR_SQL_STR = "INSERT INTO GLR_US_PERIOD (ORG5_CODE,PERIOD_YEAR,PERIOD_CODE,PERIOD_NO,FROM_DATE,TO_DATE,INSERT_USER,INSERT_DATE) VALUES " _ & "('" & PVAR_COMPANY_CODE & "' ,'" & TextBox1.Text & "','" & Serial1.Text & "'," & TextBox2.Text & ", '" + DateTimePicker1.Value.ToString("D") + "' ,'" + DateTimePicker2.Value.ToString("D") + "','" & PVAR_USER_CODE & "','" + Now.ToString("F") + "')" Syntax error converting datetime from character string because of this part only: Now.ToString("F") Why, I do not know but when I change into Now.ToString("D") it works well but it saves the date only. I want to insert date and time.

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >