Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Chaos Machine

@Chaos Machine
About
Posts
25
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Calculating the CPU usage of ONE process with VB.NET 2003
    C Chaos Machine

    Hello everybody, I have a big issue that I can't seem to be able to solve. I need to find a SINGLE CPU process (one program that I know the name of), and display it into a label. For example My_program ---> 20% I use (on a timer) Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total") ListBox1.Items.Add(CInt(m_PerformanceCounter.NextValue()) & "%") but I think I get ALL processes added up. I just want ONE of them for example (in pseudocode) if process.name = "My_program" then label1.text=process.CPUUsageTimeOfTHatProcess How can I do it with VB.NET? Any help will be much appreciated. Thank you in advance.

    Still trying to find the way

    Visual Basic help question csharp tutorial

  • SQL Update command with VB.NET
    C Chaos Machine

    The SQLString ends up looking like this: SQLString = "UPDATE tblIns SET Date= '21/12/05' WHERE Job_Number = '0909090' which looks like it's correct. But i still get an error message of "Syntax error". What am i doing wrong? Still trying to find the way

    Visual Basic database help question csharp

  • SQL Update command with VB.NET
    C Chaos Machine

    Hello everybody. I have a weird error message coming up every time i try to use the Update command with a access database. The message says that there is a syntax error with the SQL command. I search the Internet and the syntax of my command seems to be right. Here is the code: ============================================================================ Public Sub updateRecord(ByVal entryToChange As String, ByVal oldString As String, ByVal newString As String) Dim SQLString As String Dim strConnection As String = OleDbConnection1.ConnectionString Dim objTransaction As OleDbTransaction Dim connect As New OleDbConnection(strConnection) SQLString = "UPDATE tblIns SET " & entryToChange & " = '" & newString & "' WHERE Ins = '" & oldString & "'" Dim cmd As New OleDbCommand(SQLString, connect) connect.Open() Try cmd.ExecuteNonQuery() Catch ex As Exception MsgBox(ex.ToString) End Try connect.Close() connect.Dispose() Me.Close() End Sub ============================================================================ I have a value that changes (newString) and a value that i know it's the same (oldString). entryToChange is the entry that i'm trying to change (eg Date, or FirstName etc) So basicly i'm trying to change a value of a record where the oldString stays the same. But i get the error "Syntax error with UPDATE command". What is going on? And is there a way to update a record when the entry that is changing is not the same all the time? Meaning in one record the first name may change and all other entries (eg last name, address etc) stays the same, in the other the last name may change and the rest of the entries will stay the same. In VB6 i used to use something like: ============================================================== DatIns.Recordset.Edit DatIns.Recordset.Fields("Date").Value = lbldate.Caption ============================================================== but in vb.NET i can't find something like this. Thank you for your help, and Merry Christmas to all. Still trying to find the way -- modified at 18:27 Tuesday 20th December, 2005

    Visual Basic database help question csharp

  • Hidding a Console window from Task Manager
    C Chaos Machine

    KaptinKrunch, I forgot to mention that i have the Standard version of VB.NET and it doesn't make programs as services. I am tinkering with an Application Console, but i can't hide it from the Task Manager. I have heard that you can do that. But how?????? Thank you though for your input. Still trying to find the way

    Visual Basic question csharp

  • Hidding a Console window from Task Manager
    C Chaos Machine

    Hello everybody. One small question: How can i make a console window not to be visible and hide it from Task manager. I am trying to make a program that it's not visible to the users and since app.Taskvisible is not supported in vb.net, i need to create a console application to bypass this. Thank you. Still trying to find the way

    Visual Basic question csharp

  • Trying to find the usage of the CPU
    C Chaos Machine

    Hello everybody. I'm trying to get the percentage of the CPU Usage. So far I have the following code: Dim query1 As New ManagementObjectSearcher("SELECT * From Win32_Processor") Dim moa1 As ManagementObject Dim tempa1 As Long For Each moa1 In query1.Get() tempa1 = Long.Parse(moa1("LoadPercentage").ToString()) Label3.Text = tempa1 Next When I debug with a break point and leave the mouse pointer over the label3.text I get the value of the percentange, but when i run the program without a break point the program seams for ever thinking without giving me the value. I have a timer that runs every second to update the query. What am I doing wrong? Thank you. Still trying to find the way

    Visual Basic database debugging question announcement

  • Deleting an entry in datagrid
    C Chaos Machine

    Hello everybody. I have the following problem. I can connect to a database with a datagrid and display all records. But when i go to delete one it doesn't do it. Code for populating datagrid Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb" Dim myConnection As OleDbConnection = New OleDbConnection myConnection.ConnectionString = connString Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from tblDevices", myConnection) Dim ds As DataSet = New DataSet da.Fill(ds, "tblDevices") Dim dv As DataView = ds.Tables("tblDevices").DefaultView DataGrid1.DataSource = dv code for deleting Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb" Dim myConnection As OleDbConnection = New OleDbConnection Dim cmd As OleDbCommand myConnection.ConnectionString = connString myConnection.Open() Dim mySelectText As String = "Select * from tblDevices" Dim myDataAdapter As New OleDbDataAdapter(mySelectText, myConnection) myDataAdapter.DeleteCommand = New OleDbCommand("DELETE FROM tblDevices WHERE Item= '" & tempDevice & "' AND Booked= '" & txtBookedBy.Text & "' AND Date= '" & txtDate.Text & "' AND Time= '" & txtTime.Text & " '", myDataAdapter.SelectCommand.Connection) myConnection.Close() What am i doing wrong? :wtf: Still trying to find the way

    Visual Basic database help question

  • SMART with VB.NET
    C Chaos Machine

    Hello everybody. Does any one knows how we can use S.M.A.R.T. technology with vb.net? I am trying to write a small program to monitor my HDD temperature. I know that there are programs out there but it would be cool if i could write one for myself. Any help will be much appreciated. Thank you. Still trying to find the way

    Visual Basic csharp help question

  • Administrator's fault?
    C Chaos Machine

    I had a look to that web site, and i was laughing my head of! People i guess thought that i lost the plot! It's true. Imaging I have made an intranet page that describes most of the company's operations. And yet when i ask them have you checked the page, the answer is "page what?". How simpler can you get?!! :confused: If i had my way, all computers would be of Win XP with NTFS and limited accounts. But...... So I'm trying my best with what i have. Sometimes though i do turn into that crazy-eye monster that turns red and shouts. Alas, deaf ears don't hear! :(( Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    :laugh::laugh::laugh: This is so cool! I should do it. Thanks David! Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    :laugh: So true, so true. But on the other hand, no users no Administrators!! Can you start yelling at them? Pretend to be Arhnold and start 'Terminating' accounts? Turn red? What a naive Administrator to do? Help!!:doh::wtf: Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    Thank God the server is Linux, and none of the users can operate that! :laugh: Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    That I know. How can you stop users to fiddle around when you a) don't have the resources and b) users think they know better. "Oh OK i have win 98. Hmm dodgySoftware.exe. Yes sound great. Let me install it" "What i have a problem with the registry? What happend? Help Administrator, can you fix it. It will take 10 mins? Hey listen I don't have time to loose OK? Now do your job and fix it in 2 mins" :laugh: Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    Ahaaa! And what happens in the case that someone pulls out that blue cable from the wall. You know, that cable that says CAT 5 with small black letters on it? Oops! The network is down! Hmmm who's to blame? :laugh: Still trying to find the way

    The Lounge help question discussion career

  • Administrator's fault?
    C Chaos Machine

    In this big computing world that we live, two factions exist. Users and Administrators. Both are having complains about the other. In my case I'm managing a fair number of computers and peripherals at my work. I’m trying to do a good job and be on top of it all, but I have really big problems when users do not follow simple instructions, and when things go wrong you guessed it, the administrator is to blame. So what do you think? Is it always the administrator’s fault, or is it of the users? Please help to make this computerized world we live and work a better place.. (Violins and romantic music on the background):laugh: Still trying to find the way

    The Lounge help question discussion career

  • Word Wrapping with Draw String
    C Chaos Machine

    Thank you Christian. I used Dim LayoutRen As RectangleF = New RectangleF(0, 90, 100, 300) e.Graphics.DrawString(drawString, drawFont1, drawBrush, LayoutRen) and it work like a charm. Thank again! :-D Still trying to find the way

    Visual Basic question graphics help

  • Word Wrapping with Draw String
    C Chaos Machine

    Hello everybody. I'm trying to make the contents of a textbox, if they don't fit in a page to wrap and use the line underneath etc etc. So far i can clip the string in the given rectangle i have indicate with the setclip command. Other than that i can't make it work. Here is a part of the code: 'Create string to draw. Dim drawString As String = txtComment.Text Dim drawString1 As String = imageToLoad Dim drawFont As New Font("Arial", 0.4, FontStyle.Regular, GraphicsUnit.Millimeter) Dim drawFont1 As New Font("Arial", 0.6, FontStyle.Regular, GraphicsUnit.Millimeter) Dim drawBrush As New SolidBrush(Color.Black) ' print filename Dim drawPoint As New PointF(0.0F, -27.0F) 'print comments Dim drawPoint1 As New PointF(0.0F, 90.0F) If chkComment.Checked = True Then e.Graphics.SetClip(New Rectangle(0, 0, 100, 100)) e.Graphics.DrawString(drawString, drawFont1, drawBrush, drawPoint1) End If e.Graphics.DrawString(drawString1, drawFont, drawBrush, drawPoint) ' There are no more pages. e.HasMorePages = False The textbox in question is the txtComment.Text. Any help please? Thank you :) Still trying to find the way

    Visual Basic question graphics help

  • Columns in a string in VB.NET
    C Chaos Machine

    Hello everybody. I am trying to create a string which will have spaces in between words that create "columns". In vb6 i used to use tab(). EG string 3 = string1 & tab(5) & string2 and i would have the following: areaName PostCode Suburb test 125 the suburb test2 225 another suburb so when i use the print command to have it in columns. How to i do that in vb.net. Thank you in advance. Still trying to find the way

    Visual Basic csharp tutorial

  • Database access through VB.Net
    C Chaos Machine

    Hello CJ. Ok i am new too in vb.net and i had such a problem to find a solution with Access and VB.NET. BUT i found the answer that you are looking for too. Here it is: ************************* Searching in a database: Dim strConnection As String = OleDbConnection1.ConnectionString (the connectionString will be a string created from the VB when you specify where your database is) Dim connect As New OleDbConnection(strConnection) Dim test As String Dim te As String Dim SQLString As String connect.Open() te = txtAreaToSearch.Text SQLString = "SELECT * from informations WHERE Area =" & "'" & te & "'" Dim cmd As New OleDbCommand(SQLString, connect) Dim reader As OleDbDataReader = cmd.ExecuteReader() While reader.Read() txtCouncilName.Text = reader.GetValue(1) 'gets the value of the first attribute in your databse eg postCodeOfTheArea End While reader.Close() connect.Close() In this example you will need a OleDbConnection1 and a OdbcCommand1 objects. Also the following must be put at the start : Imports System Imports System.Data Imports System.Data.OleDb What the example does is to search in a database on the TABLE informations for an AREA with the name that is in a TEXTBOX called txtAreaToSearch. ********************************** Deleting an entry Dim SQLStringUpdateKeys As String Dim SQLStringUpdateArea As String Dim icount As Integer Dim icount1 As Integer Dim strConnection As String = OleDbConnection1.ConnectionString Dim connect As New OleDbConnection(strConnection) Dim inputOption As Integer inputOption = MsgBox("Are you sure you want to delete this record", MsgBoxStyle.OKCancel, "Are you sure?") If inputOption = 1 Then connect.Open() On Error Resume Next SQLStringUpdateArea = "DELETE FROM informations WHERE Area = '" & txtAreaName.Text & "'" Dim cmd1 As New OleDbCommand(SQLStringUpdateArea, connect) icount1 = cmd1.ExecuteNonQuery connect.Close() MessageBox.Show("Records Deleted in table: " & icount1) Else Exit Sub End If ************************* inserting a new entry Dim SQLStringUpdateKeys As String Dim SQLStringUpdateArea As String Dim icount As Integer Dim icount1 As Integer Dim strC

    Visual Basic database csharp help announcement

  • Data from two tables
    C Chaos Machine

    Thank you J4amieC it worked!!! Thank you so much. Now i have to expand this so when i have two areas with the same keyword a list is populated. Hmmm lets see if i can do it!! LOL Thank you again for your help...:-D Still trying to find the way

    Visual Basic database help question career
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups