|
Hi,
After reading the question about "Playtime" I was puzzled about what "Playtime" actually is. So, what is it?
Lloyd J. Atkinson
|
|
|
|
|
All he wants to do is measure the time between one button push and another. I gave him code, but he keeps asking.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi
i am attaching one file that saves in server,
i m storing tht path in DB Ex: ../../Attachment/ & strfile
i when i downloading tht file using hyperlink first i am doing like
this
CType(infTabReqTrans.Tabs.FromKeyTab("GeneralDetails"). _
FindControl("hprAtt"), HyperLink).Text = _
IIf(dsFillReq.Tables(0).Rows(0).Item("Attament") Is DBNull.Value, "No File", _
"Download")
CType(infTabReqTrans.Tabs.FromKeyTab("GeneralDetails"). _
FindControl("hprAtt"), HyperLink).NavigateUrl = _
IIf(dsFillReq.Tables(0).Rows(0).Item("Attament") Is DBNull.Value, "No File", _
dsFillReq.Tables(0).Rows(0).Item("Attament"))
its telling that 404 error resource can't find if i attach with pull path
it open like Ex
localhost/st/fg/txt.open
How to open using vitual path can any one Reply to this Quation
Advance Thanks
Shrikant
|
|
|
|
|
If this is ASP.NET, don't use IIf, it's nasty and hacky VB6 rubbish.
You can't give a full file system path in a hyperlink, is this what you're doing ? You need to use the MapServerPath methods to get a URL that is valid for your server.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
hi guys.
i would like to know how to transfer or export the values of a registration page to an excel sheet through vb.net.
i have done something in this but of no use.
i have refferenced the microsoft excel 11.0 library to the project. when i was mentioning the class name ie imports microsoft.office.interop.. the last part ie the interop was not comming instead of that '.core' was there and was unable to create a excel worksheet from my application .
i will post here my code. please review it and tell me about any changes.
imports microsoft.office.core // unable to get the interop here
Dim oExcel As Excel.Application
Dim oBook, oBook1 As Excel.Workbook
Dim oSheet As Excel.Worksheet
'Start a new workbook in Excel.
oExcel = New Excel.Application
oBook = oExcel.Workbooks.Add
oBook1 = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook.
oSheet = CType(oBook.Worksheets(1), Excel.Worksheet)
'Response.Clear()
'Response.Buffer = True
'Response.ContentType = "application/msword"
''Response.ContentType = "application/vnd.ms-excel"
'Dim stringWrite As New System.IO.StringWriter
'Dim htmlTextWriter As HtmlTextWriter = New HtmlTextWriter(stringWrite)
'txtPwd.RenderControl(htmlTextWriter)
'Response.Write(stringWrite.ToString())
'Response.End()
'Dim myexcel As Excel.Application
'Dim oExcel As Object
'Dim oBook As Object
'Dim wbook As Excel.Workbook
'Dim wsheet As Excel.Application
'Dim oSheet As Object
'Dim strCust As String
''Start a new workbook in Excel.
'oExcel = CreateObject("wsheet")
'oBook = oExcel.Workbooks.Add
''Add data to cells of the first worksheet in the new workbook.
'oSheet = oBook.Worksheets(1)
''send Label to cells
oSheet.Range("A1").Value = Label12.Text
oSheet.Range("B1").Value = Label3.Text
oSheet.Range("C1").Value = Label4.Text
oSheet.Range("D1").Value = Label5.Text
oSheet.Range("E1").Value = Label6.Text
oSheet.Range("F1").Value = Label7.Text
'oSheet.Range("G1").Value = lblDiscountAmount.Text
'oSheet.Range("H2").Value = lblDiscount.Text
'oSheet.Range("I1").Value = lblInvoiceTotal.Text
'Format cell dimension
oSheet.Columns("A:A").ColumnWidth = 18
oSheet.Columns("B:B").ColumnWidth = 30
oSheet.Columns("C:C").ColumnWidth = 20
oSheet.Columns("D ").ColumnWidth = 10
oSheet.Columns("F:F").ColumnWidth = 10
oSheet.Columns("G:G").ColumnWidth = 16
oSheet.Columns("H:H").ColumnWidth = 12
oSheet.Columns("I:I").ColumnWidth = 12
'Formating label to cell
oSheet.Range("A1:B1:C1:D1:E1:F1:G1:H1:I1").Font.Bold = True
oSheet.Range("G2:H2:I2").Font.Bold = True
oSheet.Range("G1:I1").Font.ColorIndex = 3
oSheet.Range("I2").Interior.ColorIndex = 6
oSheet.Range("G2").Interior.ColorIndex = 36
oSheet.Range("F2").Interior.ColorIndex = 36
'send data from textboxes to cells in excel
oSheet.Range("A2").Value = txtPwd.Text
oSheet.Range("B2").Value = txtConform.Text
oSheet.Range("C2").Value = txtFname.Text
oSheet.Range("D2").Value = txtMname.Text
oSheet.Range("E2").Value = txtLname.Text
oSheet.Range("F2").Value = ddlGender.SelectedItem()
'oSheet.Range("G2").Value = txtDiscountAmount.Text
'oSheet.Range("I2").Value = txtInvoiceTotal.Text
'Save the Workbook and quit Excel.
oSheet = Nothing
oBook = Nothing
oExcel.Quit()
oExcel = Nothing
GC.Collect()
there is no such thing as good or bad.
|
|
|
|
|
Do you want to create a new workbook every time?
If not use an OleDb Connection to access the Excel Jet datasource and use a query to update the Workbook. This way formatting is handled by Excel and you build a list of "Registration rows"....
You will also need to add a reference to Microsoft Excel version you are using..
Dim fileName As String = "..." ' Valid filepath and filename
Dim cn As OleDbConnection
If cn Is Nothing Then
cn = New OleDb.OleDbConnection
End If
cn.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;" & _
"Data Source=E:\" & filename & ";" & _
"Extended Properties=Excel 8.0;"
Try
Dim s As String = "INSERT INTO [SheetName$](" & _
"Psswrd, Conform, FName, MName, Gender, " & _
"DiscountAmount, InvoiceTotal) & _
"Values('" & Me.txtPwd.Text "','" & _
Me.txtConform.Text & "'," & _
Me.txtFName.Text & "','" & _
Me.txtMName.Text & "'," & _
Me.txtLName.Text & "','" & _
Me.ddlGender.SelectedItem & "','" & _
Me.txtDiscountAmount.Text & "','" & _
Me.txtInvoiceTotal.Text & "')"
cn.Open()
Dim cmd As New OleDbCommand(s,cn)
cmd.ExecuteNonQuery()
cn.Close
Catch ex As Exception
....
Finally
If cn.State <> ConnectionState.Closed Then cn.Close
End Try
....
Something like this is fast and easier on resources than your application object version...
Cheers
The Fanatical All Black Supporter - Kea Kaha
|
|
|
|
|
I am writing an application in VB.NET. I learned VB.NET in college, but have been coding PHP. So, I don't have much experience in VB.NET.
I have already built the interface to the program. I used panels to create each form on. What I would like to do is allow the user to click on button 1 which will then load panel 1. I also want panel 1 to come up when the user starts the program.
I also want the user to be able to click on button 2. Then once button 2 is clicked on I want panel 1 to dissapear and I want panel 2 to come up on the screen.
How do I do this?
|
|
|
|
|
Assuming that a panel is a control, it has a Visible property. If by panel you mean seperate windows, buy a book on Vb.NET and work through it. A form is just a class, you create an instance of it as you would any other class.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Could you tell me good tutorial site or good book learning VB.NNet windows application?
Thanks
Aniruth
|
|
|
|
|
You're better off starting with a good book, then you can download and read articles on ths site, plus MSDN is the Microsoft reference site - msdn2.microsoft.com[^]
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
This is a good tutorial which you can follow on the web or buy for a small price Click here
I found it to be concise, easy to follow and enjoyable.
It would also be worth reading the following Code Project article as it explains a bit about .NET itself Click here
Finally as a general tutorial on OOP I would recommend Click here
Enjoy the journey
You always pass failure on the way to success.
|
|
|
|
|
Hi,
Here's a good link:
http://visualbasic.about.com/od/learnvbnet/Learn_VBNET_Visual_Basic_for_the_new_millenium.htm
Lloyd J. Atkinson
|
|
|
|
|
Could you tell me good tutorial site or good book learning VB.NNet windows application?
Thanks
|
|
|
|
|
|
|
im working on a vb.net project of 5 forms. 2 forms of these when loaded has a radiobutton that it is checked eventhough they are not selected and also they checked property is set to false,please help me to uncheck these radio button,btw i tried to write the code 'radiobutton.checked=false' at form load and it didnt work.
this problem arised after i ordered the tab from menu/view order tab.
thanks alot.
|
|
|
|
|
zamzoum wrote: 2 forms of these when loaded has a radiobutton that it is checked eventhough they are not selecte
That's because Radiobuttons work by selecting one option out of a list of options. There is not a "no option selected" way for Radiobuttons to work. No matter what you do, the first RadioButton will always be selected by default.
|
|
|
|
|
10x dave for replying,but the default for radio buttons is to be unchecked and the user select his option from the list of radio buttons and that is not my case,i have checked radio buttons on form loading even that their property is set to false,btw in the other forms of my project i do not have this problem.so what can u advise me?
10x alot
|
|
|
|
|
What Dave is saying is not entirely true (at least in vb.net, I don't know about vb6). When you create a form, and add radiobuttons, they will be unchecked by default. When the form is loaded, the radiobuttons will all be unchecked until you make a choice.
The better question however is, why would you want to use radiobuttons and then have them all be unchecked? The basic idea of the radiobutton is to force the user to make a choice. Otherwise you really should consider using checkboxes instead.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: When the form is loaded, the radiobuttons will all be unchecked until you make a choice.
Not true. I thought the same thing until I threw a test project together to verify it.
Dropped a GroupBox, or a Panel, it doesn't matter which, on a Form and dropped 5 RadioButtons on the form. Didn't change anything and verified all the Checked properties on all RB's were set to false. I also verified that no funky code showed up in the Designer generated code setting one of them to True. Then I ran the code and watched the first RadioButton get checked automatically.
|
|
|
|
|
Hi Dave,
This might be some sort of version issue, because I tested it myself, first by putting radiobuttons directly onto the form, and after your reply, I tried it with a panel, and I get no checked radiobuttons whatsoever... I tested with VS.NET 2003, .net 1.1, on win XP.
Best Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I think you may be right. I did this in 2005 and got a checked RadioButton every time.
I'll make up the same exact project in 2003 and see what happens, then convert it to 2005 and see.
|
|
|
|
|
Confirmed it's a version issue.
Under 2003 and .NET 1.1, the RadioButtons do not pick a default selection. They ALL stay unselected with the default configuration.
Under 2005 and .NET 2.0, the first RadioButton gets selected automatically.
|
|
|
|
|
thanks john for replying,i go with u that what dave said is not true,but i guess u didnt understand my problem.
as u said ,radio buttons by default should be unselected,and that is not my case ,when loading my forms some of the radio buttons are checked eventhough i didnt yet make the selection,so i checked the 'checked' property and it is set to false,that what doesnt make sense. as for why not using checkboxes cuz i want to force the client to give 1 choice only.
so what can u advise me to do?
10x alot.
|
|
|
|
|
Why it is behaving like it is, I have no clue. You said it yourself however, the radiobutton's idea is to force the user to make a single choice. I understand from your message that you don't want to have a default choice though.
One possible solution to your dilemma could be to fake it: add an extra radiobutton to the groupbox or panel or whatever, make it the default selected one, and .Visible = False . As an additional advantage you can then also check this radiobutton's checkstate to see if the user remembered to make a choice.
Hope this helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|