Search Results

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

Page 107/179 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • VB Script Creating variable on the fly returned Error Automation type not supported

    - by chazzuka
    I have list of variables in an include files which is looks like: var_1 = "string" var_2 = "string" on the main file i need variable created on the fly so i do ' somewhere i have the num variable Execute("new_var = var_"&num) Exactly on the execute line i got this error Microsoft VBScript runtime error '800a01ca' Variable uses an Automation type not supported in VBScript Any idea guys? thanks

    Read the article

  • Sorting a List based on an ArrayList within a custom Object

    - by Matt Weldon
    I am using a list to keep track of a number of custom Row objects as follows: Public Rows As List(Of Row)() Row has 2 properties, Key (a String) and Cells (an ArrayList). I need to be able to sort each Row within Rows based on a developer defined index of the Cells ArrayList. So for example based on the following Rows Row1.Cells = ("b", "12") Row2.Cells = ("a", "23") Rows.Sort(0) would result in Row2 being first in the Rows list. What would be the best way of going about implementing this? Thanks

    Read the article

  • linq to xml enumerating over descendants

    - by gh9
    Hi trying to write a simple linq query from a tutorial I read. But i cannot seem to get it to work. I am trying to display both the address in the attached xml document, but can only display the first one. Can someone help me figure out why both aren't being printed. Thank you very much <?xml version="1.0" encoding="utf-8" ?> <Emails> <Email group="FooBar"> <Subject>Test subject</Subject> <Content>Test Content</Content> <EmailTo> <Address>[email protected]</Address> <Address>[email protected]</Address> </EmailTo> </Email> </Emails> Dim steve = (From email In emailList.Descendants("Email") _ Where (email.Attribute("group").Value.Equals("FooBar")) _ Select content = email.Element("EmailTo").Descendants("Address")).ToList() If Not steve Is Nothing Then For Each addr In steve Console.WriteLine(addr.Value) Next Console.ReadLine() End If

    Read the article

  • ASP.net MVC Using view models in different views

    - by Azhar Rana
    i have 2 customer views one for create and one for edit. i am using the same Customer view model for both. i want to make the 'customer no field' required on the add but not the edit. if i put the requiredfield attribute on the view model property then both views flag 'Customer No' as required (as you would expect). Is there a built in solution to get around this problem or am i going to have to create 2 seperate view models, one with the attribute and one without. Thanks

    Read the article

  • In Entity framework, we can use Model first, DB first, Code first but how can we create table programmatically

    - by AukI
    In entity framework we can use 3 approaches model first , code first , database first but each one of them needs manual hand touch(means creating database or create model or write the POCO class codes or entity class codes) before proceeding to the next step ( using EF in context ). What if I want to create database and tables and table relationships programatically and still want to have to features of EntityFramework 4.3. To be more specific , from this example http://support.microsoft.com/kb/307283 we can create database , tables and everything using SQL command but we can't have the advantages of entity framework. So if we want to have that what should we do?

    Read the article

  • Visually Viewing and Editing a Two-Dimensional Array - VB/C#

    - by Jeffrey Kern
    I've never personally used any of the Data controls within Visual Studio. I need to view and edit a two-dimensional byte array, 16x15 objects. Is there any control capable of editing this information? I've tried to access data with the DataViewGrid, but am not sure how to use it. It would be great to edit this information via rows and columns, like how you can in Excel. Thank you! Times like this I wish I could just use multiple text boxes and assign them each an index value. Oh VB6 how I miss you :P

    Read the article

  • VS 2010 Entity Repository Error

    - by Steve
    In my project I have it set up so that all the tables in the DB has the property "id" and then I have the entity objects inherit from the EntityBase class using a repository pattern. I then set the inheritance modifier for "id" property in the dbml file o/r designer to "overrides" Public MustInherit Class EntityBase MustOverride Property id() As Integer End Class Public MustInherit Class RepositoryBase(Of T As EntityBase) Protected _Db As New DataClasses1DataContext Public Function GetById(ByVal Id As Integer) As T Return (From a In _Db.GetTable(Of T)() Where a.id = Id).SingleOrDefault End Function End Class Partial Public Class Entity1 Inherits EntityBase End Class Public Class TestRepository Inherits RepositoryBase(Of Entity1) End Class the line Return (From a In _Db.GetTable(Of T)() Where a.id = Id).SingleOrDefault however produces the error "Class member EntityBase.id is unmapped" when i use VS 2010 using the 4.0 framework but I never received that error with the old one. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • how to control textbox type to double in visual basic?

    - by fema
    Hi, I'd like to make a textbox that accepts only numbers, but not integer, but rather double. I've read here about e.Handled = Not Char.IsDigit(e.KeyChar) and it works, but again, it can be used only for integer, since it declines decimal point. Another thing I've read here is If Not Double.TryParse(TextBox2.Text, value) Then .... and it would work fine, except that it allows only decimal comma instead of point. I don't know whether it's because of my location settings (Hungary, we use commas instead of points), but I don't have any other idea how to solve my problem, and the SQL server I send my data uses decimal point. Thanks in advance.

    Read the article

  • Getting ListView values into a string array?

    - by Andrew
    I have a ListView control set up in details mode, and on a button press I would like to retrieve all column values from that row in the ListView. 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(1).Text i = i + 1 Next End Sub But values just comes out as an empty array. Any ideas? I just want the values array to be filled with the data of that ListView row. Cheers.

    Read the article

  • VB.NET Cant find the index of an array

    - by steve
    This is the code for my array (which is working) Public numUsers As Integer Public fNameUsers As String = ("..\..\..\users.txt") Public UserRecords As Usersclass()'note... this line is in a module reader = New System.IO.StreamReader(fNameUsers) numUsers = 0 'Split the array up at each delimiter of "," and add new objects Do While reader.Peek <> -1 ReDim Preserve UserRecords(numUsers) oneline = reader.ReadLine fields = oneline.Split(",") UserRecords(numUsers) = New Usersclass UserRecords(numUsers).AccountNumber = fields(0) UserRecords(numUsers).CourseName = fields(1) UserRecords(numUsers).FirstName = fields(2) UserRecords(numUsers).LastName = fields(3) UserRecords(numUsers).DOB = fields(4) UserRecords(numUsers).Email = fields(5) UserRecords(numUsers).CourseProgress = (6) UserRecords(numUsers).AdminCheck = fields(7) numUsers = numUsers + 1 Loop reader.Close() My problem is that I don't know how to lookup the index of an array where the .accountNumber = a variable. For example the acccountNumber is 253, what is the code to find the index this relates to???? Thanks in advance

    Read the article

  • .NET platform independant sync framework

    - by Quandary
    Question: I need to synchronize a few ActionScript files from my computer to a network share (backup). I saw a quick fix would be using Microsoft Sync Framework for this, and write a windows service. My problem is I also use Linux, and before I start with MS vendor lockin, is there any sync framework/library/whatever I could use that works accross platform? Or does the MS sync framework work on Linux, too? It is my understanding that it is a wrapper around some com objects, thus it wouldn't work. All I need is synchronizing files. So never mind the database part, although it would be nice to have it, too.

    Read the article

  • Update Statement Updates 0 Rows via the C# Winform Application?

    - by peace
    First of all, please help me out! I can not take this anymore. I could not find where the error is located. Here is my problem: I'm trying to update a row via c# winform application. The update query generated from the application is formatted correctly. I tested it in the sql server environment, it worked well. When i run it from the application i get 0 rows updated. Here is the snippet that generates the update statement using reflection - don't try to figure it out. Carry on reading after the code portion: public void Update(int cusID) { SqlCommand objSqlCommand = new SqlCommand(); Customer cust = new Customer(); string SQL = null; try { if ((cusID != 0)) { foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { if (!(PropertyItem.Name.ToString() == cust.PKName)) { if (PropertyItem.Name.ToString() != "TableName") { if (SQL == null) { SQL = PropertyItem.Name.ToString() + " = @" + PropertyItem.Name.ToString(); } else { SQL = SQL + ", " + PropertyItem.Name.ToString() + " = @" + PropertyItem.Name.ToString(); } } else { break; } } } objSqlCommand.CommandText = "UPDATE " + this.TableName + " SET " + SQL + " WHERE " + cust.PKName + " = @cusID AND PhoneNumber = " + "'" + "@phNum" + "'"; foreach (PropertyInfo PropertyItem in this.GetType().GetProperties()) { if (!(PropertyItem.Name.ToString() == cust.PKName)) { if (PropertyItem.Name.ToString() != "TableName") { objSqlCommand.Parameters.AddWithValue("@" + PropertyItem.Name.ToString(), PropertyItem.GetValue(this, null)); } else { break; } } } objSqlCommand.Parameters.AddWithValue("@cusID", cusID); objSqlCommand.Parameters.AddWithValue("@phNum", this.PhoneNumber); DAL.ExecuteSQL(objSqlCommand); } else { //AppEventLog.AddWarning("Primary Key is not provided for Update.") } } catch (Exception ex) { //AppEventLog.AddError(ex.Message.ToString) } } This part below: objSqlCommand.CommandText = "UPDATE " + this.TableName + " SET " + SQL + " WHERE " + cust.PKName + " = @cusID AND PhoneNumber = " + "'" + "@phNum" + "'"; generates dml: UPDATE CustomerPhone SET PhoneTypeID = @PhoneTypeID, PhoneNumber = @PhoneNumber WHERE CustomerID = @cusID AND PhoneNumber = '@phNum' @PhoneTypeID and @PhoneNumber are gotten from two properties. We assigned the value to these properties in the presentation layer from the user input text box. The portion below where fetches the values: objSqlCommand.Parameters.AddWithValue("@" + PropertyItem.Name.ToString(), PropertyItem.GetValue(this, null)); The code below fills the values of WHERE: objSqlCommand.Parameters.AddWithValue("@cusID", cusID); objSqlCommand.Parameters.AddWithValue("@phNum", this.PhoneNumber); The final code should look as: UPDATE CustomerPhone SET PhoneTypeID = 7, PhoneNumber = 999444 WHERE CustomerID = 500 AND PhoneNumber = '911'; Phone type id is 7 - user value that is taken from text box Phone number is 999444 - user value that is taken from text box The above final update statement works on the sql environment, but when running via the application, the execute non query runs ok and gets 0 rows updated! I wonder why?

    Read the article

  • LINQ to XML: suppressing redundant namespace attribute in child nodes

    - by GSerg
    If a node belongs to a namespace, it's children by default belong to the same namespace. So there's no need to provide an xmlns attribute on each child, which is good. However. If I create two nodes like this: Dim parent = <parent xmlns="http://my.namespace.org"/> Dim child = <child xmlns="http://my.namespace.org">value</child> parent.Add(child) Console.WriteLine(parent.ToString) The result is this: <parent xmlns="http://my.namespace.org"> <child xmlns="http://my.namespace.org">value</child> </parent> But, if create them in a less convenient way: Dim parent = <parent xmlns="http://my.namespace.org"/> Dim child As New XElement(XName.Get("child", "http://my.namespace.org")) With {.Value = "value"} parent.Add(child) Console.WriteLine(parent.ToString) The result is more desirable: <parent xmlns="http://my.namespace.org"> <child>value</child> </parent> Obviously, I'd prefer to use the first way because it is so much more intuitive and easy to code. There's also another reason to not use method 2 -- sometimes I need to create nodes with XElement.Parse, parsing a string that contains an xmlns attribute, which produces exactly same results as method 1. So the question is -- how do I get the pretty output of method 2, creating nodes as in method 1? The only option I see is to create a method that would clone given XElement, effectively recreating it according to method 2 pattern, but that seems ugly. I'm looking for a more obvious solution I overlooked for some reason.

    Read the article

  • Lose the last 3 chars from string variable

    - by Phil
    if the last 4 chars in my string(result) are " AND" or the last three chars are " OR" I would like to remove these from the string. So far I have am trying result.trimend and a few other methods but am unsure how to get it working. Thanks

    Read the article

  • Is it possible get the functionality of namespaces inside a class?

    - by CowKingDeluxe
    I have the following code: Public Class Form1 Private Function Step1_Execute() As Boolean Return Step1_Verify() End Function Private Function Step1_Verify() As Boolean Return True End Function Private Function Step2_Execute() As Boolean Return Step2_Verify() End Function Private Function Step2_Verify() As Boolean Return True End Function End Class What I would like to do is be able to separate the code, similar to the following (which obviously doesn't work): Public Class Form1 Namespace Step1 Private Function Step1_Execute() As Boolean Return Step1_Verify() End Function Private Function Step1_Verify() As Boolean Return True End Function End Namespace Namespace Step2 Private Function Step2_Execute() As Boolean Return Step2_Verify() End Function Private Function Step2_Verify() As Boolean Return True End Function End Namespace End Class I would like the functionality of namespaces inside of a class, as in something that would let me call Step2.Execute() instead of having to put Step2_ in front of a whole bunch of functions. I don't want to have to create separate classes / modules for step1, step2, etc. Is there a way that I can accomplish namespace functionality from inside a class?

    Read the article

  • Horizontally Flip a One Bit Bitmap Line

    - by roygbiv
    I'm looking for an algorithm to flip a 1 Bit Bitmap line horizontally. Remember these lines are DWORD aligned! I'm currently unencoding an RLE stream to an 8 bit-per-pixel buffer, then re-encoding to a 1 bit line, however, I would like to try and keep it all in the 1 bit space in an effort to increase its speed. Profiling indicates this portion of the program to be relatively slow compared to the rest. Example line (Before Flip): FF FF FF FF 77 AE F0 00 Example line (After Flip): F7 5E EF FF FF FF F0 00

    Read the article

  • Calling a WPF Appliaction and modify exposed properties?

    - by Justin
    I have a WPF Keyboard Application, it is developed in such a way that an application could call it and modify its properties to adapt the Keyboard to do what it needs to. Right now I have a file *.Keys.Set which tells the appliaction (on open) to style itself according to that new style. I know this file could be passed as a command line argument into the appliaction. That would not be a problem. My concern is, is thier a way via a managed environment to change the properties of the executable as long as they are exposed properly, an example: 'Creates a new instance of the Keyboard Appliaction Dim e_key as new WpfAppliaction("C:\egt\components\keyboard.exe") 'Sets the style path e_key.SetStylePath("c:\users\joe\apps\me\default.keys.set") e_key.Refresh() 'Applies the style e_key.HideMenu() 'Hides the menu e_key.ShowDeck("PIN") 'Shows the custom "deck" of keyboard keys the developer 'Created in the style appliaction. ''work with events and resposne 'Clear the instance from memory e_key.close e_key.dispose e_key = nothing This would allow my application to become easily accessible to other Touch Screen Application Developers, allowing them to use my key_board and keep the functionality they need. It seems like it might be possible because (name of executable).application shows all the exposed functions, properties, and values. I just have never done this before. Any help would be appreciated, thank you in advance.

    Read the article

  • Combining two queries on same table

    - by user1830856
    I've looked through several previous questions but I am struggling to apply the solutions to my specific example. I am having trouble combining query 1 and query 2. My query originally returned (amongst other details) the values "SpentTotal" and "UnderSpent" for all members/users for the current month. My issue has been adding two additional columns to this original quert that will return JUST these two columns (Spent and Overspent) but for the previous months data Original Query #1: set @BPlanKey = '##CURRENTMONTH##' EXECUTE @RC = Minimum_UpdateForPeriod @BPlanKey SELECT cm.clubaccountnumber, bp.Description , msh.PeriodMinObligation, msh.SpentTotal, msh.UnderSpent, msh.OverSpent, msh.BilledDate, msh.PeriodStartDate, msh.PeriodEndDate, msh.OverSpent FROM MinimumSpendHistory msh INNER JOIN BillPlanMinimums bpm ON msh.BillingPeriodKey = @BPlanKey and bpm.BillPlanMinimumKey = msh.BillPlanMinimumKey INNER JOIN BillPlans bp ON bp.BillPlanKey = bpm.BillPlanKey INNER JOIN ClubMembers cm ON cm.parentmemberkey is null and cm.ClubMemberKey = msh.ClubMemberKey order by cm.clubaccountnumber asc, msh.BilledDate asc Query #2, query of all columns for PREVIOUS month, but I only need two (spent and over spent), added to the query from above, joined on the customer number: set @BPlanKeyLastMo = '##PREVMONTH##' EXECUTE @RCLastMo = Minimum_UpdateForPeriod @BPlanKeyLastMo SELECT cm.clubaccountnumber, bp.Description , msh.PeriodMinObligation, msh.SpentTotal, msh.UnderSpent, msh.OverSpent, msh.BilledDate, msh.PeriodStartDate, msh.PeriodEndDate, msh.OverSpent FROM MinimumSpendHistory msh INNER JOIN BillPlanMinimums bpm ON msh.BillingPeriodKey = @BPlanKeyLastMo and bpm.BillPlanMinimumKey = msh.BillPlanMinimumKey INNER JOIN BillPlans bp ON bp.BillPlanKey = bpm.BillPlanKey INNER JOIN ClubMembers cm ON cm.parentmemberkey is null and cm.ClubMemberKey = msh.ClubMemberKey order by cm.clubaccountnumber asc, msh.BilledDate asc Big thank you to any and all that are willing to lend their help and time. Cheers! AJ CREATE TABLE MinimumSpendHistory( [MinimumSpendHistoryKey] [uniqueidentifier] NOT NULL, [BillPlanMinimumKey] [uniqueidentifier] NOT NULL, [ClubMemberKey] [uniqueidentifier] NOT NULL, [BillingPeriodKey] [uniqueidentifier] NOT NULL, [PeriodStartDate] [datetime] NOT NULL, [PeriodEndDate] [datetime] NOT NULL, [PeriodMinObligation] [money] NOT NULL, [SpentTotal] [money] NOT NULL, [CurrentSpent] [money] NOT NULL, [OverSpent] [money] NULL, [UnderSpent] [money] NULL, [BilledAmount] [money] NOT NULL, [BilledDate] [datetime] NOT NULL, [PriorPeriodMinimum] [money] NULL, [IsCommitted] [bit] NOT NULL, [IsCalculated] [bit] NOT NULL, [BillPeriodMinimumKey] [uniqueidentifier] NOT NULL, [CarryForwardCounter] [smallint] NULL, [YTDSpent] [money] NOT NULL, [PeriodToAccumulateCounter] [int] NULL, [StartDate] [datetime] NOT NULL,

    Read the article

  • FaceBook like error

    - by user1150440
    I am using the following code in Page_Load Dim metaTagDesc As New HtmlMeta() 'Create a new instance of META tag object Dim metaTagKeywords As New HtmlMeta() Dim metaTagKeywords1 As New HtmlMeta() Dim metaTagKeywords2 As New HtmlMeta() metaTagDesc.Attributes.Add("property", "og:title") ' Add attributes to the META tag object for identification metaTagDesc.Attributes.Add("content", _table.Rows(0).Item(2)) metaTagKeywords.Attributes.Add("property", "og:type") metaTagKeywords.Attributes.Add("content", "website") metaTagKeywords1.Attributes.Add("property", "og:url") metaTagKeywords1.Attributes.Add("content", "http://citizen.tricedeals.com/Reports/" & _table.Rows(0).Item(0)) metaTagKeywords2.Attributes.Add("property", "og:image") metaTagKeywords2.Attributes.Add("content", "http://citizen.tricedeals.com/ProfilePictures/" & _table.Rows(0).Item(1) & ".jpg") Page.Header.Controls.Add(metaTagDesc) Page.Header.Controls.Add(metaTagKeywords) Page.Header.Controls.Add(metaTagKeywords1) Page.Header.Controls.Add(metaTagKeywords2) But i keep getting this error..."Your og:type object name has disallowed characters in it. It must match [a-z][a-z0-9._]*" Why?

    Read the article

  • Automatically "upgrade" user settings from previous version of app.config file?

    - by SqlRyan
    Every time I compile my app and the version number changes (I have an auto-incrementing build number), I lose the user-configured app.config settings, since they're stored in the AppData folder for a specific version. Essentially, every release of my application starts from scratch as far as user settings go. While this is a mild annoyance in development, it raises the question as I approach deployment/release - if I use the app.config to store my user settings, will the user's personalized settings be hosed every time they install a patch that changes the version number of my app? If so, is there an easy way to "upgrade" the settings from the previous release? I know that using HKCU in the registry is another option, but I like the ease of the My.Settings namespace, and I'd like to stay with app.config. Another SO question asks something similar, though the answer doesn't seem that clear. Will setting my MSI so it asks the user to upgrade be enough to preserve these user-level settings?

    Read the article

  • Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.

    - by alvn.dsza
    i get the error in following code Function ReadFile(ByVal sPath As String) As Byte Dim data As Byte data = Nothing Dim fInfo As FileInfo fInfo = New FileInfo(sPath) Dim numBytes As Long numBytes = fInfo.Length Dim fStream As FileStream fStream = New FileStream(sPath, FileMode.Open, FileAccess.Read) Dim br As BinaryReader br = New BinaryReader(fStream) data = Convert.ToByte(br.ReadBytes(numBytes)) `getting error on this line` Return data End Function

    Read the article

  • Forcing A Postback Asp.Net

    - by Nick LaMarca
    Please take a look at the following click event... Protected Sub btnDownloadEmpl_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDownloadEmpl.Click Dim emplTable As DataTable = SiteAccess.DownloadEmployee_H() Dim d As String = Format(Date.Now, "d") Dim ad() As String = d.Split("/") Dim fd As String = ad(0) & ad(1) Dim fn As String = "E_" & fd & ".csv" Response.ContentType = "text/csv" Response.AddHeader("Content-Disposition", "attachment; filename=" & fn) CreateCSVFile(emplTable, Response.Output) Response.Flush() Response.End() lblEmpl.Visible = True End Sub This code simply exports data from a datatable to a csv file. The problem here is lblEmpl.Visible=true never gets hit because this code doesnt cause a postback to the server. Even if I put the line of code lblEmpl.Visible=true at the top of the click event the line executes fine, but the page is never updated. How can I fix this?

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >