rapture 134 Posting Whiz in Training

great!

bajanpoet commented: great help! Stuck with all my fumbles and mistakes till I figured out how to get my code to work. +3
rapture 134 Posting Whiz in Training

And I know that others are reading this, help us out here lol

rapture 134 Posting Whiz in Training

Try replacing:

dgCustomers.DataSource = ds.DefaultViewManager

with

dgCustomers.DataSource = r
dgCustomers.DataBind()

....

rapture 134 Posting Whiz in Training

Here is the code I've worked with on page load

'import sql server connection namespace
Imports System.Data.SqlClient
Public Class WebForm1
    Inherits System.Web.UI.Page
    'inherit sql server client



    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

        Dim conITRequest As SqlConnection
        Dim cmdSelect As SqlCommand
        Dim dtrRequests As SqlDataReader
        lblError.Text = ""
        Try
            'Create new connection object
            conITRequest = New SqlConnection
            'define connection string to connect to database
            conITRequest.ConnectionString = "Server=SERVERNAME;UID=ITRequestUser;PWD=PASSWORD;Database=ITRequest"
            'create command object to get data from database
            cmdSelect = New SqlCommand
            'populate command text for command to issue
            cmdSelect.CommandText = "select RequestID, RequestUser ,  RequestDate , RequestName , PriorityID , DateDue , StatusID , PercentComplete , AssignedUser, ClosedDate , TimeSpent from Request"
            'assign connection to Command Object
            cmdSelect.Connection = conITRequest
            'open database connection
            conITRequest.Open()
            'get data from database using command object into a datareader
            dtrRequests = cmdSelect.ExecuteReader()
            'set datasource on grid - this associates the datasource with the grid
            dgrdRequest.DataSource = dtrRequests
            'bind to datagrid - the databind function is what actually ties the data to the grid
            dgrdRequest.DataBind()
        Catch ex As Exception
            lblError.Text = ex.Message
        Finally
            conITRequest.Close()
        End Try

    End Sub

End Class
rapture 134 Posting Whiz in Training

Again, I'm newer to programming so forgive me if I ask a dumb question. First of all, let me apologize as to not seeing that you were using sqlAdapter instead of oleDbDataAdapter. Now, you do have the database connection string formatted properly somewhere right?

(just in case, here is some sample code for the sqlAdapter)

Private Const SELECT_STRING As String = _
    "SELECT * FROM Contacts ORDER BY LastName, FirstName"
Private Const CONNECT_STRING As String = _
    "Data Source=Bender\NETSDK;Initial " & _
        "Catalog=Contacts;User Id=sa"

' The DataSet that holds the data.
Private m_DataSet As DataSet

' Load the data.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As _
    System.EventArgs) Handles MyBase.Load
    Dim data_adapter As SqlDataAdapter

    ' Create the SqlDataAdapter.
    data_adapter = New SqlDataAdapter(SELECT_STRING, _
        CONNECT_STRING)

    ' Map Table to Contacts.
    data_adapter.TableMappings.Add("Table", "Contacts")

    ' Fill the DataSet.
    m_DataSet = New DataSet()
    data_adapter.Fill(m_DataSet)

    ' Bind the DataGrid control to the Contacts DataTable.
    dgContacts.SetDataBinding(m_DataSet, "Contacts")
End Sub

* from http://www.vb-helper.com/howto_net_datagrid.html

rapture 134 Posting Whiz in Training

Did you happen to see this code in your searching?

Imports System.Data
Imports System.Data.OleDb
' some code here
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' create a connection string
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Northwind.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
' create a data adapter
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Customers", myConnection)
' create a new dataset
Dim ds As DataSet = New DataSet
' fill dataset
da.Fill(ds, "Customers")
' write dataset contents to an xml file by calling WriteXml method
' Attach DataSet to DataGrid
DataGrid1.DataSource = ds.DefaultViewManager
End Sub
End Class

*taken from http://www.vbdotnetheaven.com/UploadFile/mahesh/DataGridSamp04232005050133AM/DataGridSamp.aspx

rapture 134 Posting Whiz in Training

Try searching this site or google for Final Project or Final Project Ideas

rapture 134 Posting Whiz in Training

Do you bind the data to the datagrid somewhere? I'm newer but have successfully used the datagrid on a previous project. (Although I used a stored procedure to make the SQL call)

I do know I had to bind the info to the datagrid . . .
I actually think it was this thread that got me on the binding
http://www.daniweb.com/forums/thread10004.html

rapture 134 Posting Whiz in Training

