|
good day to everyone..
i need ur help very badly.. does anyboday knows or can guide me how to open an existing excel file through vb.net windows form with click event?....
start a new beginning in every ending; thats what life for......
|
|
|
|
|
Actually i've checked in .Net.
However i've used below code in VB6. Please check whether this works for you.
WorkPath = App.Path
fname = "trial.csv"
Set JetConn = CreateObject("ADODB.Connection")
JetConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='Text';Data Source='" & WorkPath & "';"
'Open CSV file to Add/Update Master records
Set newrs = CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM " & fname
newrs.Open strSQL, JetConn, 1, 2
Regards
KP
|
|
|
|
|
hey everyone, i am writing an application in vb.net
i use web matrix to generate my querys, when i run an update query and use it
it only update information that is not yet in the database that is.. if the field is empty then it will update it...but if there is information in the field..how do i up date it using a sql update statement
Nab
|
|
|
|
|
Is it an update query or an insert query that you have?
When you say "field", do you really mean a field, or do you mean a record? When you say that it's "empty", is it a field that is null, a field that is empty, or a record that doesn't exist?
An insert query will only add new records. An update query will only update records that exist, not create new ones. An update query will always update the values in the fields if the record exist, regardless of what the values were before.
---
single minded; short sighted; long gone;
|
|
|
|
|
its and update query.. and it giving me problem updating.. example.. in my project.. say i have three fields in the table..firstname, lastname, and middle name.. first name and lastname is monditary so information will always be in the table for first and last name.. and middle name might not have informaiton...
i use webmatrix to create my query and then place it in a class in my project then called it where it is needed..
problem: when i try to run an update.. if i try to update a record.. say John Brown is the person's name..if i try to change it to say..mary brown..its not updating..but if i try to change it to John James Brown..note this time, i only updated the middle name because before it didn't have one.. in this case it updates.. so i am wondering whats up with my query.. could u write me a simple update query and let me see if i can use it to test my project..becuase the generated ones not helping me..
thanks..
Nab
|
|
|
|
|
Here is an update query that you can use:
Dim queryString As String = "UPDATE [R_Application] SET [Fname]=@Fname, [Mname]=@Mname, [Lname]=@Lname WHERE (" & _
"[R_Application].[AppId] = @AppId)"
As you see, this is the same as you posted in your other thread. There is nothing wrong with it.
As I said in the other thread, you have to look for the error elsewhere in the code.
Debug the code and look carefully where you get the values from that you put in the parameters for the database call. I suspect that what you actually put in the parameters is the exact values that you find in the database.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have a calculation (as can be seen below) and I want to make this number rounded to the nearest number (eg if the calc = 35.5 = 36 or 35, whichever!), how can i do this, i think the code is right, just not the right value in the round field!
'Initial Calculation
intPerc = ((intScoreTop + intScoreMid + intScoreBot + intScoreAll) * 2)
'Round int to nearest number
intPerc = Math.Round(0)
|
|
|
|
|
You can cast to int, or you can use Math.Ceil or Math.Floor to control the direction.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Try This, it may not be 100% correct but it should get you started:
dim original as string = ((intScoreTop + intScoreMid + intScoreBot + intScoreAll) * 2)<br />
dim determiner as string<br />
dim result as integer<br />
determiner = original.remove(0,indexof(".") + 1)<br />
determiner = determiner.remove(1,s2.length-1)<br />
<br />
if cint(s2) >= 5 then<br />
result = math.ceil(cint(s))<br />
elseif cint(s2) <5 then<br />
result = math.floor(cint(s))<br />
end if
Posted by The ANZAC
|
|
|
|
|
Wow - that's really messy.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It is very interesting but what I noticed was the variables as (intscoretop, intscoremid,intscorebot and intscoreall) if you have defined these variables as INT32, it will automatically round any assigned value therefore if IntscoreTop = 35.6 will come up with 36 and no need to use math.Round function.
Math.Round function is used for double precision floating point numbers.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
If the above poster assumption is correct then this it a mute point. However in your original code you were rounding zero, which should round to zero
intPerc = Math.Round(0) Math.Round takes a number and rounds it. You need to supply it with a number, in your case you did '0'. What you meant to do is:
intPerc = Math.Round(intPerc)
|
|
|
|
|
TwoFaced wrote: mute point
You mean a moot point.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Indeed I did
|
|
|
|
|
How can I use the barcode in my Program?
I had some question about barcode!
In my program how can I print barcode with Standard code39
If you know a free font or component and you test it please introduce me
And how can get the data from barcode reader (such as keyboard, USB, Serial-port) and display in the text box (Please give me a source not component)
|
|
|
|
|
It will depend, but most barcode readers offer an API that returns the code as a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes, the most barcode writters receive an string and then generate the barcode, then only must send this control to printer, you can draw this control in a printer o another method should it work.
Greetings from Mexico
-----------------------
Cuando salga el sol, no estare aqui...
|
|
|
|
|
Hi,
I have written a word add-in and its working fine.
I needed to know how to get the filename / path of active (opened) document
Thank you!
M. Nauman
|
|
|
|
|
I have written a word add-in and it is working fine.I want to capture the path of the selected document into my application.Please help me.
Thank You.
Salma.
|
|
|
|
|
i want to create runtime controls and want to give functions to those control
how to do that
with regards
Balagurunathan.B
|
|
|
|
|
I suggest you to focuse on how to create and use classes in vb.net.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
hey my requrement is to create dynamic tabs
i tried to create but only the last button created works not all the buttons in display r working
with regards
Balagurunathan.B
|
|
|
|
|
Why don't you use tab control? Check the toolbox!
How did you create the tabs?
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
even though we create dynamic tabs or buttons how to evoke events like onclick ,....
with regards
Balagurunathan.B
|
|
|
|
|