rapture 134 Posting Whiz in Training

Then mark as solved

rapture 134 Posting Whiz in Training

cool, if it's fixed mark it as solved for others who search

rapture 134 Posting Whiz in Training

Unless you're required to code it yourself, there is a very good tutorial and explanation on how to use the built in features for login here:

http://download.microsoft.com/download/3/6/0/3604c3d2-0db9-4726-910d-b3b8f93a86e4/hilo_membership-roles_final.wmv

kvprajapati commented: Good suggestion. +7
rapture 134 Posting Whiz in Training

Have you done a search? Looks like a good explanation here

http://www.vbdotnetheaven.com/Uploadfile/mgold/WordDocument04182005081441AM/WordDocument.aspx

will that work for you?

(You also might want to post future VB.Net questions in the VB.Net forum)

rapture 134 Posting Whiz in Training

Alright, I'll try to help you if you're trying to help yourself. Post me some code and let me know what you're trying and what you think isn't working. I won't just do it for you, but maybe we can work through it together.

rapture 134 Posting Whiz in Training

Hmm, thanks for posting your solution. That should help

would you mind marking it as solved so others can find the answer?

rapture 134 Posting Whiz in Training

looks like it, although I have not done this myself - type"

"VB.NET WinForms - DataGridView - Adding new rows, removing old ones to AcceptChanges"

in google and it's the first entry, you can then scroll down to the bottom and see the accepted solution. (it's a long scroll down)

for some reason the accepted solution is blocked when you post the link somewhere

rapture 134 Posting Whiz in Training

I see you've posted this on the vbforums website as well. I don't post over there but it doesn't look like you've gotten your answer yet either. I have two possible suggestions for you

One is to reset the row numbers with something like this

For i = 0 To newRow.ItemArray.Length - 1
      currentRow(i) = newRow(i)
      Next

( I found that on experts-exchange - if you scroll to the bottom the solutions are there but he was having a different problem than you)

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_22924060.html

The other suggestion is to look at .acceptchanges

possibly http://msdn.microsoft.com/en-us/library/system.data.dataset.acceptchanges.aspx and reset the database

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

I guess my replies are either completely wrong or not worth looking at - seems to me on that link I posted was this

//Create a connection to the SQL Server; modify the connection string for your environment
			//SqlConnection MyConnection = new SqlConnection("server=(local);database=pubs;Trusted_Connection=yes");
			SqlConnection MyConnection = new SqlConnection("server=(local);database=pubs;UID=myUser;PWD=myPassword;");

			// Create a Command object, and then set the connection.
			// The following SQL statements check whether a GetAuthorsByLastName  
			// stored procedure already exists.
			SqlCommand MyCommand = new SqlCommand("select * from sysobjects where id = object_id(N'GetAuthorsByLastName')" +
			"  and OBJECTPROPERTY(id, N'IsProcedure') = 1", MyConnection);

			// Set the command type that you will run.
			MyCommand.CommandType = CommandType.Text;

			// Open the connection.
			MyCommand.Connection.Open();

			// Run the SQL statement, and then get the returned rows to the DataReader.
			SqlDataReader MyDataReader = MyCommand.ExecuteReader();

maybe you have some of this stuff other places, like the connection etc.

If I'm way off, please ignore me as I'm still fairly new.

Did you step through it to see what happens?

rapture 134 Posting Whiz in Training

There and you can check here
http://support.microsoft.com/kb/320916

rapture 134 Posting Whiz in Training

I'm not sure myself, but maybe this helps

http://www.thescarms.com/dotnet/ExcelObject.aspx

rapture 134 Posting Whiz in Training

Yes, that's fine. You might add the word positive to it but hey that's just preference.

If it's solved, would you please mark the thread as solved?

rapture 134 Posting Whiz in Training

I still think you should use tryparse to keep from crashing on letters, you would have to add a variable to hold the parsed double

While Double.TryParse(carpetArea, dblNumber) And carpetArea > 0.0

this should work, if the number is not able to be converted to double it will throw warning and if it's negative or zero it will not hit your while.

