|
i have tried internet for it,,, but of no use
please if can then just give the code for it
""""""""""i m using currencymanager,, the radio button does not change when at run time i navigate my records"""""""""
the default button that i checked always remain checked
please help
|
|
|
|
|
What is currencymanager ? Is it a control on your form ?
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 )
|
|
|
|
|
i m usin data reader in my login form.
wat i want to do is by data reader i can read data from tables
that i created. n be able to open other forms accordingly.
.....the problem is that that when i run the application,,no matter what i type
it only shows me the matter of first text box "you r logged on as student".....
here is the code
Imports System.Windows.Forms.Form
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlCommand
Public Class logon
Inherits System.Windows.Forms.Form
Dim objsqlconn As SqlConnection
Dim logonselect As String = "select * from logon"
Dim objsqlcmd As New SqlCommand(logonselect, objsqlconn)
Dim dr As SqlDataReader
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
objsqlconn = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Administrator.WINXP_PRO_CORP.002\Desktop\WindowsApplication1\WindowsApplication1\Database1.mdf;Integrated Security=True;User Instance=True")
objsqlcmd = New SqlCommand
objsqlcmd.Connection = objsqlconn
objsqlconn.Open()
objsqlcmd.CommandType = Data.CommandType.Text
objsqlcmd.CommandText = "select * from logon"
dr = objsqlcmd.ExecuteReader()
Dim str As String
Dim a As New mdiparent
While dr.Read()
str = dr.GetString(0)
If str = "student" Then
MessageBox.Show("you are loged on as student")
a.Show()
End If
If str = "administrator" Then
MessageBox.Show("you are loged on as administrator")
a.Show()
End If
If str = "lass1" Or "lass2" Or "lass3" Or "lass4" Or "lass5" Or "lass6" Or "lass7" Or "lass8" Then
MessageBox.Show("you are loged on as lab assistant")
a.Show()
End If
End While
dr.Close()
objsqlconn.Close()
End Sub
Private Sub logon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Dispose()
End Sub
End Class
can somebody please tell me where the problem is????
|
|
|
|
|
You are not doing any filtering on your query. Do you only have one row in the database? Have you checked what str = dr.GetString(0) actually returns?
|
|
|
|
|
and also to make sure that the changes have been made.
i m using vb.net express edition 2005. i m being able to delete the row at
rum time.but it appear again,,if i stop n run the form again
please help
|
|
|
|
|
Hi,
The datagrid control only shows data, and allows you and/or the user to manipulate that data. deleting a row from the datagrid doesn't automatically delete it from the datagrid's data source.
So the question is, what do you use as the data source for your datagrid, and how did you bind it to it? If it is a datatable, how do you populate it? If it is a dataset, where does the dataset get its data from?
Or in other words, deleting the row from the datagrid only affects what you see at that moment. You will have to delete the row from the data source as well.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I know this is probably real simple but for some reason I can't figure it out...
how can I code my own custom eyedropper? Or something which can get the color of any specified pixel on the screen?
thanks!
|
|
|
|
|
I came across a VB 2003 IDE quirk. If you have variables referenced in a select case stament in a sub the quick watch window seems to have trouble interacting with ide and cannot display the value of the variable.
Specifically, I had a datatable defined inside the case statement. If I would add the datatable to the watch window all of its properties displayed "Error: cannot display value" in the value section of the watch. However wehen I moved all of the code in the case statement into its own sub the watch window behaved as i expected.
Not sure whats going on there, be refactoring the sub made things cleaner anyway.
|
|
|
|
|
Hi. Which type of dialog box can I use to show an information message while the code is running behind? The MessageBox stops the execution until the user press ok button.
I have a long process in an application, but can't use a progress bar because the process is called from just one code line that calls a dll method.
Regards,
Diego F.
|
|
|
|
|
You probably want to research the BackgroundWorker object. It allows you to run code on a new thread.
---------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
I'm not sure about how to use that object.
I have a call to a process that takes a long time and I want to show an animated gif while that process is running.
Should I put in the DoWork method the code that takes long time or the code that shows the animated gif?
Regards,
Diego F.
|
|
|
|
|
You will want to put the code that takes a long time in the DoWork event. However, it's a little tricky because when you run something on a different thread you can't just use class level variables or you will get a cross threading error. Parms have to be passed in through the background worker's argument property. It's too much to explain on the forums but I'm sure there are some articles on using the background worker...
Here is one: http://www.codeproject.com/csharp/backgroundworker.asp[^]
Here is another: http://www.codeproject.com/cs/threads/ImprovedThreading.asp[^]
Hope this helps.
--------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
I've been testing with that object. Is there any way to stop the execution until the second thread finish? I need that process to finish to avoid some errors.
Regards,
Diego F.
|
|
|
|
|
Yes. If you have code that needs to run only AFTER the background worker has finished you put that code in the RunWorkerCompleted event of the background worker control. This event fires once the background worker has completed it's code.
--------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
I can't do that, because the code needs access to main thread variables.
Regards,
Diego F.
|
|
|
|
|
Now I have the next problem
The combobox is placed on a tabcontrol and a tabpage that is not visible.
The combobox is databound
I set the selectedvalue to a existing value, but after selecting the tabpage the combobox is not set to that item.
If the tabpage is visible then it works fine.
Any suggestions ?
|
|
|
|
|
Your question doesn't make sense. How can you select a tabpage that isn't visible? Could you please provide more information about what you are doing and how you want the program to work? You may want to check if there is code for loading the tab page which may clear the combobox selection.
----------------------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
Sorry
The combobox is placed in a usercontrol wich is placed on a tabpage.
By clicking on a button that is placed outside the tabcontrol, al the tabpages have to fill with the correct data. on that moment the first tabpage is visible (selected) tabpage 2 an 3 are not visible
the comboboxes in my usercontrol on tabpage 1 are filled correct, but those on the other tabpages are filled but the item I selected with selectedvalue are not shown
If I reload the form and select the second tabpage before cliking on the same button then the combobox on the second tabpage is ok, but the combobox on the first tabpage not.
I hope this is a better explanation
thx
|
|
|
|
|
Sometimes I have problems with selecting values from comboboxes when they are set up with a datasource...You could play around with using the SelectedItem, SelectedText or SelectedValue to see if one of those works...
This probably isn't the case, though since you can get it to work if the second tabpage is selected first.
It sounds like it is clearing or reloading when you select a tab page. You could check that event to see if you have some code that is doing it.
Perhaps as a work around you could load the controls for each tab page as they are selected instead of loading them all at once.
I'm sorry I can't help any more than that. I don't have much experience with UserControls and I've only dealt with tab pages in a mobile project. Good luck.
-------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
Thanks
I made the mistake that I put the selectedvalue before loading the data in the combobox, because I have put the code in the property of my custom control that selected the item. Those code was executed before the load instructions.
So by telling that the problem could be the reloading I' ve found the solution
|
|
|
|
|
Glad I could help.
--------------------------------------------------
Play Nation States and join The Code Project region with the password: byalmightybob
|
|
|
|
|
In VB 2005 Express:
If I set a MaskedTextBox, TextBox and ComboBox side by side with the same font, the Size.Height is set to 20, 20 and 22 respectively.
I have not figured out how to set the MaskedTextBox height. Whenever I change it, the IDE just sets it back to 20. So I cannot resize it to fit with the ComboBox.
The TextBox can get resizing if I set it MultiLine. Setting MaxLength seems to help the wrap-around issues for now.
The ComboBox allows some resizing if you set its DropDownStyle to Simple and IntegralHeight to False. However, if you set it to 20, then the bottom line of the control is missing.
VB6 and .NET 2003 let you set the height without any problems.
Do any of you know how to overcome this? I have a form with several controls that I am trying to give a uniformed look, but this is causing either gaps or overlapping to work around the problem.
|
|
|
|
|
I need to know some pretty simple stuff that doesn't seem to be out there or maybe i'm searching for the wrong terminology. I am Visual Studio 2005 and am making a setup project for a program. How do I tell windows installer 3.1 to put shortcuts to just .exe file on the desktop? Also, how do I direct it to put the database in a different folder than the program folder?
thanks in advance
|
|
|
|
|
That's way beyond the VS installer's capabilities (being just for basic setups). I would suggest a stand-alone installer like NSIS for an advanced setup, or Install Creator for something simple.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Hello,
I have my own application with uses msstdfmt.dll via "Data Format" property of Lable control. As i believe we can distribute VB runtime dll MSVBVM60.dll by including in our installable. I want to know whether is it ok to distribute msstdfmt.dll also? Otherwise the machine where my application is going to run needs to have VB installed. But i don't want to install VB. Instead of that if that machine is having this msstdfmt.dll and register then it will work.
Can any one let me any legal articles found about this dll?
best regards,
kirrik
|
|
|
|