Search Results

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

Page 104/179 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • How to Solve this Error "Cannot convert lambda expression to type 'string' because it is not a deleg

    - by peace
    . I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue Can you please advice. Employee emp = new Employee(); comHandledBySQt.DataSource = from x in emp.GetDataFromTable("1") select new { x.Id, Name = x.FirstName + " " + x.LastName }; comHandledBySQt.DisplayMember = "Name"; comHandledBySQt.ValueMember = "Id"; Above code should displays drop list of employees first name and last name in a combo box

    Read the article

  • DateTime And ParseExact Problems

    - by WizardsSleeve
    Hi There I wish to convert my string in format dd/mm/yyyy hh:mm:ss to a DateTime of the same format. Dim ukCulture As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-GB") Dim myDateTime As DateTime myDateTime = DateTime.ParseExact("18/05/2010 23:42:10, "dd/MM/yyyy HH:mm:ss", ukCulture) When I step through this code the variable myDateTime is 05/18/2010 23:42:10 it appears that the dd/mm is the wrong way around and I cant work out how to correct this. Can ayone offer any guidance on how to correct this please?

    Read the article

  • Me As Child Type In General Function

    - by Steven
    I have a MustInherit Parent class with two Child classes which Inherit from the Parent. How can I use (or Cast) Me in a Parent function as the the child type of that instance? EDIT: My actual goal is to be able to serialize (BinaryFormatter.Serialize(Stream, Object)) either of my child classes. However, "repeating the code" in each child "seems" wrong. EDIT2: This is my Serialize function. Where should I implement this function? Copying and pasting to each child doesn't seem right, but casting the parent to a child doesn't seem right either. Public Function Serialize() As Byte() Dim bFmt As New BinaryFormatter() Dim mStr As New MemoryStream() bFmt.Serialize(mStr, Me) Return mStr.ToArray() End Function

    Read the article

  • Whats the Best Practice for a Search SQL Query?

    - by Marc V
    I have a SQL 2008 Express database, which have following tables: CREATE TABLE Videos (VideoID bigint not null, Title varchar(100) NULL, Description varchar(MAX) NULL, isActive bit NULL ) CREATE TABLE Tags (TagID bigint not null, Tag varchar(100) NULL ) CREATE TABLE VideoTags (VideoID bigint not null, TagID bigint not null ) Now I need SQL query to search for word (i.e. Beyonce Halo Music Video) against these tables. Which videos have: For Title exact phrase will get 0.5 points For Description exact phrase will get 0.4 points For tags exact phrase will get 0.3 points For title all words will get 0.2 points For description all words will get 0.2 points For title one or more words will get 0.1 points For description one or more words will get 0.1 points And I will show these videos on basis of points. What will be the SQL Query for this? A LINQ query will be more better. If you know a better way to achieve this, please help.

    Read the article

  • Mdi Children Changed in .Net

    - by Ben
    Hi Is there a simple way of tracking the change of an Mdi's children i.e. when they are created and closed, something like an event OnMdiChildListChanged (I realise this doesn't actually exist). I am also aware that I could have a method within my Mdi that handles the creation of child forms and logs the state of them or even create an Interface that defines that a child form has a "NotifyParent" method that is then called on close of the form, but i was wondering if there was any built in events that i could plumb into? Thanks

    Read the article

  • Overrided ToString doesn't show in debug

    - by marco.ragogna
    I have a collection similar to: Public Class MyCollection Inherits ObservableCollection(Of MyCollection) Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _Name = value End Set End Property Public Overrides Function ToString() As String Return "Name: " & _Name End Function End Class I have overrided ToString method in order to help in debug, but it doesn't show up. In the code that follow if, during debug, I move the mouse over coll it shows me Count = 0 Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded Dim coll As New MyCollection coll.Name = "Test" End Sub Do you know what could be the problem?

    Read the article

  • Help setting focus on the parent

    - by serhio
    I have a simple situation (.NET2): a texbox1 on a UserControl1(or Form1). I want to unfocus(leave) the texbox when I click on the usercontrol/form(focus the usercontrol/form instead): I do the following on the UC/form: Protected Overrides Sub OnMouseClick _ (ByVal e As System.Windows.Forms.MouseEventArgs) MyBase.OnMouseClick(e) Me.Focus() End Sub Why does it not work on the child textbox, but works very well on the non-child one(focus on textBox2 then click on the panel removes the focus from the textBox2)? Real project Window

    Read the article

  • Inspecting a Word mail merge data source programmatically

    - by Guy Marom
    I want to iterate over all rows of a MS-Word mail merge data source and extract the relevant data into an XML. I'm currently using this code: Imports Microsoft.Office.Interop Do objXW.WriteStartElement("Recipient") Dim objDataFields As Word.MailMergeDataFields = DataSource.DataFields For Each FieldIndex As Integer In mdictMergeFields.Keys strValue = objDataFields.Item(FieldIndex).Value If Not String.IsNullOrEmpty(strValue) Then strName = mdictMergeFields(FieldIndex) objXW.WriteElementString(strName, strValue) End If Next objXW.WriteEndElement() If DataSource.ActiveRecord = LastRecord Then Exit Do Else DataSource.ActiveRecord = Word.WdMailMergeActiveRecord.wdNextDataSourceRecord End If Loop And it turns out to be a little sluggish (About 1 second for each row). Is there any way to do it faster? My fantasy is finding a function like MailMergeDataSource.ToDatatable and then inspecting the datatable.

    Read the article

  • SSIS: Update a RecordSet passed into a VB.NET ScriptTask

    - by Zambouras
    What I am trying to accomplish is using this script task to continually insert into a generated RecordSet I know how to access it in the script however I do not know how to update it after my changes to the DataTable have been made. Code is Below: Dim EmailsToSend As New OleDb.OleDbDataAdapter Dim EmailsToSendDt As New DataTable("EmailsToSend") Dim CurrentEmailsToSend As New DataTable Dim EmailsToSendRow As DataRow EmailsToSendDt.Columns.Add("SiteMgrUserId", System.Type.GetType("System.Integer")) EmailsToSendDt.Columns.Add("EmailAddress", System.Type.GetType("System.String")) EmailsToSendDt.Columns.Add("EmailMessage", System.Type.GetType("System.String")) EmailsToSendRow = EmailsToSendDt.NewRow() EmailsToSendRow.Item("SiteMgrUserId") = siteMgrUserId EmailsToSendRow.Item("EmailAddress") = siteMgrEmail EmailsToSendRow.Item("EmailMessage") = EmailMessage.ToString EmailsToSend.Fill(CurrentEmailsToSend, Dts.Variables("EmailsToSend").Value) EmailsToSendDt.Merge(CurrentEmailsToSend, True) Basically my goal is to create a single row in a new data table. Get the current record set, merge the results so I have my result DataTable. Now I just need to update the ReadWriteVariable for my script. Do not know if I have to do anything special or if I can just assign it directly to the DataTable I.E. Dts.Variables("EmailsToSend").Value = EmailsToSendDt Thanks for the help in advanced.

    Read the article

  • Most Frequent Number

    - by VBeginner
    Hello, I've used an array of strings to populate a DataGridView. How do I go about finding the most frequently occurring number? Or, even better, order them by most frequently occuring? Thank You.

    Read the article

  • Why can't you return a List from a Compiled Query?

    - by Andrew
    I was speeding up my app by using compiled queries for queries which were getting hit over and over. I tried to implement it like this: Function Select(ByVal fk_id As Integer) As List(SomeEntity) Using db As New DataContext() db.ObjectTrackingEnabled = False Return CompiledSelect(db, fk_id) End Using End Function Shared CompiledSelect As Func(Of DataContext, Integer, List(Of SomeEntity)) = _ CompiledQuery.Compile(Function(db As DataContext, fk_id As Integer) _ (From u In db.SomeEntities _ Where u.SomeLinkedEntity.ID = fk_id _ Select u).ToList()) This did not work and I got this error message: Type : System.ArgumentNullException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Value cannot be null. Parameter name: value However, when I changed my compiled query to return IQueryable instead of List like so: Function Select(ByVal fk_id As Integer) As List(SomeEntity) Using db As New DataContext() db.ObjectTrackingEnabled = False Return CompiledSelect(db, fk_id).ToList() End Using End Function Shared CompiledSelect As Func(Of DataContext, Integer, IQueryable(Of SomeEntity)) = _ CompiledQuery.Compile(Function(db As DataContext, fk_id As Integer) _ From u In db.SomeEntities _ Where u.SomeLinkedEntity.ID = fk_id _ Select u) It worked fine. Can anyone shed any light as to why this is? BTW, compiled queries rock! They sped up my app by a factor of 2.

    Read the article

  • Get label height for fixed width

    - by Jonas
    Is there any way I can get the height of a label, if it hypothetically had a certain width? I've been trying with control.GetPreferredSize(size) like so: Dim wantedWidth as Integer = 100 dim ctrlSize as Size = label.GetPreferredSize(new Size(wantedWidth, 0)) because I thought that setting height = 0, would indicate a free height, but the height I get is way too small. I also tried to estimate the height of the label, using Graphics.MeasureString to calculate the equivalent area of the Label dim prefWidth as Integer = 100 dim estSize as SizeF = g.MeasureString(label.Text, label.Font) dim estHeight as Integer = (Integer)(estSize.Width * estSize.Height / prefWidth) but that yields the same result. Any ideas? I'm on .NET 2.0, unfortunately.

    Read the article

  • Accented character regex

    - by user314573
    I'm trying to create a regex that will look for french words whether a user specifies the accented characters or not. So if the the user has searched for "déclaré" but types in declare instead I would like to be able to match the text still. I'm having difficulty making this more dynamic so that it can be matched on any french word... Closest example from another user from a different post was: d[eèéê]cl[aàáâ]r[eèéê] Is it even possible to write a regex for something like this? Any advice would be much appreciated.

    Read the article

  • parsing xml attribute value

    - by vbNewbie
    I have been parsing xml content using the xmlreader and cannot use the xml document but so far it works getting all elementcontent except for the attribute contents. I need to parse the link below found in the following entry; <title>XXXX UUUUUU posted a</title> <category term="NotePosted" label="Note Posted"/> <link rel="alternate" type="html" href="http://www.dfsddsfdsf.com/profile.php?id=sdfdfsfdsdfddfsfd&amp;v=wall&amp;story_dbid=dssdfasdfdasfdsafafafa"/> <source>......... <source> I need the href tag in the link attribute but it keeps coming back null. While ureader.Read If ureader.HasAttributes Then fId = ureader.GetAttribute("href") If fId.Contains("?v=wall&amp") Then fIdList.Add(fId) Exit While End If If String.IsNullOrEmpty(fId) Then fId = "NOTHING" End If End If End While

    Read the article

  • redirect gridview selected row data to two different pages on clicking on two different select button asp.net?

    - by user559800
    Ihave a gridview item template field namely Status as mentioned above ... i want when user click on hold button of particular row then the record from the particular row is transfered to another page. ... means.... if i click on the hold button of 1st row of gridview then seats=35 and booking closed =08:00:00 PM willbe trasferred to Me.Response.Redirect("Select_seats.aspx?s_no=" & label22.Text.ToString & "&" & "journey=" & label6.Text & "&" & "seater=" & label4.Text & "&" & "sleeper=" & label2.Text & "&" & "service=" & lab5.Text.ToString) .. and if i click on the manage button of same row then the record of that row will be transferred to Me.Response.Redirect("Select_nfo.aspx?s_no=" & label22.Text.ToString & "&" & "journey=" & label6.Text & "&" & "seater=" & label4.Text & "&" & "sleeper=" & label2.Text & "&" & "service=" & lab5.Text.ToString)

    Read the article

  • How to implement tagging in asp.net using visual basic.

    - by Marina A
    Hi all how can i implement tagging in my asp.net website using visual basic. is there any online video tutorials? or complete help of tagging and how to show older tags or give new tags to any contents. secondly i want to know how to implement cloud tagging? The say why of tagging this stake overflow is using right now. when we put the mouse on tags text box it suggest some older tags and also we can enter new tags.

    Read the article

  • IEnumerable not null but calling Count() results in Exception

    - by Draak
    I have code that's working beautifully on my development machine, but when deployed to the server is throwing null reference exception. So, I can't step through the code, but I've pinned down the culprit. But now I am puzzled. Here's the code. The question is below. Dim certs = From p In persons _ Select New Certificate( _ p.Value, _ New CertificateData.Seminar(thisEvent.Seminar.Name, _ thisEvent.StartDate.Value, _ thisEvent.EndDate.Value, _ thisEvent.Venue.City, _ thisEvent.Venue.State, _ New CertificateData.Instructor( _ staffMember.Name, _ staffMember.Titles, _ instrSignatPath))) _ With {.CertificateId = p.Key} lblMessage.Text = CStr(certs Is Nothing) lblMessage.Text = lblMessage.Text + "<br />" + CStr(certs.Count()) In the code above persons is a dictionary of custom class, and certs is of IEnumerable type. Now here's the quandary.. The first line that sets the label returns False, so certs is not null. But the second line throws an null reference exception. How is this possible?

    Read the article

  • Pass property to access using .NET

    - by BitFiddler
    I'm fairly sure this is possible, but what I want to do is have a generic method where I can pass in an object along with a Expression that will tell the method which Property to use in it's logic. Can anyone get me started on the syntax for something like this? Essentially what I would like to code is something like: Dim firstNameMapper as IColumnMapper = new ColumnMapper(of Author)(Function(x) x.FirstName) Dim someAuthorObject as new Author() fistNameMapper.Map("Richard", someAuthorObject) Now the mapper object would know to set the FirstName property to "Richard". Now using a Function here won't work, I know this... I'm just trying to give an idea what I'm trying to work towards. Thanks for any help!

    Read the article

  • Loading user control dynamically looses data

    - by user228777
    I have a created a user control. This user control I dynamically load on a page inside Telerik Panelbar control. I have done all necessary coding to save the viewstate and load this dynamically created usercontrol every time page loads. On this User control I have a asp panel. By default this panel is invisible. When user clicks a button on this user control panel is made visible. On page load of this user control I populate all the controls on this panel. Everything works fine if I don’t load this use control dynamically but when I load this user control dynamically and if I make panel visible by default then only all fields on the panel are populated. But if I make by default invisible and on button click make panel visible none of the text boxes or comboboxes are populated. I populate comboboxes on page load of the userControl but inbetween postbacks all the comboboxes on the user control loose data. ON the parent page I am saving the viewstate This is my code on parent page to dynamically load userControl ( which has panel on it) Dim ucPiggyBank As SubscriberSetupPages_UserControls_PiggyBank = CType(LoadControl("~/SubscriberSetupPages/UserControls/PiggyBank.ascx"), SubscriberSetupPages_UserControls_PiggyBank) With ucPiggyBank .PiggyBankID = account.Id .ID = account.Id.ToString 'Setting up following 3 properties here to avoid database trips .PiggyBankEligibleAccounts = piggyBankEligibleAccountCollection .MemorizedNames = memorizednames .Period = period End With radPanelNewChild.Controls.Add(ucPiggyBank) radPanelNew.Items.Add(radPanelNewChild) radPanelNew.Expanded = True ‘this is the Panel item on parent page of Telerik Panelbar control. Dim radPanelPiggyBank As RadPanelItem = DirectCast(pnlbarPiggyBank.FindItemByValue("TestItem"), RadPanelItem) With radPanelPiggyBank .Items.Add(radPanelNew) .DataBind() End With ‘I am doing everything for saving viewstate on parent control This is the code on page load of userControl If Not IsPostBack Then If m_PiggyBankID <> Guid.Empty Then 'Load data Call GetPiggyBankDetails() End If I have a edit button on the user control which makes panel visible. It makes panel visible but with no data. Can you please tell me what’s happening? Thanks in advance.

    Read the article

  • asp.net web service OneWay definition not working

    - by jbrook10
    When I specify <SoapDocumentMethod(OneWay:=True)> on my webservice it doesn't seem to get called. If I remove that the webservice works properly. Also, everything works fine on the development machine just not on the server. Here is my web method: <SoapDocumentMethod(OneWay:=True)> _ <WebMethod()> _ Public Sub Write(ByVal processGroupId As Integer) xslClass.xslHelper.writeDatabase(processGroupId) ', processGroupName) End Sub Here is my calling code: Dim svc As New svcWriteFiles.WriteDatabaseService svc.WriteAsync(e.CommandArgument) Any ideas?

    Read the article

  • How do you Bind to a ComboBox in a DataTemplate?

    - by discwiz
    I have a listbox that is bound to an observable collection of Audio (custom class). The Audio class has two properties, DisplayText (string) and a property called TarpIds (Observable Collection of Integer). I need to allow the user to change the TarpID in the combo box for each list item displayed and catch the selection change. I created a DataTemplate that styles the DisplayText property from the Audio object and adds a ComboBox to display the available TarpIDs for this audio (These are dynamic and unique to each Audio). The DisplayText works great, but I can not get the TarpIDs to display in the ComboBox. Here is what I have so far and thanks for any help. FYI I set the ItemSource at run time that binds the ListUploadAudio to the Observable Collection of Audio. <Border BorderBrush="Red" Background="WhiteSmoke" CornerRadius="8"> <Border.Resources> <DataTemplate x:Key="UploadLayout" DataType="Audio"> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Path=DisplayText}" FontWeight="Bold" Foreground="Blue"> </TextBlock> <ComboBox x:Name="ListBoxTarpIDs" ItemsSource="{Binding Path=TarpIds}"> </ComboBox> </StackPanel> </DataTemplate> </Border.Resources> <ListBox x:Name="ListUploadAudio" BorderBrush="Transparent" Background="Transparent" Width="230" Margin="10" Height="200" IsSynchronizedWithCurrentItem="True" SelectionMode="Multiple" ItemTemplate="{DynamicResource UploadLayout}"> </ListBox> </Border>

    Read the article

  • ASP.NET MVC - How do I implement validation when using Data Repositories? (Visual Basic)

    - by rockinthesixstring
    I've built a UserRepository interface to communicate with my LINQ to SQL Data layer, but I'm trying to figure out how to implement validation. Here is what my AddUser subroutine looks like Public Sub AddUser(ByVal about As String, ByVal birthdate As DateTime, ByVal openid As String, ByVal regionid As Integer, ByVal website As String) Implements IUserRepository.AddUser Dim user = New User user.About = about user.BirthDate = birthdate user.LastSeen = DateTime.Now user.MemberSince = DateTime.Now user.OpenID = openid user.RegionID = regionid user.UserName = String.Empty user.WebSite = website dc.Users.InsertOnSubmit(user) dc.SubmitChanges() End Sub And then my controller will simply call AddUser(...) But I haven't the foggiest idea on how to implement both client side and server side validation on this. (I think I would prefer to use jQuery AJAX and do all of the validation on the server, but I'm totally open to opinions)

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >