|
|
Thank u so much dear Stewert!!
|
|
|
|
|
I was wondering if anyone knew how I could obtain code to obtain an mp3's bitrate and/or song length (in seconds) info? Thanks.
Bill Dennis
Orlando, FL
|
|
|
|
|
I’m using the SQL Data Adapter to maintain a database. I have a separate set of fields to add records and move the data into a new row structure and then use this code to insert the new record
CompDS1.tblComplainants.AddtblComplainantsRow(newComplainants)
SqlDataAdapter2.Update(CompDS1, "tblComplainants"
After I update the database I remove the data bindings, fill the dataset, and then rebind the fields.
The problem is that the currency manager is incremented by two and the first record can be displayed as a duplicate along with the new row. The count is 3 when it should be only 2 and I’ve tried resetting everything I can find.
If I leave the program and restart it, the count is correct and only the original records and the one I added are present. (The database is also correct, nothing is being duplicated).
I even switched to writing my own insert statements in sql to fix the problem. When I re-fill the dataset to see the added record the original record is still being duplicated.
Any Ideas?
|
|
|
|
|
I created a BMI program. I am having a problem with rounding numbers.
I tried the Double, Constant, and Short. But it still results long numbers.
Can anyone he lp me.
bravo659
|
|
|
|
|
I recently converted a project from VB.NET to C# and discovered that VB.NET has some very entertaining ideas about number rounding. I think though that you're saying you want to control how many digits a floating point number has to the right of the point ? The .Format method will do that for you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thannk you for youre reply to my inquiry. I will try it and let you know how it went.
bravo659
|
|
|
|
|
I have question, not related to the problem, but you mentioned in your reply that you are converting a program from VB.Net to C#. Can you please tell me why you made that decision. I am working on this web application using VB.Net. I was thinking about converting to C# but still can't make a decision. What could be the advantages since both are now Object-Oriented.
Thanks for you reply.
|
|
|
|
|
I had to use VB.NET for an ASP.NET job, and I found it to be even worse than I imagined. Yes, both are OO, and both compile to MSIL, however, VB.NET is incredibly ugly, and has some 'features' that are plain astounding. For example, a function will return false, Nothing or 0 ( depending on the return type ) by default. A blank string is the same as Nothing, if you compare them. I was so disgusted that I started a couple of threads on it, and some of the comments I got from people with a background in VB6 included that VB.NET was initially a good design, until all the VB6 users complained about things that had (rightly) been removed. Now, VB.NET adds a lot of syntax to make it possible to use it in a clean way, but very few users know about it, they keep using things like CType and IIf. Another user informed me that the C# MSIL compiler generates more efficient ( i.e. faster ) code. Another told me that any VB6 programmer who was worth anything had moved to C# because of the mess they had to make of VB.NET to keep the legacy coders happy.
In the end, it's obvious that VB.NET is a dead duck. Unlike VB.NET, C# is a new language, designed to be OO, designed to be clean, designed to be a serious language. VB was designed for beginners, and VB.NET carries it's legacy. I don't see why Microsoft need two proprietary languages, and C# is obviously the one they are putting their efforts in to. The gap between C# and VB.NET will grow until VB.NET can be dropped with nary a cry of complaint.
If more reason is needed, just compare how many people are answering C# questions/writing C# articles compared to VB.NET here on CP.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks Chritian.
You are right, even for the .net job openings, people ask for C# and not VB.Net.
|
|
|
|
|
I found the answer, i am using Math.Round to round off the numbers n the BMI project.
bravo659
|
|
|
|
|
Hi,
I have wrote a small VB application that opens up an Excel spread sheet. However when I close my VB application the Excel process is still showing as running in Task Manager. Would you have any idea? Here's the simple code sample:
Private Sub Command1_Click()
Dim XL As Excel.Application
Dim WB As Excel.Workbook
Set XL = CreateObject("Excel.Application")
Set WB = XL.Workbooks.Open("C:\temp\Anyold.xls")
WB.Close False
Set WB = Nothing
XL.Quit
Set XL = Nothing
End
End Sub
|
|
|
|
|
If you are using createObject you dont need to declare the type as Excel.Application or Excel.workbook. You dont even need to reference the excel object library. Try the following:
Private Sub Command1_Click()
Dim XL As Object
Dim WB As Object
Set XL = CreateObject("Excel.Application")
Set WB = XL.Workbooks.Open("P:\Tolroy Manor\Data Store\Map Production\map_status.xls")
WB.Close False
Set WB = Nothing
XL.Quit
Set XL = Nothing
End
End Sub
Jon
|
|
|
|
|
Thanks. I have tried your code but Excel.exe still shows as running in Taskmanager. Would you have any other ideas? Thanks in advance.
|
|
|
|
|
XL.Quit() would do close Excel. Everything seems OK in this code. The problem lies somewhere else. Maybe some feature the workbook introduces (running macro or something). You should also consider upgrading to Excel2003 if you haven't done so.
|
|
|
|
|
You need to use "Marshal.ReleaseComObject()".
|
|
|
|
|
OK I've tried it in VB.NET and it worked fine without Marshal.ReleaseComObject()
I mean, Excel2003 has quit without it.
But the optimal solution would include your line.
|
|
|
|
|
I think you'll want to use the "Marshalling" especially if your users can create multiple Excel objects from within your application. You'll see them hanging around in the "Task Manager" if you don't handle them. At least that was my experience.
|
|
|
|
|
is there a way to use ms access as the backend for an application developed
in ppc 03? If so, are there some resources for sample code for connecting to
the database, opening the database, retrieving records, modifying records
etc.?
Thanks in advance for any help
|
|
|
|
|
What's "PPC 03"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry, that was a poorly worded question. The app was developed in vb.Net for a Pocket PC 2003 (ppc 03) device.
|
|
|
|
|
In that case, your question would be better handled in the Embedded/Mobile Forum[^]. It really has nothing to do with VB.NET. It's a matter of whether the Pocket PC and the .NET Compact Framework has support for OLE Databases, a question I am hardly qualified to answer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I have a VB Form which has a Browser Control within. Now I would like that when a VB button is pressed (on the window form) a cookie is set and when i load a particular asp page within the browser control it reads the cookie.
The problem i'm having is setting the cookie from the VB.Net part. Is there a way to do it or at least is there another way to transfer data from VB.NET application to the ASP page.
Can anyone help pls!?
Thanks in advance
Nick
|
|
|
|
|
That's a really poor method of transferring information to a website, and will more than likely fail. Parameters are usually passed in the URL string. The format of which depends entirely on the site. What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave
thanks for your reply..
well i said in my previous post i am creating a VB.Net application which has a WebBrowser within. The story behind it is quite simple as my client wants this particular system and i've suggested to write an application which would be accessed via the Browser (ASP.NET) but he refused! Since i know this guy quite well, i'm pretty sure that after a couple of months he would want it acessed via the Browser...so to facilitate this i've written the main system using ASP.NET and created a client using VB.NET and will eventually load all the ASP pages within. Now the VB client app on loading will ask for the user name and password and in some way i need to transfer the user information to the browser.... i thought i could have done it through a cookie...though through your reply it seems that it is not a suitable method!
Any suggestions would be greatly appreciated!
Thanks once again
Nick
|
|
|
|