I have another problem with extraction cab progress, is extracting but for every file my progress bar will update to 100%, i want my progress bar to update until all files is extracted, how to do that? i was playing with the codes but no luck, this is my code for now:
Private szFiles As ArrayList = New ArrayList
Private FileCount AsInteger = 0Private TotalSize AsLong = 0, Total AsLong = 0, LastVal AsLong = 0, Sum AsLong = 0PrivateDelegateSub StatusText(ByVal Status AsString)
#Region" Status text "PublicFunction CabinetInfo(ByVal InfoCab AsString)
IfMe.InvokeRequired ThenMe.Invoke(New StatusText(AddressOf CabinetInfo), InfoCab)
Label1.Text = InfoCab
#Region" Progress Extract Function "PublicFunction ProgressExtract(ByVal k_Info As CabLib.Extract.kProgressInfo) AsIntegerIf Total <> k_Info.u32_TotSize Then
Sum = k_Info.u32_Written
TotalSize = k_Info.u32_TotSize
Total += k_Info.u32_Written - LastVal
LastVal = k_Info.u32_Written
PublicSub ExtractCab(ByVal CabFile AsString, ByVal szPath AsString)
TryDim szExtract As CabLib.Extract = New CabLib.Extract
AddHandler szExtract.evProgressInfo, AddressOf ProgressExtract
Catch ex As Exception
EndTryEndSubPrivateSub BgWorkerExtract_ProgressChanged(sender AsObject, e As ComponentModel.ProgressChangedEventArgs) Handles BgWorkerExtract.ProgressChanged
StatusBar.Maximum = CInt(TotalSize)
StatusBar.Value = e.ProgressPercentage
EndSubPrivateSub BtnExtract_Click(sender AsObject, e As EventArgs) Handles BtnExtract.Click
EndSubPrivateSub BgWorkerExtract_DoWork(sender AsObject, e As System.ComponentModel.DoWorkEventArgs) Handles BgWorkerExtract.DoWork
In short, MicroShaft still hasn't figured out we Developers INTENSELY DISLIKE small constraining non-sizable windows, let alone having to RESET the danged window to the same danged place every stinkin' time.
Or, am I clueless that there is, in fact, an ability to resize, say, the Configuration Manager window (and that it'll RECALL this next time I use it)?
C'mon, MicroShaft engineers, get into *at least* the 19th Century A.D. or, hey, the 10th century B.C. where even scrolls where freakin' SIZABLE!
I INTENSELY DISLIKE NON-SIZABLE WINDOWS, especially ones with freakin' long lists!!
Now back to the drudgery of using MicroShaft products designed by micro-mindedness...
I've just installed Visual Studio 2008 Pro in Windows 8.1/64, but without the included SQL Server Express 2005 as it's not compatible with Win 8 according to MS. So what can I use instead which is compatible with both VS 2008 and Win 8? SQL Express 2008? I just need it for developing apps that uses an SQL database, nothning else.
I'm also going to install Visual Studio 2013 Pro so it must be an SQL version that doesn't conflict with that. I assume that whatever SQL version that comes with VS 2013 (just bought it so I actually don't know what it installs) won't work with 2008, or what?
hi every body. Thks for helping about errors in VB.NET. The problem is shown:
I have textbox vs button OK vs datagridview(dtgvInTem). When I input(fill) values for the textboxs and click button OK.
+ The database is added a record 1 - but not load on datagridview
+ Continue, I input - click button OK - datagridview load record 1 - but not load on record 2 on datagird
I need when I click button Ok --> inserted database oki and load, show on datagridview a record inputed.
Thanks you everybody. P/s the code in VB.NET
PrivateSub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
kn = New KetnoiDB()
' insert Table in_Tem is oki - I tested ok
kn.insert_inTem(sku, tenHang, upc, sl, gia, maNCC, ngayin)
' -- By query: load Table in_Tem datagrid but not load a record inputed
dtgvInTem.DataSource = kn.load_Table("Q_load_inTem")
Do not create the sql query by concatenating strings. Use a parameterized query instead.
Likely the problems will disappear already with that change, as a parameterized query also avoids locale dependent formatting issues.
You are calling Convert.ToString on variables tenHang, maUPC and ngayIn, which are already string objects, so serving no purpose. You are also trying to concatenate numeric values into the string without converting them, so causing the above error. As Bernhard says above, you should use proper parameterized commands in order to a) avoid errors such as this, and b) (and more importantly) protect your database from SQL injection attacks.