Hello, I need help on this project for school.
My instructions are "Write a program called OfficeAreaCalculator.java that displays the following prompts using two label components:

Enter the length of the office:
Enter the width of the office:

Have your program accept the user input in two text fields. When a button is clicked, your program should calculate the area of the office and display the area in a text field. This display should be cleared whenever the input text fields receive the focus. A second button should be provided to terminate the application (Exit button)."

and here is my code

/**
 * 
 */
package officeAreaCalculator;

import java.text.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
/**
 * @author Kevin
 *
 */
public class OfficeAreaCalculator extends JFrame {
	private JFrame mainFrame;
	private JButton calculateButton;
	private JButton exitButton;
	private JTextField lengthField;
	private JTextField widthField;
	private JTextField areaField;
	private JLabel lengthLabel;
	private JLabel widthLabel;
	private JLabel areaLabel;
	private ActionListener chandler;
	private ActionListener ehandler;
	
	
	
	
	/**
	 * 
	 */
	public OfficeAreaCalculator() {
		mainFrame = new JFrame("Office Area Calculator");
		
		calculateButton = new JButton("Calculate area");
		exitButton = new JButton("Exit");
		lengthLabel = new JLabel("Enter the length of the office:");
		widthLabel = new JLabel("Enter the width of the office:");
		areaLabel = new JLabel("Office area:");
		lengthField = new JTextField(5);
		widthField = new JTextField(5);
		areaField = new JTextField(5);
		
		Container c = mainFrame.getContentPane();
		
		c.setLayout(new FlowLayout());
		
		c.add(lengthLabel);
		c.add(lengthField);
		c.add(widthLabel);
		c.add(widthField);
		c.add(areaLabel);
		c.add(areaField);
		c.add(calculateButton);
		c.add(exitButton);
		
		calculateButton.setMnemonic('C');
		exitButton.setMnemonic('x');
		
		mainFrame.setSize(250,150);
		
		mainFrame.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent e) {System.exit(0);}
		});
		
		calculateButtonHandler.chandler = new …
rapture 134 Posting Whiz in Training

I've not used this stuff but I did find a few here:

http://www.vclcomponents.com/catalog/Documentation

again, I have no real recommendation on them. I was searching things like

open source Doc-O-Matic

rapture 134 Posting Whiz in Training

You should have enough to get started - go ahead and mark this as solved

rapture 134 Posting Whiz in Training

you can also use the required field validators in the toolbox

regardless this thread should be marked as solved

rapture 134 Posting Whiz in Training

some other free tutorials
http://www.homeandlearn.co.uk/NET/vbNET.html

the only way to start is to start reading and messing with some of this stuff yourself. you can get visual studio for free if you don't have it which is great for beginning.

You get the express editions

http://www.microsoft.com/Express/

Ramy Mahrous commented: Helps well! +6
rapture 134 Posting Whiz in Training

yara - this is clearly the answer, can you try and mark as solved?

rapture 134 Posting Whiz in Training

** I was just trying to figure out if you had an assignment and chose access when you needed something else.

Since it's not possible for what you wanted to do can you go ahead and mark it as solved now for others?

rapture 134 Posting Whiz in Training

I guess you're right, sometimes it's like throwing darts a board to answer a thred. :)

rapture 134 Posting Whiz in Training

Ramy's code fixed the problem?

rapture 134 Posting Whiz in Training
rapture 134 Posting Whiz in Training

Look at what's available in System.Date

rapture 134 Posting Whiz in Training

acxes are you getting instructions from a professor to do this or are you trying to do it on your own

rapture 134 Posting Whiz in Training

RamyMahrous,

I know that will run it from visual studio but he wants to publish it to run outside visual studio right?
Will that still work or will he need to click build and then publish?

rapture 134 Posting Whiz in Training

let us know if you get stuck, you might also try the SQL thread.

If you fix it let us know that as well and mark the thread as solved when you do get it.

to do code tags in the future its [] with code in the middle at the start and /code in the middle at the end

rapture 134 Posting Whiz in Training

Are you just asking if you can add a rich textbox? I don't understand your question either . . .of course you can add a textbox or a rich textbox in vb.net, is it the same as in Word - probably not.

rapture 134 Posting Whiz in Training

Maybe the others will have more info