Surroud it with a try catch block

rapture 134 Posting Whiz in Training

I think since you "can't" use textbox and have to use input box then your best bet is to switch it to a string and then try to parse the input. If you can then it's numeric and you can go with it but if it can't be parsed then it's not numeric.

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

I tried to help you once. Again I typed in "Java play audio file" and the first result from google was here
http://www.google.com/search?hl=en&q=java+play+audio+file
in google the description says this
"Here's a step-by-step guide to playing audio files in a Java application"


And Ezzaral is right, please refrain from using IM type speak. This isn't a chat room. :)

rapture 134 Posting Whiz in Training

please use code tags to make readibility easier

rapture 134 Posting Whiz in Training

hmm wierd, what didn't you find? I typed in

java play audio file

and found a ton of stuff in google . . .

Ezzaral commented: That's because you actually have enough initiative to try to learn on your own and think for yourself :) +18
rapture 134 Posting Whiz in Training

which number = 0 did you take out? you need to take out? You have two of them, and one of them doesn't even end the line with a semi-colon

ddanbe - who knows what IDE he is using if any - but doesn't eclipse do that for him automatically when he hits run or runas

rapture 134 Posting Whiz in Training

nandomendoza

start with writing pseudocode of what you want your program to do. It's just plain english

start program
--program does this
--if program input is this then do this

etc

after you get that done then go to the smallest thing you know how to do. Maybe it's declare a variable, whatever that is do the smallest chunk first. At this point you're putting some thought into your work that is constructive. When you get to a point where you can't do something post again

rapture 134 Posting Whiz in Training

I'm interested to see what goes on with this one, why wouldn't you need his line in bold to be this?

if(p.getCoinName(coinName).equalsIgnoreCase(coinName))

I'm very new to Java so please be kind if I'm completely lost, just trying to follow what's going on even though I don't know the error, I'm trying to follow the logic of the program.
Thanks

rapture 134 Posting Whiz in Training

I need to look back at what I did with asp.net and try to figure out the differences in datagrid from forms to asp

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

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

Ramy's code fixed the problem?

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

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

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

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

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

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

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

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.

rapture 134 Posting Whiz in Training

Tobbek

Maybe you're used to working with global variables?

rapture 134 Posting Whiz in Training

What exactly are you asking for? You want me to code it for you and give that to you? Or are you asking for the logic to do the program?

(By the way, I'm don't run .exe files from forums. If you want to post a pic of it or something that's fine)

rapture 134 Posting Whiz in Training

To do what you ask you can make global variables and have in your button click

variable1 = txtTextbox.Text

reset the textbox if you so choose and for button 2 then

variable2 = txtTextbox.Text

Since you don't want to do it that way then you're going to either have to keep it all together by adding every button on the form and having people enter the button to get a value and translate the box into a string and substring or parse it out or keep a separate variable for the display

display = variable1 + "+" + variable2 or something of that sort

then after hitting your button set the textbox to display the display variable

rapture 134 Posting Whiz in Training

Is this similar to what you want to do?

http://www.hunterstone.com/library/RichTextBoxHS.htm

rapture 134 Posting Whiz in Training

this is supposed to update the database?

Me.FriendsTableAdapter.Update(Me.TestDB2DataSet.Friends)

I've never done it that way, how does it work?

rapture 134 Posting Whiz in Training

I was going to add that the two outputs are the same . ..

rapture 134 Posting Whiz in Training

Yea I'm a little lost as well - I thought all he needed was
form1.close() or form2.close() or WhateverYourFormsNameIs.Close()

but he needs to code it as well?

rapture 134 Posting Whiz in Training

I'm not 10% of the programmer these other guys are, but what I do at this point is insert a breakpoint and step through the code to see where the disconnect is.

rapture 134 Posting Whiz in Training

i am only using it in a small program, but if i try your code i get (collection) a load of times in the combo box. Also it says
ComboBox1.Items.Add(urls)
url is not defined so i assume it meant to be urls

correct, he used url in the first part and urls in the second, it should probably be

ComboBox1.Items.Add(urls)