476 Posted Topics
Re: Here you first call the ReadFile method and do a bunch of things. So far so good. [CODE] calc.ReadFile(nameOfAccount, listDisplay) txtBalance.Text = FormatCurrency(calc.Balance) [/CODE] However in the ReadFile method I noticed something. [CODE] Sub ReadFile(ByVal NameofAccount As String, ByRef listDisplay As ListBox) Dim fmtStr As String = "{0,-10} {1,-30}{2,20:c} {3, … | |
Re: [QUOTE=stanleymakori;1176557]am developing software using sql database. i want an sql statement that can enable me retrieve data which for example has same surname,save them in an array or dataset and navigate through them.[/QUOTE] [CODE] Private ds As DataSet = Nothing Private Function CollectData() As Boolean Dim con As New SqlConnection("connectionstring") … | |
Re: You can use the My namespace. [ICODE]My.Computer.Name[/ICODE] This will get the name of the computer currently running your program. | |
Re: Have a look at this discussion: [URL="http://www.vbforums.com/showthread.php?t=358556"]http://www.vbforums.com/showthread.php?t=358556[/URL] | |
Re: Instead of CheckState, try using the property Checked. This will trigger the checkBox16_CheckedChanged event. [CODE] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ListBox1.Items.Add(ListBox1.Items.Count) [COLOR="Red"] If ListBox1.Items.Count > 5 Then checkBox16.Checked = True Else checkBox16.Checked = False End If[/COLOR] End Sub [/CODE] | |
Re: Try this: First, add a webservice your website with a method to read directory content and also a method to read a selected file into a byte array. Second, use that webservice in your window app in order to 1) display directorycontent in a listbox/combobox and 2) retrieve the byte … | |
Re: Try this: [CODE] Dim stream As System.IO.FileStream = New System.IO.FileStream(<string path to ini file>, System.IO.FileMode.Open) Dim treader As System.IO.TextReader = New System.IO.StreamReader(stream) Dim line As String While treader.Peek > 0 line = treader.ReadLine '' Add some checking to see if line should be added to the ListBox listbox1.Items.Add(line) End While … | |
Re: [QUOTE]How can i make, that program will name .txt file like "29.3.20010.txt"?[/QUOTE] Try this: (FileMode.Append will open the file if it exists and continue writing at the end, or create a new file.) [CODE] Dim fileName As String = DateTime.Now.ToString("dd.M.yyyy") Dim file As System.IO.FileStream = New System.IO.FileStream ("C:\Key\" & fileName … | |
Re: From what I can see of your IF statement is that no matter what tempckL is, you always set your labels to the same thing. So what do you need either IF statements or loops for? Although, perhaps you should consider a small IF statement. [CODE] If tempckL > 0 … | |
Re: Look into Facebook Connect. According to FaceBook you can use the Facebook Connect API in desktop applications. [URL="http://wiki.developers.facebook.com/index.php/Facebook_Connect"]http://wiki.developers.facebook.com/index.php/Facebook_Connect[/URL] [URL="http://wiki.developers.facebook.com/index.php/Desktop_Application"]http://wiki.developers.facebook.com/index.php/Desktop_Application[/URL] [URL="http://forum.developers.facebook.com/viewforum.php?id=10"]http://forum.developers.facebook.com/viewforum.php?id=10[/URL] | |
Re: Have you tried using [ICODE]ds_test.AcceptChanges()[/ICODE] before updating the database? Sometimes you need to commit the changes to the dataset before sending it's updated state back to the database. | |
Re: Take a look at this: [URL="http://www.knowdotnet.com/articles/printform.html"]http://www.knowdotnet.com/articles/printform.html[/URL] | |
Re: Perform ALT + <menu shortcut> so that the menu appears. Then, while still holding down the ALT key, press PrintScreen. | |
Re: Loop through the Kalkyle1DataSet.Tables("Ordre").Rows collection until you find the row containg the foreign key you are looking for. Then you can use the method Remove to remove the row from the table. Note that I've chosen to run the loop backwards in order to maintain the zero-based collection. [CODE] Dim … | |
Re: Take a look at this discussion: [URL="http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/1bef2612-6820-4ddd-bb64-087d0bc9d93d"]http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/1bef2612-6820-4ddd-bb64-087d0bc9d93d[/URL] | |
Re: Move the declaration of the variable [ICODE]Dim numRowsFilled As Integer[/ICODE] outside the Form_Load event and make it Private, thus making it a class variable. Then it will be available from any event or method only within the class. | |
Re: I was thinking, for your first problem. Because you use a three space divider between the values from the database for each item in the listbox. Couldn't you use that piece of knowledge for startindex and length in the SubString method? That way, these values will always be dynamic. [CODE] … | |
Re: In your SELECT query you need to also extract the record ID and use that in a WHERE-clause for your UPDATE query. [ICODE]UPDATE TableName set col1=@p1,col2=@p2 where col3=@p3 WHERE RecordID = <some_number>[/ICODE] | |
Re: Well. This line [ICODE]STRTotal = STRFinValue + +(STRFinValue)[/ICODE] basically says that during the iteration STRTotel is always going to be [ICODE]2 = 1 + 1[/ICODE]. If you want STRTotal to change then STRFinValue needs to change inside the iteration. Or do this: [ICODE]STRTotal += (STRFinValue + STRFinValue)[/ICODE]. This will allow … | |
Re: Instead of [ICODE]String.Format(...)[/ICODE] have you tried [ICODE]DateTime.Now.ToString("<date format string>")[/ICODE]. Where <date format string> can be any combination of [URL="http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx"]date and time formats[/URL]. Or perhaps something dirty like this? [CODE] Text= <%# Bind(CReviewDate) %> Text= DateTime.Parse(Text).ToString("yyyy-MM-dd") [/CODE] | |
Re: I would go with the Server-Client method and use UDP-streaming. Further I would consider passing an XML-string back and forth through the UDP-stream. An XML-string is quite small and UDP is perfect for this type of networking. The game Quake III Arena uses this technique and it has a bit … | |
Re: Do some string manipulation and look for the attribute "target" and/or "onclick=javascript:window.open". If found, remove them from the url string before navigating. | |
Re: If your listbox already contains items then this should work: [CODE] For i As Integer = 0 To lstBox.Items.Count - 1 lstBox.Items(i) = lstBox.Items(i) & "'" Next [/CODE] Or if you need to add ' while adding items then this is the way to go: [CODE] lstBox.Items.Add(<some source> & "'") … | |
Re: Try this: [CODE=vbnet] Try If listbox1.Items.Count > 0 Then If listbox1.SelectedIndices.Count > 0 Then For Each index As Integer In listbox1.SelectedIndices listbox1.Items.RemoveAt(index) Next End If Else End If Catch ex As Exception MsgBox(ex.Message) End Try[/CODE] | |
Re: Add the parts in red. [code]Public Class ItunesKiller Private Sub AddButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddButton.Click For Each line As String In SongTextBox.Lines SongComboBox.Items.Add(line) Next End Sub [COLOR="Red"] Private Sub SongComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SongComboBox.SelectedIndexChanged TextBoxOnTop.Text = SongComboBox.SelectedItem End Sub[/COLOR] Private … | |
Re: Here is what you can do. First, change the name of the labels that you want to be able to change background color into something that's easy to monitor, like lblBg1, lblBg2 etc... When that's done you can use adaposts code for looping through the controls. [CODE] .... For Each … | |
Re: Do this instead: [CODE]Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click Dim conn As New OleDbConnection("<connection string>") Try If txtUserName.Text <> "" Then Dim SQL As String = "UPDATE addresses SET PinCode= '" & txtPinCode.Text & "' , " & _ "Occupation= '" & txtOccupation.Text & … | |
Re: Here it is in VB.NET. Remember to change all *** into YOUR data source, username and password. [CODE] Private Sub btnInsert_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnInsert.Click Dim InsertQuery As String = String.Empty Dim con1 As SqlConnection = New SqlConnection("Data Source=***;Initial Catalog=master; Persist Security Info=True; User ID=***; … | |
Re: Examine the links at the bottom on this page: [URL="http://en.wikipedia.org/wiki/Honeypot_(computing)"]http://en.wikipedia.org/wiki/Honeypot_(computing)[/URL] | |
Re: Try this: [code] Private Sub DtpDefault_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DtpDefault.ValueChanged Call Connection() Dim s As String = Month(Now) Dim d As Date = Date.Now dsLogin = New DataSet("GymDatDataSet") daLogin = New OleDb.OleDbDataAdapter("Select * from fec where Mnth=Month(now) AND EndDt<'" & [COLOR="Red"]DtpDefault.Value.ToString("yyyy-MM-dd")[/COLOR] & "'", con) daLogin.Fill(dsLogin, … | |
Re: Try this in the command buttons click event: [CODE] Private buttonClickIndex As Integer = 0 Private Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs) If buttonClickIndex = 0 Then label1.Text = "hello" buttonClickIndex = 1 ElseIf buttonClickIndex = 1 label1.Text = "bye" buttonClickIndex = 2 ElseIf buttonClickIndex = 2 … | |
Re: If you use a DataReader then the answer is quite easy. The reader has a property called HasRows that indicates whether or not the database query was successful, or not. Put the code for opening the form inside an [ICODE]If DataReader1.HasRows = True Then[/ICODE] statement, and the code for displaying … | |
Re: One difference between C and VB is that C is case-sensitive, which means that variables can have the same name as properties as long as they differ in how you write them: int a_var is not the same as int A_var. With that in mind, notice that the [U]variables[/U] are … | |
Re: Move the line [ICODE]Dim newOrdreRow As DataRow = Kalkyle1DataSet.Tables("Ordre").NewRow()[/ICODE] so that it's inside the third iteration, just above the line [ICODE]newOrdreRow("OrdreID") = MaxID[/ICODE] ([COLOR="Red"]this is for fixing the error message[/COLOR]). And add the line [ICODE]Kalkyle1DataSet.AcceptChanges()[/ICODE] just after the iteratation. Also, if OrdreID is the unique identifier you need to increment … | |
Re: I would do this instead in the Timer_Tick event: [CODE] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If ProgressBar1.Value >= ProgressBar1.Maximum Then ProgressBar1.Value = ProgressBar1.Minimum Timer1.Enabled = False Else ProgressBar1.Increment(2) '' Notice the difference? If ProgressBar1.Value >= ProgressBar1.Maximum Then ProgressBar1.Value = ProgressBar1.Maximum Timer1.Enabled = False … | |
Re: Add a field in the MS Access database table called "Deleted" or something like it with a datatype of Boolean. And then add a WHERE-clause in the database query to populate the listbox. [ICODE] SELECT * FROM <table> WHERE Deleted = 0 [/ICODE] | |
Re: In what context? Is this a Windows application? What have you tried so far? A datagrid in a windows form can for example be bound to a DataSet or a DataView. Here are some examples for you to try: [URL="http://msdn.microsoft.com/en-us/library/aa984294(VS.71).aspx"]http://forums.asp.net/t/1524693.aspx[/URL] [URL="http://msdn.microsoft.com/en-us/library/aa984294(VS.71).aspx"]http://msdn.microsoft.com/en-us/library/aa984294(VS.71).aspx[/URL] All you have to do is put the code … | |
Re: What were you planning to put in your textboxes? As you said, the method ConversionRate takes two numeric arguments representing each country. | |
Re: You might wanna have a look at the ClientID property. ASP.NET adds the container ID to the ID of a control in the container but ClientID is always the ID you gave the control. | |
Re: Change this [CODE]SelectCommand="SELECT date_of_arr, date_of_dept, DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (date_of_arr = @date_of_arr)">[/CODE] Into this [CODE]SelectCommand="SELECT CONVERT(DateTime,date_of_arr,103), CONVERT(DateTime,date_of_dept,103), DATEDIFF(dd, date_of_arr, date_of_dept) AS DAYS FROM guesthouse WHERE (CONVERT(DateTime,date_of_arr,103) = @date_of_arr)">[/CODE] Notice the CONVERT functions. The CONVERT function takes 2-3 arguments. 1: The target datatype of the field 2: … | |
Re: Try this (add the red part): [code] <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" Style="z-index: 103; left: 288px; position: absolute; top: 256px" AutoGenerateColumns="False"> <RowStyle BackColor="White" ForeColor="#330099" /> <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" /> <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" /> <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" /> <Columns> <asp:BoundField … | |
Re: Have you tried creating a Webservice as an intermediate between your site and the dB-server? Perhaps that will eliminate the problem. | |
Re: The easiast way to increment a number by 1 is to do it directly in the SQL-query. For example: [ICODE]UPDATE table1 SET serialnumber = serialnumber + 1 WHERE id = <id>[/ICODE] | |
Re: I can't see why it would'nt work. Compare with one of my methods for clearing all labels. [CODE]private void ClearAll(Control parent) { foreach (Control ctl in parent.Controls) { if (ctl is Label) { if (((Label)ctl).Text == "a") ((Label)ctl).Text = ""; } if (ctl.HasControls) ClearAll(ctl); } }[/CODE] However, have you considered … | |
I'm not entirely sure if this thread belongs here, or in "JavaScript / DHTML / AJAX". Anyway. I have a bit of a problem here, hoping that a kind soul might be able to help. On one of the webpages for the site I'm developing I have a bunch of … | |
Re: Have you tried googling for the answer? Take a look at this: [URL="http://social.msdn.microsoft.com/forums/en/vbgeneral/thread/88a6ea68-f476-4231-822f-27fabe59f458"]http://social.msdn.microsoft.com/forums/en/vbgeneral/thread/88a6ea68-f476-4231-822f-27fabe59f458[/URL] | |
Re: [QUOTE=devji;1081578]My first question is, will I need any form of source code? i.e. do you need you compile .NET code before you can deploy an application?[/QUOTE] Yes and no, you do need the sourcecode for recompilation. And also in order to fix the second question. However, you don't need the … | |
Re: Perhaps if you change this `e.Day.Date` into this `e.Day.Date.ToString("dd/MM/yyyy")` Otherwise you may have to complicate things by going into localization, but then your in the hands of the visitor and their local computersettings. | |
Re: If you have a database table with predefined usernames and passwords, then all you have to do is add a numeric field called "isonline" or something. When the user logs on you set that field to 1 and when the user leaves your site you simply set it to 0. … | |
Re: With MS Access you can create links to tables in another MS Access database, and then create an update query that updates the local tables with information from the linked tables. Then assign that query to a button. I believe you can also enforce a readonly restriction on those links. |
The End.