1. Please use code tags when supplying code (it's easier to read)
2. Appears to be a SQL problem - try searching "is not a recognized optimizer lock hints option" and there is a ton out there

rapture 134 Posting Whiz in Training

Bob - your response could have been, can you tell me how to open exe/DLL ?
Just because someone assumes you know doesn't mean they are trying to be a jerk.

I'm glad you found it, if you have other problems let us know - and mark you post solved so others know as well. (you will find that many of the people here speak over the 'simple' level because they have been doing it for a long time, if you break it down to a smaller level they are more than willing to help as long as your not asking them to code your work for you)

rapture 134 Posting Whiz in Training

Not sure if this is the right place or not, I'm trying to create a script to learn scripting better before editing the login script at work. I'm getting an error while trying to run this piece, can anyone tell me what's missing?

it's supposed to check running processes and information on my local machine

<SCRIPT LANGUAGE = "VBScript">
Sub window_onLoad
 iTimerID = window.setInterval("GetInfo", 10000, "VBScript")
End Sub
Sub GetInfo
 For i = (objTable.Rows.Length - 1) to 0 Step -1
 myNewRow = document.all.objTable.deleteRow(i)
 Next
 Set objRow = objTableBody.InsertRow()
 objRow.Style.fontWeight = "bold"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Process ID"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Process Name"
 Set objCell = objRow.InsertCell()
 objCell.InnerText = "Working Set Size"
 strComputer = "ecancel2"
 Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 Set colProcesses = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Process")
 For Each strProcess in colProcesses
 Set objRow = objTableBody.InsertRow()
 Set objCell = objRow.InsertCell()
 objCell.InnerText = strProcess.ProcessID
 Set objCell = objRow.InsertCell()
 objCell.InnerText = strProcess.Name
 Set objCell = objRow.InsertCell()
 objCell.InnerText = FormatNumber(strProcess.WorkingSetSize,0,,,-1)
 Next
End Sub
</SCRIPT>
<TABLE ID = "objTable">
<TBODY ID = "objTableBody">
</TBODY>
</TABLE>

the error is line 1, char 1 expected statement, code 800a0400 source is Microsoft VBScript compilation error

if I take out first line it moves towards the end and get the same error

rapture 134 Posting Whiz in Training

You will get from us no more than you show yourself - so study datagrids and ask your question but don't ask us to tell you what to do without you trying it on your own and getting stuck.

and then, show us your code

rapture 134 Posting Whiz in Training

You need to send him what he's asking for. Frankly, if all you're doing is copying code from a book to some software it's going to be VERY difficult for you to understand what's wrong.

rapture 134 Posting Whiz in Training

I don't understand what you need. First of all you say you don't have a problem, then you say you do have a problem but you have not given any idea of what you've done or exactly what your problem is.

rapture 134 Posting Whiz in Training

Danny,

You know I'm new and you're way beyond me, however; I don't see how you could change it other than to use 'less than' along with 'and' for your first statement or to use case statements . . .

your nested if just determines which or statement was true basically

(please correct me if I'm wrong so I can learn better)

hmm, didn't see the first reply post - must refresh qucker.

can you please explain for me - does the last else statement always ring true if the they are both negative?

rapture 134 Posting Whiz in Training

how many ways do we have to tell you that we can't help you in this area? Search final project ideas in daniweb and see the hundreds of exactly the same posts or search google

IS final project ideas

c# final project ideas

you ask us to come up with ideas (which we did but you ignore) and then we say well we can't help you and you do what? ask the same thing again . . .

You're going to get out of this exactly what you put into it, and it sounds like you don't want to put much into it. There is no magic bullet, no project that anyone in the IT industry is going to say "wow that's complicated" that you can do easily. So pick a generic easy task and go try to get your grade. Then when you get serious, work on a project all on your own that isn't easy, simple or small to try to help yourself

rapture 134 Posting Whiz in Training

me either - did you try to add StreamReader after IO as I suggested above? (I edited the post after original post, so you might not have seen the suggestion . . .)

rapture 134 Posting Whiz in Training

I don't have to "try" to create a web page - why don't you do it and then ask someone if they approve. :)

rapture 134 Posting Whiz in Training

My question is: Do you understand what they posted for you or are you just copy/paste and trying a few different things?

Do you have to change the imports to

Imports System.IO.StreamReader

I'm not sure, I know StreamReader is in IO . . .

rapture 134 Posting Whiz in Training

crap I missed that one - oh how I wish that these things could be closed after time . ..

rapture 134 Posting Whiz in Training

no clue personally but I did find this, maybe it helps and maybe I'm strung out on coffee and lima beans.

http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/c0fdfccb-f546-440e-bd06-8e8b0abbd9f2/

rapture 134 Posting Whiz in Training

congratulations, if it's finished then mark it as solved for the next person who looks. :)

rapture 134 Posting Whiz in Training

I guess I'm not sure what the main goal is . . . you want on startup a combobox to show parent folders of a selected file? I guess the reason for this just baffles me, but I'm easily baffled. :)

