Search Results

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

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

  • Store latitudes and longitudes in database for proximity/radius search using Google Maps API, .NET a

    - by poojad
    What is the approach for storing the latitudes and longitudes for multiple addresses as a one time set up. I need to find the nearby stores using Google Maps and I have to get the latitudes and longitudes of all the available stores. As the data is huge and may increase or change in future, can anyone suggest an approach taking performance and maintenance into consideration. Thank you.

    Read the article

  • Create new Array of parameter type

    - by pimvdb
    I'm trying to create a function to parse out all values in a multidimensional Array with all but one dimension given. The details are not relevant, but for this function I need to return an one-dimensional Array containing values of the same type the original multidimensional Array has. To pass any Array with any dimension to my function, I declared the type of this parameter as Array. However, how would I create a new Array of that specific type (e.g. Integer)? Currently I have the following code: Function GetRow(ByVal arr As Array) As Array Dim result As (...) 'This should be Integer() if arr contains Integers, etc. Return result End Function How do I declare the type of result to make it having the same type of values as arr? New Array is not possible as it is declared MustInherit. Thanks a lot.

    Read the article

  • How to highlight a taskbar item

    - by Faisal
    In almost all messengers when your IM window is minimized to the taskbar, IM taskbar item changes color or gets brighter when you have a new message. I've been looking for any help on how to do this using .NET Winforms or WPF Any code samples?

    Read the article

  • Adding a Way To preserve A Comma In A CSV To DataTable Function

    - by Nick LaMarca
    I have a function that converts a .csv file to a datatable. One of the columns I am converting is is a field of names that have a comma in them i.e. "Doe, John" when converting the function treats this as 2 seperate fields because of the comma. I need the datatable to hold this as one field Doe, John in the datatable. Function CSV2DataTable(ByVal filename As String, ByVal sepChar As String) As DataTable Dim reader As System.IO.StreamReader Dim table As New DataTable Dim colAdded As Boolean = False Try ''# open a reader for the input file, and read line by line reader = New System.IO.StreamReader(filename) Do While reader.Peek() >= 0 ''# read a line and split it into tokens, divided by the specified ''# separators Dim tokens As String() = System.Text.RegularExpressions.Regex.Split _ (reader.ReadLine(), sepChar) ''# add the columns if this is the first line If Not colAdded Then For Each token As String In tokens table.Columns.Add(token) Next colAdded = True Else ''# create a new empty row Dim row As DataRow = table.NewRow() ''# fill the new row with the token extracted from the current ''# line For i As Integer = 0 To table.Columns.Count - 1 row(i) = tokens(i) Next ''# add the row to the DataTable table.Rows.Add(row) End If Loop Return table Finally If Not reader Is Nothing Then reader.Close() End Try End Function

    Read the article

  • [ASP.NET] How can I HTML-encode a string and use human-readable encoded tags (ex: &ecirc; instead of

    - by Beerdude26
    Greetings, I'm looking for a way to encode a string into HTML that uses human-readable tags such as &ecirc; (=ê). At the moment, I am using the HttpUtility.HtmlEncode() function, but it appears to return numbered tags instead of human-readable ones. For example: Dim str as string = HttpUtility;HtmlEncode("vente - en-tête") 'Expected: vente - en-t&ecirc;te 'Actually received: vente - en-t&#234;te Is there a setting or function in ASP.Net to encode a string into HTML resembling the first comment? EDIT: I am looking for this kind of functionality because the text is saved HTML-encoded in the database. The text comes from a bunch of MS Word documents that have been converted to HTML.

    Read the article

  • Isolating read and write in multithreaded

    - by the_lotus
    Hi In a multithreaded application. I have a bunch of function that loop through a collection to read the information. I also have a bunch of function that modifies that same collection. I’m looking for a way to isolate all the read and the write together. I don’t want a write to be done while a read is in progress. I was thinking of using SyncLock on the collection object but this will block multiple read trying to work in parallel.

    Read the article

  • Single Sign On with 3 applications

    - by John H.
    I'm building three web applications in .NET that will all share a users database and login information. Lets pretend that application 1 is the "parent" application and applications "A" and "B" are the "child" applications. All users have to be logged into application 1 to have access to applications A and B. Authorization, Authentication, and MachineKey sections of all web configs are present and work correctly. I have the correct web.config settings in all applications to achieve Single Sign On except one problem remains: what do I put in the "loginUrl" attribute of the forms tag in Applications A and B. Assume that the url for the login to application 1 is "www.johnsapp.com/login.aspx" How can I get applications A and B to send the user back to application 1 for authentication using only settings in web.config?

    Read the article

  • Regular Expression; Find whether a line contains any word with more than X characters.

    - by Simpsoid
    Hi, I am trying to use a Validator on a ASP.NET site and need to find whether the Street Address textbox contains a valid entry. Entries with words that are longer than X characters (in this case 25, with no punctuation or spaces) will cause the HTML on a printed A4 page to not wrap properly and therefore not to confrom to certain sizes correctly pushing the margins off. For a street address I want to match that something like "201 Long Road" is valid but "235 ReallyLongAndNarrowWindingRoadBesideTheRiver Street" is invalid. Using a Microsoft .Net Regular Expression Validator I need to know what the RegEx pattern might be. I think if it does find a match the Validator will fire correctly however if there is no match the Validator won't fire and the Update button (in this case) won't fire. Since Street addresses can contain Capital Letters and numbers etc. it will need to accomodate for that and also Spaces, Commas, Semi-Colons and Colons and Hyphens are valid characters too. Any help would be greatly appreciated as I am really stuck with this problem. Thanks, David

    Read the article

  • Fill feilds on website

    - by Ash
    Hi there, I am opening up web page from a link button. My issue is populating this web page with data that I need to be pre-populated in some of the fields on that web page. Can anyone please assist? Many thanks in advance

    Read the article

  • Is there a way to use a dictionary or xml in the Application Settings?

    - by Shimmy
    I have to store a complex type in the application settings. I thought that storing it as XML would work best. The problem is I don't know how store XML. I prefer to store it as a managed XML rather than using just a string of raw XML having to parse it on each access. I managed to set the Type column of the setting to XDocument, but I was unable to set its value. Is there a way to use XDocument or XML in application settings? Update I found a way, simply by editing the .settings file with the xml editor. I changed it to a custom serializable dictionary, but I get the following error when I try to access the setting-property (I set it to a serialized representation of the default value). The property 'Setting' could not be created from it's default value. Error message: There is an error in XML document (1, 41). Any ideas will be appreciated.

    Read the article

  • DataGridView formatting

    - by Vadim
    I have a DGV with columns "code" and "name". Depends of lenght of a code I want to add tabulation to the "name" cells, to show structure of a data. Like that in this picture: How is it better to do? I think there is a better way then just loop for all rows and add spaces in front of names, right?

    Read the article

  • An error occurred creating the form. See Exception.InnerException for details. The error is: Object

    - by Ben
    I get this error when attempting to debug my form, I cannot see where at all the error could be (also does not highlight where), anyone have any suggestions? An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object. Public Class Form1 Dim dateCrap As String = "Date:" Dim IPcrap As String = "Ip:" Dim pcCrap As String = "Computer:" Dim programCrap As String = "Program:" Dim textz As String = TextBox1.Text Dim sep() As String = {vbNewLine & vbNewLine} Dim sections() As String = Text.Split(sep, StringSplitOptions.None) Dim NewArray() As String = TextBox1.Text.Split(vbNewLine) Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click For i = 0 To sections.Count - 1 TextBox2.Text = sections(i) Dim text2 As String = TextBox2.Text Dim sep2() As String = {vbNewLine & vbNewLine} Dim sections2() As String = Text.Split(sep, StringSplitOptions.None) Dim FTPinfo() As String = TextBox2.Text.Split(vbNewLine) Dim clsRequest As System.Net.FtpWebRequest = _ DirectCast(System.Net.WebRequest.Create(sections2(0).Replace("Url/Host:", "")), System.Net.FtpWebRequest) clsRequest.Credentials = New System.Net.NetworkCredential(sections2(1).Replace("Login:", ""), (sections2(2).Replace("Password:", ""))) clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile ' read in file... Dim bFile() As Byte = System.IO.File.ReadAllBytes(txtShellDir.Text) ' upload file... Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() clsStream.Write(bFile, 0, bFile.Length) clsStream.Close() clsStream.Dispose() Next End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ListBox1.Items.Clear() Dim fdlg As OpenFileDialog = New OpenFileDialog() fdlg.Title = "Browse for the FTP List you wish to use." fdlg.InitialDirectory = Application.ExecutablePath fdlg.Filter = "All files (*.txt)|*.txt|txt files (*.txt)|*.txt" fdlg.FilterIndex = 2 fdlg.RestoreDirectory = True If fdlg.ShowDialog() = DialogResult.OK Then 'ListBox1.Items.AddRange(Split(My.Computer.FileSystem.ReadAllText(fdlg.FileName), vbNewLine)) TextBox1.Text = My.Computer.FileSystem.ReadAllText(fdlg.FileName) End If Dim tmp() As String = TextBox1.Text.Split(CChar(vbNewLine)) For Each line As String In tmp If line.Length > 1 Then TextBox1.AppendText(line & vbNewLine) End If Next TextBox1.Text = TextBox1.Text.Replace(" ", "") TextBox1.Text = TextBox1.Text.Replace("----------------------------------------------------------", vbNewLine) For Each item As String In NewArray ListBox1.Items.Add(item) Next Try For i = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i).Contains(dateCrap) Then ListBox1.Items.RemoveAt(i) End If Next Catch ex As Exception End Try Try For i = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i).Contains(IPcrap) Then ListBox1.Items.RemoveAt(i) End If Next Catch ex As Exception End Try Try For i = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i).Contains(pcCrap) Then ListBox1.Items.RemoveAt(i) End If Next Catch ex As Exception End Try Try For i = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i).Contains(programCrap) Then ListBox1.Items.RemoveAt(i) End If Next Catch ex As Exception End Try TextBox1.Text = "" For Each thing As Object In ListBox1.Items TextBox1.AppendText(thing.ToString & vbNewLine) Next End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) For i = 0 To ListBox1.SelectedItems.Count - 1 TextBox1.Text = TextBox1.Text & ListBox1.Items.Item(i).ToString() & vbNewLine Next End Sub End Class

    Read the article

  • List of objects to Excel Spreadsheet?

    - by Max Fraser
    Anyone know of some code out there that does this already? I have a bunch of pages with data grids on them in an admin website they want to export them to Excel, was hoping someone had this written already - or if not I'll post mine when I am done.

    Read the article

  • Typed DataSet connection - required to have one in the .xsd file?

    - by Kyralessa
    In the .xsd file for a typed DataSet in .NET, there's a <Connections> section that contains a list of any data connections I've used to set up the DataTables and TableAdapters. There are times when I'd prefer not to have those there. For instance, sometimes I prefer to pass in a connection string to a custom constructor and use that rather than look for one in settings, .config, etc. But it seems like if I remove the connection strings from that section (leaving it empty), or remove the section entirely, the DataSet code-generation tool freaks out. Whereas if I don't remove them, the DataSet gripes when I put it in a different project because it can't find the settings for those connection strings. Is there any way I can tell a typed DataSet not to worry about any connections? (Obviously I'll have to give it a connection if I change any TableAdapter SQL or stored procs, but that should be my problem.)

    Read the article

  • Special character into querystring .NET

    - by user353089
    I need to send the follow querystring: http://prod.intranet.siemens.com.br/drvs/index.aspx?page=2&pag=4&varpatch=%20C:\Documents%20and%20Settings\OPE253\My%20Documents\Ca$@#! Then i try to assing this to a string,but .NET break string at http://prod.intranet.siemens.com.br/drvs/index.aspx?page=2&pag=4&varpatch=%20C:\Documents%20and%20Settings\OPE253\My%20Documents\Ca$@ '#" do not appears in querystring Any ideas?

    Read the article

  • Adding to page control collection from inside a user control

    - by Zarigani
    I have an asp.net usercontrol which represents a "popup" dialog. Basically, it's a wrapper for the jQuery UI dialog which can be subclassed to easily make dialogs. As part of this control, I need to inject a div into the page the control is used on, either at the very top or very bottom of the form so that when the popup is instantiated, it's parent is changed to this div. This allows "nested" popups without the child popup being trapped inside the parent popup. The trouble is, I can't find a safe way to inject this div into the page. A usercontrol doesn't have a preinit event, so I can't do it there, and calling Page.Form.Controls.Add(...) in Init, Load or PreRender causes the standard exception "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases." I thought I had found a solution by using... ScriptManager.RegisterClientScriptBlock(Page, Me.GetType, UniqueID + "_Dialog_Div", containerDiv, False) ... which seemed to work well normally, but recently a coworker tried putting an UpdatePanel inside the dialog and now she's getting the error "The script tag registered for type 'ASP.controls_order_viewzips_ascx' and key 'ctl00$ContentBody$OViewZips_Dialog_Div' has invalid characters outside of the script tags: . Only properly formatted script tags can be registered." How are you supposed to add controls to the pages control collection from inside a user control?

    Read the article

  • "Invalid Object Format Name" in Crystal Reports

    - by cmays90
    When working with Crystal Report Field Objects and attempting to set "EnableSuppress" to False or alter the position or width of a field object is generating an "Invalid Object Format Name" error. The debugger shows all my code running without error until attempting to actually load the report. At that point, it will run the first couple without problem, then it fails when messing with a field object, and none of the rest will run. The code is shown below. Everything that generates an error is a FieldObject, but not all fieldObjects generate errors. In the code below, everything in Section2 is a TextObject and everything in Section3 is a FieldObject. If condition = True Then 'Lines marked as runs ok, only run when a line that generates an error is not present before it. Report.Section2.ReportObjects("Text7").Left = 7830 'Runs ok Report.Section3.ReportObjects("Field4").Left = 8085 'Runs ok Report.Section2.ReportObjects("Text13").ObjectFormat.EnableSuppress = False 'Runs ok Report.Section3.ReportObjects("Field28").ObjectFormat.EnableSuppress = False 'error Report.Section2.ReportObjects("Text9").Left = 10830 'Runs ok Report.Section3.ReportObjects("Field23").Left = 10830 'error Report.Section3.ReportObjects("Field23").Width = 615 'error Report.Section2.ReportObjects("Text10").Left = 11445 'Runs ok Report.Section3.ReportObjects("Field25").Left = 11445 'Runs ok End If

    Read the article

  • How can I tell when the Text of a System.Windows.Forms.GroupBox wraps to the next line?

    - by fre0n
    I'm creating a GroupBox at runtime and setting its Text property. Usually, the text is only on one line, but sometimes it wraps. The problem is that the controls contained in the GroupBox cover up the GroupBox's text. What I'd like to do is determine if and when the text wraps. Specifically, I'd like to determine how much extra height the wrapped text takes up as compared to a single line. That way, I can reposition the GroupBox's controls and adjust its height. Initially, I thought I'd do this by calling the GroupBox's CreateGraphics() method, and using the Graphics to measure the string. Something like this: private void SetGroupBoxText(GroupBox grp, string text) { const int somePadding = 10; Graphics g = grp.CreateGraphics(); SizeF textSize = g.MeasureString(text, grp.Font); if (textSize.Width > (grp.Width - somePadding)) { // Adjust height, etc. } } The problem is that the size generated by g.MeasureString(text, grp.Font) doesn't seem to be accurate. I determined that it wasn't accurate by putting enough of a single character to cause a wrap, then measuring the resulting string. For example, it took 86 pipes (|) to until a wrap happened. When I measured that string, its width was ~253. And it took 16 capital W's to force a wrap - its string had a width of ~164. These were the two extremes that I tested. My GroupBox's width was 189. (a's took 29 and had a width of ~180, O's took 22 and had a width of ~189) Does anyone have any ideas? (hacks, WinAPI, etc. are welcome solutions)

    Read the article

  • getting string.substring(N) not to choke when N > string.length

    - by aape
    I'm writing some code that takes a report from the mainframe and converts it to a spreadsheet. They can't edit the code on the MF to give me a delimited file, so I'm stuck dealing with it as fixed width. It's working okay now, but I need to get it more stable before I release it for testing. My problem is that in any given line of data, say it could have three columns of numbers, each five chars wide at positions 10, 16, and 22. If on this one particular row, there's no data for the last two cols, it won't be padded with spaces; rather, the length of the string will be only 14. So, I can't just blindly have dim s as string = someStream.readline a = s.substring(10, 5) b = s.substring(16, 5) c = s.substring(22, 5) because it'll choke when it substrings past the length of the string. I know I could test the length of the string before processing each row, and I have automated the filling of some of the vsariables using a counter and a loop, and using the counter*theWidthOfTheGivenVariable to jump around, but this project was a dog to start with (come on! turning a report into a spreadsheet?), but there are many different types of rows (it's not just a grid), and the code's getting ugly fast. I'd like this to be clean, clear, and maintainable for the poor sucker that gets this after me. If it matters, here's my code so far (it's really crufty at the moment). You can see some of my/its idiocy in the processSection#data subs So, I'm wondering 1) is there a way baked in to .NET to have string.substring not error when reading past the end of a string without wrapping it in a try...catch? and 2) would it be appropriate in this situation to write a new string class that inherits from string that has a more friendly substring function in it? ETA: Thanks for all the advice and knowledge everyone. I'll go with the extension. Hopefully one of these years, I'll get my chops up enough to pay someone back in kind. :)

    Read the article

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