|
Thank you those are good links. Are there any other good links for code help. in explaining what code performs what function?
|
|
|
|
|
Hi Everybody,
I'm new to .NET and having a hard time figuring out how to extend a class in Main.aspx.vb (code behind main page).
Here is what I have:
(Main.aspx.vb)
Partial Class Main<br />
Inherits System.Web.UI.Page<br />
<br />
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Label1.Text = "it works"<br />
End Sub<br />
End Class
I've added a class called MainExtended.vb in the App_Code folder. I basically want to inherit "Partial Class Main" so I can write code in MainExtended class that can access the controls in Partial Class Main.
Can somebody guide me in the right directions? I've done lots of reading on inheritance... but I can't seem to get it to work - could not find an example that shows me how to get it working.
Thanks in advance.
|
|
|
|
|
Why are you creating an additional class?
Go to the designer, doubclick on the button, this should create the code in main.aspx.vb. Put your code in there.
|
|
|
|
|
I have no idea why you're doing this since this code should be in your Main class. Any code that manipluates the controls of a form should be in the form's class, not in a seperate class.
But, you can just create a standalone class with a method that takes a controls collection as a parameter. Or, create a class that inherits from Main. Neither of these is a good idea - use at your own risk.
Public Class MyOtherMainForm
Inherits Main
...
End Class
|
|
|
|
|
Hiya,
I was just wondering if it was possible to have a form inside a VB.NET dll made in VB 2008??
I can click on Project|Add Windows form... but when I type something like "Form1.Show" it says:
"Reference to a non-shared member requires an object Reference".
So I'm guessing I would have to somehow make the Form "A shared member" but I dont know how to do this.
Any help will be greatly helpful,
Thanks Lloyd A.
P.S. I've honestly tried looking on the internet on this subject but I was unsuccesful in finding anything helpful.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
I haven't actually tried to do that before, but you would normally use something similar to the code below to open up a new form.
Dim frmNew As New Form1<br />
frmNew.Show()
(I'm writing this from memory, I don't have VS open right now)
|
|
|
|
|
Hiya,
This seems to work, thanks, I didnt know that it was as simple to use forms in DLL files! Thanks again!
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
Hello
i am trying to get a value from a textbox but i just have its name in a string varriable
like in php $$name
can somebody help me
thanks
kosmas
|
|
|
|
|
REflection is what you need here. You need to find the control by name, and then access it's Text property, using reflection.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
you can enumerate all the Controls (possibly recursively) until you find one with a
matching Name property.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
|
I know that there is a namespace in the System.Io.Ports in VB 2005 and above, but I have an application in 2003 I need it for. Wondering if anyone knew of a way to use a port in '03 or knew of a .dll I can use for it.
Thanks,
Brian
|
|
|
|
|
Hiya,
You could just simply upgrade to VS 2005/8?
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein
The most annoying thing about Microsoft is its obsession with change.
|
|
|
|
|
All you have to do is the same thing anyone is going to do. Google for ".net 1.1 serial port library".
Here...[^]
|
|
|
|
|
hi all
i work on text led display ( 16 row*64 column )leds , and i need a way or program to convert the arabic charters in textbox to 16 * 64 bitmap file and then to heaxfile to program the microcontroller .
thank you
|
|
|
|
|
The only idea I have for doing this would be to render each character to a small bitmap image matching the size of your character matrix and then use a C# processing library to get at the pixel data so you can see which pixels are turned on and off. Then you can use that information to geterate your hexfile data to send to the microcontroller.
|
|
|
|
|
Why do you need the bitmap as an intermediate step ? That's the step that is going to make this very hard indeed.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i quite weak but i hv unreasonable idea it gives me error...error given was Error
2 Argument not specified for parameter 'Emp_ID' of 'Public Overridable Overloads Function InsertQueryEmp(Log_No As String, Emp_ID As String) As Integer'. C:\Documents and Settings\HOn\Desktop\DIFINITION\DIFINITION\Form1.vb 20 17 DIFINITION
<br />
With Me<br />
if btnlogin.Text=true then<br />
.LOGIN_OUTTableAdapter.InsertQueryEmp(.Login_DateDateTimePicker.Value)<br />
.LOGIN_OUTTableAdapter.Fill(.Definition_dbDataSet._LOGIN)<br />
else<br />
.LOGIN_OUTTableAdapter.InsertQueryEmp(.Login_DateDateTimePicker.Value)<br />
.LOGIN_OUTTableAdapter.Fill(.Definition_dbDataSet._LOGIN_OUT)<br />
End If<br />
end with<br />
from query
INSERT INTO `LOGIN/OUT` (`Log_No`, `LogIn_time`, `Login_Date`, `Emp_ID`) VALUES (?, ddMMyyyy, HHmmss, ?)
datype i'm using is data/time
can any 1 help me correct it...thanks in advanced
modified on Wednesday, April 9, 2008 12:14 PM
|
|
|
|
|
What's the error?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Error 2 Argument not specified for parameter 'Emp_ID' of
'Public Overridable Overloads Function InsertQueryEmp(Log_No As String, Emp_ID As String)
As Integer'.C:\Documents and Settings\HOn\Desktop\DIFINITION\DIFINITION\Form1.vb 20 17 DIFINITION
this is the error given..
|
|
|
|
|
That error says that you didn't supply a value for a parameter.
Looking at this code, it wouldn't work, even if it did compile. Your if statement doesn't make any sense at all.
if btnLogin.Text=true then
You comparing the Text property of a button to a boolean value?? Why?? Does this button actually say "true" on it when you click it??
I would highly suggest picking up a beginners book on VB.NET and working through it. You're missing some very basic (VB.NET 101) type concepts, and it's limiting your ability to write code and out ability to help you fix it.
|
|
|
|
|
actually tht is a part...my question is ragard once user enter their password..the datetimepicker will automatically store into database..
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click<br />
<br />
Dim Emp_IDDataRow As DataRow<br />
Emp_IDDataRow = Comdataset.EMPLOYEE_DETAIL.FindByEmp_ID(txtID.Text)<br />
<br />
If Emp_IDDataRow IsNot Nothing Then<br />
If txtPass.Text = Emp_IDDataRow!Password.ToString Then<br />
MessageBox.Show("Login Successful!", "infor", MessageBoxButtons.OK, MessageBoxIcon.Information)<br />
With Me<br />
if txtPass.text=true then<br />
.LOGIN_OUTTableAdapter.InsertQueryEmp(.Login_DateDateTimePicker.Value)<br />
.LOGIN_OUTTableAdapter.Fill(.Definition_dbDataSet._LOGIN_OUT)<br />
Else<br />
(part below for logout)<code><br />
.LOGIN_OUTTableAdapter.InsertQueryEmp(.Login_DateDateTimePicker.Value)<br />
.LOGIN_OUTTableAdapter.Fill(.Definition_dbDataSet._LOGIN_OUT)
End If
End With
Form2.Show()
Else
MessageBox.Show("Invalid Password!", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)
End If
Else
MessageBox.Show("Invalid ID", "ERROR", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error)
End If
this maybe can show more..thanks
error given me was
Error 2 Argument not specified for parameter 'Emp_ID' of
'Public Overridable Overloads Function InsertQueryEmp(Log_No As String, Emp_ID As String)
modified on Wednesday, April 9, 2008 9:30 PM
|
|
|
|
|
The error is correct, you are not supplying the function with the Emp_ID parameter.
In your code you are only passing a value to the Log_No parameter:
Member 4442916 wrote: .LOGIN_OUTTableAdapter.InsertQueryEmp(.Login_DateDateTimePicker.Value)
In your function you want two parameters to be determined:
Member 4442916 wrote: Error 2 Argument not specified for parameter 'Emp_ID' of
'Public Overridable Overloads Function InsertQueryEmp(Log_No As String, Emp_ID As String)
My advice is free, and you may get what you paid for.
|
|
|
|
|
I have a problem I have added a command to my crystal report that calls a stored procedure and should turn a number. I have also added a parameter to that procedure to make it dynamic. The problem I am experiencing is that when I bind this result to an unbound field the parameter doesn't change. It is static. And results in an error of having to Verify the Database to update the report. Is there another way I can do this. Is this a glitch with Crystal....
select test.pkg_s_e.get_cnt_ws('{?P_WS}') from dual
|
|
|
|
|
anyone can help me how to operate some code if the text in the textbox change, i want to make the auto send code but i didn't know, so i decide to make send code in textbox code, the situation is when the text in the textbox is change then the code will be operate..
please help me..
|
|
|
|