First of all, if you want to continue using xml to do this and nobody here is posting, you might try the xml forum here at daniweb

http://www.daniweb.com/forums/forum134.html

Secondly, if you want to make it easy for the admins to change, I'm not sure I would have put it in config.xml, why not code it for a textbox like the search already built in?

Or better yet, why not use a program that is free that the admins can check whats on a remote pc from their own desks? We use lansweeper for such things here

http://www.lansweeper.com/

It gives you a hardware and software inventory for every pc on the network. The free version works great, although we bought the full version because it gives us other features we liked such as a report builder and a great remote control and remote screen shot tool

(I'm still newer to this so take what I say with a grain of salt please)

rapture 134 Posting Whiz in Training

ok, I'm newer but I'll take a stab at it, when I've done the oledb connection I don't ever remember using the & symbol where you do here:

conn.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;data source=" & "C:\test.mdb"

I've done

con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\test.mdb"
rapture 134 Posting Whiz in Training

you're posting to a thread that's over 2 years old

Comatose commented: When Will They Learn? +9
rapture 134 Posting Whiz in Training

You're right, I stand corrected. It looked like they did this to add it to XP though

' Setup the dataset
' (Don't forget to set the DataType of the "Date/Time" column)
ds = New DataSet("EventLog Entries")
ds.Tables.Add("Events")
With ds.Tables("Events")
    .Columns.Add("Type")
    .Columns.Add("Date/Time")
    .Columns("Date/Time").DataType = GetType(System.DateTime)
    .Columns.Add("Message")
    .Columns.Add("Source")
    .Columns.Add("Category")
    .Columns.Add("EventID")
End With

...

' Set the column type of the DataGridView as well!
If col.Name = "Date/Time" Then
    col.ValueType = GetType(System.DateTime)
End If

will that work with what he wants to do? They are manually setting the header right?

rapture 134 Posting Whiz in Training

File.Copy("C:\directory\File1.txt", "C:\Directory\File2.txt")

rapture 134 Posting Whiz in Training

Sorry Teme I totally read past that, I see it now.

The problem was found by someone writing C# as well and there is a solution, so it has to translate to vb.net as well. I'm just not experienced enough to do this well.

http://www.codeguru.com/forum/archive/index.php/t-264190.html

the full C# code was here http://www.codeproject.com/KB/system/sysevent.aspx

it's the format message that needs to happen right?

rapture 134 Posting Whiz in Training

probably doing an assignment for school and is directed to do it this way. (maybe a vbscript batch file for system admin?)

rapture 134 Posting Whiz in Training

Have you tried just

EventLogEntry.Category ? (I saw you said evententry.category)

http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlogentry.category(VS.80).aspx

msdn says that this gets the text associated with the number, that doesn't work?

rapture 134 Posting Whiz in Training

k4kasun,

I'm currently a junior working on a dual degree in systems administration and information systems with a concentration on web programming. I have a full time job an hour away from home, have been married 18 years (so I’m not young) with three kids. I coach my kids in sports 8-10 hours per week and am a color commentator for high school sports on a local radio station all while maintaining a 4.0 GPA.

Your dual degree with a 3.3 isn't going to do you any good when you get into the workplace considering the talent that is out there already and the environment currently. What is going to do you some good is working on projects yourself that are of high quality and not "simple".

So first of all, my father used to tell me "if you don't have time to do something right the first time, how are you going to find time to do it over?"

I say all of this not to put you down but to drive home a point. I understand not having time to do things, believe me I do. So what you need to do for an idea is think of what you have a passion for, something that gets you excited to where you can stay up all night working on it and lose track of time severely. It needs to be YOUR passion, especially since your time is limited. What we think is a good …

rapture 134 Posting Whiz in Training

if that fixed your problem then mark the thread as solved for him

rapture 134 Posting Whiz in Training

hmm, well then ddanbe I am fast on my way to becoming an expert in everything!

ddanbe commented: At least I am not alone! +4
rapture 134 Posting Whiz in Training

Here,

Try to understand what it says,

And mark the thread as solved

http://www.homeandlearn.co.uk/NET/nets1p18.html

rapture 134 Posting Whiz in Training

I can help you, I can do the entire thing here is the problem:

You're not learning anything if I just give you the code. Yes it helps to see code sometimes, but you have to understand basic concepts and put forth some effort first.

Help us help you by spending some more time on it and let us know what you have.