Pgmer 50 Master Poster Featured Poster

Hi,

Try something like this

Dim x As Integer
        Dim stri As String
        Dim int As Integer
        Dim str As Integer
        Dim spe As Integer
        stri = TextBox1.Text
        For x = 0 To stri.Length - 1

            If IsNumeric(stri.Substring(x, 1)) = True Then
                int += 1
            ElseIf IsNumeric(stri.Substring(x, 1)) = False Then
                str += 1
            Else
                spe += 1
            End If
        Next
        MsgBox(int & " " & str & " " & spe)

It wont give count for special charecters as in second condition is checkig for Isnumeric=False will add the count to Str only. Try how to find special charecters in .net. this is just a hint. happy coding...:)

Pgmer 50 Master Poster Featured Poster

Whats not working? Whats your complete code? from where you want to access this function? give details...

Pgmer 50 Master Poster Featured Poster

i told how to create function in VB.net in my previous post. whats ur exact problem?

Pgmer 50 Master Poster Featured Poster

Then use MDI form as main form.

Pgmer 50 Master Poster Featured Poster

Or you can do something like this

For Each contr As Control In Me.Controls
                If TypeOf contr Is TextBox Then
                    contr.BackColor = Control.DefaultBackColor
                End If
            Next

I have done for textbox. You can use for lable or any other controls who's property u want to set to default.

Pgmer 50 Master Poster Featured Poster

Write one more method to change the colr or proprties of linklable. i dont think there is way to set it back automatically.

Pgmer 50 Master Poster Featured Poster

You want to use this function in all the forms? or in just one form?
If all Create function in Module with Public member
like

Public Function auto_generate_id() as Integer
' After your code retrnuj the value
Return J

End function

Pgmer 50 Master Poster Featured Poster

What you mean by reseting form and its controls? Pass more info on what u need exactly.

Pgmer 50 Master Poster Featured Poster

try setting the timer enable at proprties where u set the time.
And make sure that the function or method in which ur using the timer is firing and running fine.

Pgmer 50 Master Poster Featured Poster

So where exactly is your problem? timer is firing fine, Count is getting greater than zero. Where is the problem?

Pgmer 50 Master Poster Featured Poster

Any time control is going to Timer2_Tick event? Is timerCount is getting greater than 5 any time?

Pgmer 50 Master Poster Featured Poster

Have you set the timer.enabled=true? what is the time interval u have given ?

Pgmer 50 Master Poster Featured Poster

Dim x as integer=2.34567
X=math.round(x)
X should hold the value after rounding.

Pgmer 50 Master Poster Featured Poster

Its ok... welcome to Daniweb :) happy coding

zhackon commented: thanks +0
Pgmer 50 Master Poster Featured Poster

You mean to say User should be givin msgbox if he tries to add existing item?
Are you showing the items on ur front end?
you can use two aproaches here

1)If you are showing the items on listbox or grid just validate the new entry with these if exisit show msgbox and come out.

2) Or whatver user enters go to database and check if item exist.. and return true or false... use that boolean flag to show msgbox.

Pgmer 50 Master Poster Featured Poster

If your object is to get most recent date only from table 2 Why cant u just do select top 1 coulumn order by column desc?

Pgmer 50 Master Poster Featured Poster

Get the value into variable of type date and do date-1 using date functions.

Pgmer 50 Master Poster Featured Poster

Why cant you try Math.round function as suggested by debasis?

Pgmer 50 Master Poster Featured Poster

Is your script is giving any result? i could see where condition is missing in script. you want recent date only from table 2 ? what is the relation between table1 and table 2?

Pgmer 50 Master Poster Featured Poster

Glad that you solved the problem on your own. please mark the thread as solved.

Pgmer 50 Master Poster Featured Poster

I think you have posted in wrong forum. please post this thread in C++ forum there are guys who can help you.

Pgmer 50 Master Poster Featured Poster

Why cant u try Richtextbox with Scrollbars?

Pgmer 50 Master Poster Featured Poster

Yes cmd.ExecuteNonQuery(); is missing.
Why cant you write SP for this? and just pass the parameters?

Pgmer 50 Master Poster Featured Poster

What is N here? is it holding the upper bound of array?
Get the index of selected item in ur array and use removeat and pass the index.

Pgmer 50 Master Poster Featured Poster

Ckeck the i value when ur deleting. i think it will be allways zero. as u have declared dim i as integer but never assigned the value to it. Problably if u remove first item it is working.

Pgmer 50 Master Poster Featured Poster

u mean to say u want to reverse?

Pgmer 50 Master Poster Featured Poster

If i have understood your query properly then ur talking about the intelisence in Visual studio.
Everything is object of class.. for example textbox is a class and it is having methods,functions, properties etc... So when Microsoftt release new framework or updates. it adds the new behaviour to these classes so you will find the new options in drop down. Hope this helps

Pgmer 50 Master Poster Featured Poster

Can you please give us the further details like when ur getting this error?

Pgmer 50 Master Poster Featured Poster

Is ID column is primary key or do you have constraint? Is the ID column is set to autoincrement?

Pgmer 50 Master Poster Featured Poster

If only few values, We can save in Application setting files?

adam_k commented: I agree +6
Pgmer 50 Master Poster Featured Poster

based on the condition take the cell of the row and set to true.

Pgmer 50 Master Poster Featured Poster

Hi Alex,

As bhagawatshinde mentioned he is having xml file which is to be red.
by mistake i mentioned as excel file. as i was working with excel at that moment.. :)
so i thought its easy to read into dataset and the iterate through dataset.
correct me if i am wrong.

Pgmer 50 Master Poster Featured Poster

Using server.mapmath read the excel file into dataset. dataset is having property called dataset.readxml. then you can insert the data into database.This is is one approach.. there may be any other...

Pgmer 50 Master Poster Featured Poster

Loop through data reader and get the items you want to assign to list box else
get the result into dataset and then assign the dataset as datasource to ur listbox.

Pgmer 50 Master Poster Featured Poster

textbox1.text=string.emty

Pgmer 50 Master Poster Featured Poster

what is the textbox.text? any this is there in textbox when this piece of code runs?

Pgmer 50 Master Poster Featured Poster

you can't show messegebox in asp.net. you can do that in javascript using Alertbox.

Pgmer 50 Master Poster Featured Poster

Where your making changes to the grid item? After making changes are you getting the changes into dataset which ur using in button1.click event? After making the changes to dataset are you making dataset.acceptchanges? please review ur flow

Pgmer 50 Master Poster Featured Poster
Dim mycn As SqlConnection
        Dim strCnn As String = Persist Security Info=False; Data Source=ServerName;UID=userId;PWD=Password ;Initial Catalog=DBName;        mycn= New SqlConnection(strCnn)
        mycn.Open()
        Dim comm As New SqlCommand("your Query", mycn)
        comm.CommandType = CommandType.StoredProcedure
        Dim da As New SqlDataAdapter(comm)
        Dim ds As New DataSet
        da.Fill(ds)
        mycn.close
Pgmer 50 Master Poster Featured Poster
Persist Security Info=False; Data Source=ServerName;UID=userId;PWD=Password ;Initial Catalog=DBName;
Pgmer 50 Master Poster Featured Poster

You want the code to get the data from database? or you have any code?
what exactly u need?

Pgmer 50 Master Poster Featured Poster

Then in the same page u write the code to fecth the records from data base.
Write the stored procedure which accepts the search parameters fetch the data and show

Pgmer 50 Master Poster Featured Poster

You need to handle the else part...:)
Return nothing..

Pgmer 50 Master Poster Featured Poster

In form load assign default values to text box's

TextBox3.Text = 0
            TextBox4.Text = 0
            TextBox5.Text = 0

And in textchanged event

Private Sub TextBox3_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged, TextBox4.TextChanged, TextBox5.TextChanged
        Calculate()
    End Sub

Calculate Method:

Try
            Dim One As Integer
            Dim two As Integer
            Dim tree As Integer
            One = Convert.ToInt64(TextBox3.Text)
            two = Convert.ToInt64(TextBox4.Text)
            tree = Convert.ToInt64(TextBox5.Text)
            TextBox6.Text = Math.Round(One + two + tree)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
Pgmer 50 Master Poster Featured Poster
MODULE GetDBConnection
        
    Public Function GetConnection() As SqlConnection

        
        Dim cnReturn As SqlConnection
        Dim strConnect As String


        cnReturn = Nothing

        strConnect = “Your connection string”

        cnReturn = New SqlConnection(strConnect)

        cnReturn.Open()
        If cnReturn.State = ConnectionState.Open Then GetConnection =cnReturn


        GetConnection = cnReturn
Else
MsgBox("Failed to acquire an open connection to the database server.  Please check your network connection.")


        Exit Function


        
    End Function

End Module
Pgmer 50 Master Poster Featured Poster

Ur application does only search? or any other pages are there?
If only Search page you can write the code in that page. if u have mupltiple pages probably u need to go for 3 layer architecute.

Pgmer 50 Master Poster Featured Poster

Are you giving any button upon clicking u want to calculate? or on fly u want to?

Pgmer 50 Master Poster Featured Poster

So your checlist item will give you the source where the file is and u need to provide the path where you want source file to be downloaded...

Pgmer 50 Master Poster Featured Poster

Go to control panel remove everything releated to SQL server. Then install with proper instance name and restart your system. i cant predict what exactly is the problem..

Pgmer 50 Master Poster Featured Poster

What is checklist box here? what is the item it hold? Can you please explain ?
your working in ASP.NET web page? or windows application?