|
hello all,
Am working with windowsform Using .net 2005 and sql server.
Am developing an small application regarding payroll. code begin is vb.
my problem is whenever i give details about basicsal, Hra, conveyance etc it will automatically compute netsalary, In netsalry text box maximum length allowed is 8. but it was shown to many numbers in fraction like "2345.901245629871".How can i trim that value to"2345.90" 0r "2346". this is only my problem. am also wrote code for trim the paticular text box value. but it didn't work. please tell me suggetions to solve this problem
|
|
|
|
|
Do you use DataBinding?
Do the number showed in textbox, is allowed to be edited and return to Database?
is String.Format function or Math.Round suitable for u?
|
|
|
|
|
YOU CAN USE FORMAT
Eg:
TXTBOX.TEXT = FORMAT(TXTBOX.TEXT,"####.##")
|
|
|
|
|
Hi,
Or you can just use:
<br />
YourTextBox.Text = Decimal.Round(CDec(YourValue), 2)<br />
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks a Lot it was working Nice....
|
|
|
|
|
Hi;
I m using VB.net. I have inserted the data in SQLSERVER in this form but having this error while trying in Oracle. Im using class for connection
"ORA-01036, Illegal Name/Variable "
this is the Code I m using.
Dim LclsGeneral As New GClsGeneral
Dim fs As FileStream = New FileStream(txtContent.Text, FileMode.Open, FileAccess.Read)
Dim img(fs.Length) As Byte
fs.Read(img, 0, System.Convert.ToInt32(fs.Length))
Dim conn As New OracleClient.OracleConnection
Dim LClscnn As New GClsConnection
conn.ConnectionString = LClscnn.GetConnectionString
If conn.State = ConnectionState.Closed Then conn.Open()
Dim Lcmd As New OracleClient.OracleCommand
Lcmd.Connection = conn
Lcmd.CommandText = "Insert into Test (DOCUMENTID,DOCUMENTCONTENT) VALUES ('" & txtID.Text & "',@DOCUMENTCONTENT)"
Lcmd.Parameters.Add("@DOCUMENTCONTENT", OracleClient.OracleType.Blob,img.Length).Value = img
Lcmd.ExecuteNonQuery()
fs.Close()
txtID.Text = ""
txtContent.Text = ""
Kindly help me
Thank you
|
|
|
|
|
Hello,
Now I can use windows media encoder to broadcast my media by using vb.net. And I try to generate the video on demand but I can't do it because it must use windows media server. Please explain me in details how to generate video on demand on windows xp by using vb.net.
Thankyou very much.
|
|
|
|
|
how to insert undeletable image in word document
Please Give me solution
Thanks
Arun
Arun Kr
|
|
|
|
|
Make the file read only ?
I don;t know that Word allows you to add images that then can't be removed.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi
When we sign assign the document with certificate there is a image or may be a control shown that is unselectable and undeletable. My interest only to get that type object.
Thanks
Arun
Soft.Engg - DOTNET
Arun Kr
|
|
|
|
|
I have an application that uses Excel 2003. How can I know what is the version of Excel in the end user? Is there any way I can find it out when the program starts?
Thank you in advance
|
|
|
|
|
And option could be to find out where/ if Excel is installed on a machine via the registry.
Then open the fileinfo (use Diagnostics.FileVersionInfo and FileVersionInfo.GetVersionInfo(strPathToFile)) and extract the excel.exe file version.
Based on the result of that, you will know what excel version the user has.
- Dan Nobel
"The question is not how far. The question is, do you possess the constitution, the depth of faith, to go as far as is needed?"
boondock saints
|
|
|
|
|
hi
u go to help menu and see that ABOUT tab.u will get the version
|
|
|
|
|
Iam Sorry , vry simple Problem
I got this Error in ConnectionString..So pls Help me ..
I want to take the Database TablesName
The ConnectionString property has not been initialized.
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
Try
constr = "Initial Catalog=Pubs;User ID=sa;Password=sa;Data Source=.;"
con.Open()
cmd = New SqlCommand("select * from tablename", con)
dr = cmd.ExecuteReader()
While (dr.Read())
TextBox1.Text = (dr(0))
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
con.close
Thanking you
Somasundaram G
|
|
|
|
|
I see two problems
1 - you set a connection string but don't use it
2 - you don't specify a data source ( although it looks like it's SQL Server )
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I didnt use the Datasource and connectionstring also but again same error The ConnectionString property has not been initialized. so pls Wt i do .so pls help me.....
|
|
|
|
|
I don't understand, how do you expect this to work without a connection string ? you have what looks like one, but it's not used anywhere. How did you come up with this code ?
Here[^] are the docs for the SqlConnection class. Basically, you need to pass in a valid connection string to the constructor.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: How did you come up with this code ?
Thats the million dollar question that comes to my mind lots of times when seeing something like this.
I am not saying the OP did this - but many times people just copy paste some code and when it does not work as expected, they post it verbatim in forums to get an answer.
I can understand if the problem was related to say, Graphics, drawing or some bit shifting etc., but something fundamental as database handling needs to be learnt and not copied.
Thanks for listening, I needed to say this sometime.
Shreekar
|
|
|
|
|
Hay to all,
I have facing problem getting textbox values which were created runtime in the gridview of vb.net.
i created textbox in the gridview column and entered the value in it. now when pages is refreshed i want to read that value of textbox.
can any one help me on this?? this is very urgent...
TC
|
|
|
|
|
Forgive me I am somewhat of an amature programmer.
I have created a simple VB application which consists of a form with various values displayed and an "update" button. I would like to be able to up date the values by hitting the push button. However, what I would like is to extract data from an excel file stored on our system somewhere. The excel file is updated periodically but when I hit the button on the VB form I want the latest data to be captured and displayed.
Any ideas?
Nigel
|
|
|
|
|
There's a toolkit from MS for talking to Office from .NET.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I will also post this in ASP forum. I have a general question. I want to create a "webbased, interactive, and collaborative classroom learning tool". I believe ASP would be a good language for this. However, I also have a strong need to become proficient in VB. My application will be a type of question and answer game to be used in the classroom.
Here is my question; If I first build it entirely VB.net as a VB application, how easy is it to then move it to the Web using ASP?
You can tell from my question, I am not an expert in either or I wouldn't be asking. I know some VB but no ASP. I have six months to work on this so I am somewhat confident I can do whatever needs to be done.
Thanks,
Jinx
|
|
|
|
|
asp is ALWAYS a disaster. ASP.NET is a far better choice.
Keith Jenkins wrote: If I first build it entirely VB.net as a VB application, how easy is it to then move it to the Web using ASP?
Oh, you mean ASP.NET ? Virtually impossible. The web and windows are two different worlds, with different UI controls and paradigms.
What do you want this tool to do ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks for responding. Yes I do mean ASP.net but it doesn't sound like it will be a good choice.
The application will need to do several things. The easy way to think of it is to imagine the Jepardy game being played in a classroom. It can't be exactly like Jepardy because of copy writes and legal issues. The game would be hosted via the web but the only competition would be within the classroom. In other words, one class would not compete with another in a different location. The game would need to do all the typical things a question/answer format requires. Points, levels of questions, teams, history etc. Here is the unique part, the content would be collaborative from teachers and professors anywhere. For instance, a physics teacher could build game content based around a subject and then use if for their class. However, another teacher, anywhere in the world could take a look at what the first teacher did and use and/or modify it for their class. This means there will need to be a database on the server and and user friendly interface to build content to update and store all the content.
Seems like a lot to me but I would start modest and add feature as I go. Since I need to learn the VB.net for my employment perhaps I could use it as a prototype of sorts. You say there is no conversion path from VB.Net to ASP.net so I would have to rewrite it. Perhaps it should not be in ASP.net? I am not locked into ASP.net like I am VB.net. Any suggestions on what might be a better language for the web world?
Sorry to be so long on the explanation.
Thanks, Jinx
|
|
|
|
|
Keith Jenkins wrote: You say there is no conversion path from VB.Net to ASP.net so I would have to rewrite it.
Well, the UI you would have to rewrite. Not the business objects, if you structure it properly.
Keith Jenkins wrote: Perhaps it should not be in ASP.net?
It sounds to me like ASP.NET would be a likely candidate, you don't need the form to do anything apart from respond to events, right ?
Keith Jenkins wrote: Any suggestions on what might be a better language for the web world?
C# and VB.NET are a direct tie, because ASP.NET is the best way to write websites that I know of.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|