Search Results

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

Page 117/179 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • dropdownlist's Datavaluefield is not working

    - by Ranjana
    i am getting the datas from database and storing in a collectionobject. The collectionobj contains the Datas 'Name' and 'ID'. My code: <asp:dropdownlist id="dropdown1" runat="server" DataTextField="Name" DataValueField="ID"/> collectionobj=objbs.GetNAmes() for intloop as integer in Collectionobj.Count.Rows-1 dropdown.Items.Add( Collectionobj.Items(intloop).Name) dropdown.DataValueField=Collectionobj.Items(intloop).ID Next dropdown.DataBind() Im getting the Value binded in the dropdown as "Names" . when i select the dropdown i need to pass the respective ID of that name. But when I assign the Dim strid as String=dropdown1.DataValueField The dropdown1.DataValueField is holding the id of last name binded in the dropdown.it is not taking the id which im selecting n the dropdown.. Any suggestion..........

    Read the article

  • folder deleting not working

    - by user1150440
    If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(Server.MapPath("images/TravelogueGallery/" & getMaxID()))) Then System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True) End If I am using the above code snippet to delete a directory but i get this error "'G:\Projects\Latest\LTCIndia 05-04-12 1415\images\TravelogueGallery\19' is not a valid virtual path. " Whats wrong with the code?

    Read the article

  • Looking for fast "Find in Files" program

    - by Josh McDonald
    I currently have a directory with 98,000 individual archive transaction files. I need to search those files for user input strings and have the option to open the files as it finds them or at the end of the search. I'm using Notepad++ currently and, while functional, it's quite slow. I thought about writing my own, but I am only familiar with .NET and I'm a beginner. Also, I'm not sure how efficient that would be compared to NP++. This tool would be used again and again so the dev time would definitely be worth it if it came to that. Is there some other tool out there that's already developed that would accomplish this?

    Read the article

  • Adding link to a label ASP.NET (VB)

    - by AZIRAR
    Hello, I have a label and I want to add to it a link. I want to use javascript like : MyLabel.Attributes.Add("`onclick`", "javascript:`SOME_CODE`") What must I add in (SOME_CODE) to redirect the user to another link. Thanks.

    Read the article

  • How to close the connection after set Transation to Nothing or Commit/Rollback

    - by user1957271
    I develop the DAL class for db operation Public Sub StartTransaction() Dim objConnection As SqlConnection = EstablishConnection() objConnection.Open() Me.Transaction = objConnection.BeginTransaction() End Sub Public Sub CommitTransaction() Me.Transaction.Commit() End Sub Public Sub RollBackTransaction() Me.Transaction.Rollback() End Sub after start the transaction when we commit or rollback and set transaction object to nothing it dont close the connection attach with this transaction how I close the Connection attach to this transaction???

    Read the article

  • What Design Pattern To Replace 'CurrentStep' Variable

    - by Rob P.
    Tried to search but didn't know how to phrase it. I've got some code that is essentially... Private CurMajorStep as Integer = 0 Private CurMinorStep as Integer = 0 Public Sub PerformNextStep() Select Case iMajorStep Case 0 ThingOne() Case 1 ThingTwo() Case 2 ThingThree() Case 3 ThingFour() Case 4 AnythingElse() Case 5 Finish() End Select End Sub And then, in some of those, the CurMinorStep keeps track of the current state of that particular 'step'. I hope that all makes sense. The code is messy and I know it's going to be problematic to maintain. Can someone point me to a clean OO pattern to handle this?

    Read the article

  • Obtaining Index value of dictionary

    - by Maudise
    I have a piece of code which looks at the following public Test As Dictionary(Of String, String()) Which is brought in tester = New Dictionary(Of String, String()) tester.add("Key_EN", {"Option 1_EN", "Option 2_EN", "Option 3_EN"}) tester.add("Key_FR", {"Option 1_FR", "Option 2_FR", "Option 3_FR"}) tester.add("Key_DE", {"Option 1_DE", "Option 2_DE", "Option 3_DE"}) There's then a combo box which looks at the following dim Language as string Language = "_EN" ' note this is done by a drop down combo box to select _EN or _FR etc. cboTestBox.items.AddRange(tester("Key" & Language)) What I need to be able to do is to see what index position the answer is in and convert it back to the Key_EN. So, for example _DE is selected, then the options of "Option 1_DE", "Option 2_DE", "Option 3_DE" would be displayed. If they chose Option 3_DE then I need to be able to convert this to Option 3_EN. Many thanks Maudise

    Read the article

  • Visual Basic 2013 String Replacement

    - by user3707612
    I found this code that replaces a string in a text file. But, I am trying to make it so that it replaces several strings in a text file. My.Computer.FileSystem.WriteAllText("C:\windows\PrinterList2.txt", My.Computer.FileSystem.ReadAllText("C:\windows\PrinterList.txt").Replace("IT", "ADM-IT"), False) For example, I need it to replace "IT" with "ADM-IT" and "AR" with "ADM-AR" and possibly a hundred or so more. How can I get it to loop to do them all? Running this line of code over and over just overwrites the file with the last item for replacement. Thanks in advance.

    Read the article

  • GridView with multiple DataSources

    - by mike1973
    Hello, I have a grid view that will display columns from multiple data sources (3). The data sources are stored procedures that contains a variety of columns not identical, How can i select the columns from these datasources and bind them to the Grid programtically (from code behind)??? Thanks

    Read the article

  • Checking for a session variable... returns (Object reference not set to an instance of an object.)

    - by Chocol8
    In the Session_Start i have Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Session("login") = False End Sub and in a custom .aspx page i included the following... Public ReadOnly Property GetLoginState() As Boolean Get If Current.Session("login") Is Nothing Then Current.Session("login") = False End If Return Current.Session("login") End Get End Property Why i am getting error the error Object reference not set to an instance of an object. at line If Current.Session("login") Is Nothing Then while checking for the login state as follows? If GetLogin = False Then 'Do something End if I mean i have already created the instance on the Session_Start... Haven't i? What am i doing wrong here?

    Read the article

  • Show a form after Application Load

    - by blancaster
    I want to show a dialog box or form immediately after my application loads. If I place a .showdialog in the main form load event the dialog shows before the application shows. I’m trying to give some user tips when they load my application. Thanks

    Read the article

  • Invalid attempt to access a field before calling Read() INSERT

    - by Raphael Fernandes
    I'm trying to use this code to check if the system already exists a field with this value Dim adap As New MySqlDataAdapter Dim sqlquery = "SELECT * FROM client WHERE code ='"+ TxtCode.Text +"'" Dim comand As New MySqlCommand() comand.Connection = con comand.CommandText = sqlquery adap.SelectCommand = comand Dim data As MySqlDataReader data = comando2.ExecuteReader() leitor.Read() If (data(3).ToString) = code Then MsgBox("already exists", MsgBoxStyle.Information) TxtCode.ResetText() TxtCode.Focus() Else Console.WriteLine(insert("INSERT INTO client (name, tel, code) VALUES ('" & name & "', '" & tel & "')")) con.Close() End If

    Read the article

  • Programmatically adding event handler to array of radio buttons

    - by gSaenz
    Trying to add event handlers to radio buttons that are created on user input, looking at this and this as examples. However I get an error that answerOptions is not an event. Create the radio buttons Private answerOptions(n) As RadioButton ... Private Sub showQuestion(n As Integer) For i = 0 To answerOptions.Length - 1 answerOptions(i) = New RadioButton AddHandler answerOptions, AddressOf Me.Radios_Click With answerOptions(i) ' --------- SET TEXT, LOCATION ETC. End With Me.Controls.Add(answerOptions(i)) Next End Sub Planning on then handling events with Private Sub Radios_Click(sender As Object, e As EventArgs) Handles answerOptions.checked End Sub I want things to happen when the radios are checked. Don't want to use checkboxes as I want to limit one selection at a time.

    Read the article

  • Will [WithEvents = Nothing] RemoveHandlers in the derived class?

    - by serhio
    I use to set WithEvents variables to Nothing in Destuctor, because this will "Remove" all the Handlers associated with Handles keyword. Will this have the same effect for derivated classes? Class A Protected WithEvents _Foo as Button Private Sub _Foo_Click Handles _Foo.Click ' ... some Click action ' End Sub Public Sub Dispose(disposing as Boolean) If disposing then _Foo = Nothing ' remove handler _Foo_Click ' End Sub End Class Class B Inherits A Private Sub _Foo_Move Handles _Foo.Move ' ... some Move action ' End Sub ' ????? will or NOT remove OR handler _Foo_Move the base Dispose??' Public Overrides Sub Dispose(disposing as Boolean) 'If disposing then _Foo = Nothing ' MyBase.Dispose(disposing) End Sub End Class

    Read the article

  • Action(Of T) in Visual Basic in List(Of T).ForEach

    - by Jason
    I have searched high and low for documentation on how to use this feature. While the loop I could write would be simple and take no time, I really would like to learn how to use this. Basically I have a class, say, Widget, with a Save() sub that returns nothing. So: Dim w as New Widget() w.Save() basically saves the widget. Now let's say I have a generic collection List(Of Widget) name widgetList(Of Widget) and I want to run a Save() on each item in that list. It says I can do a widgetList.ForEach([enter Action(Of T) here]) ....but how in the F does this work??? There is no documentation anywhere on the intrablags. Help would be much much appreciated.

    Read the article

  • Conditional Statements - If Then vs. Select Case

    - by cloyd800
    I'm a bit new to programming, and based on the few sources I've read both on the web and the books I'm learning to teach myself they are able to define what IF THEN and SELECT CASE conditional statements are, but have failed to give a comparison as to why I would use one over the other and what best practices decide this. If I'm understanding these conditional statements correctly, then both are based on a set of conditions with an outcome based around meeting these conditions, and if no conditions are met then an alternative outcome can be defined. I'm having trouble in understanding when I would use an IF THEN statement, and when I'd use a SELECT CASE statement, and what best practices are used to define this decision. Any insight on this would be greatly appreciated!

    Read the article

  • Data Type Not Consistent In MS Access? (Set new field as "TEXT" but system treats it as "Yes/No" field)

    - by user3522506
    I already have an SQL command that will insert any string in the field. But it doesn't accept any string, giving me "No value given for one or more required parameters". But if my string is "Yes" or "No", it will update successfully. And in MS Access, will appear as 0 or -1 even though I set the field as text even in the beginning. Could there be any configuration I have made in my MS Access 2007? con = New OleDbConnection(cs) con.Open() Dim cb As String = "Update FS_Expenses set FS_Date=#" & dtpDate2.Text & "#,SupplierID='" & txtSupplierID.Text & "', TestField=" & Label1.Text & " where ID=" & txtID2.Text & "" cmd = New OleDbCommand(cb) cmd.Connection = con cmd.ExecuteReader() MessageBox.Show("Successfully updated!", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information) con.Close() TestField is already a TEXT data type, Label1.Text value is "StringTest", will give the error. However, set Label1.Text value as = "Yes", SQL will execute successfully. Therefore, field must have not been saved as TEXT.

    Read the article

  • Search in Repeater

    - by user2797643
    On pageload i want to show all fields in repeater control and on typing licenseid in the textbox i want to show that specific licenceid details IF I place below code in the datasource of repeater,First one is not working.In the second one i placed a textbox and put its value to 0 on pageload.it is working.But i want both to be working. SELECT * FROM License WHERE (0 = @selectAll OR LicenseID=@LicenseID) -> Not working SELECT * FROM License WHERE (0 = @selectAll ) ->working SELECT * FROM License WHERE (LicenseID=@LicenseID)-> working Thanks in advance for the help

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >