|
It is difficult to help you without more info. Where is the error being thrown? How is the FontColor setting defined? (Application settings cannot be altered and persisted at runtime, so you need to make sure it is defined as a User setting).
|
|
|
|
|
Well, I thought I was explaining it the best I could, but I guess I could do better. Well, my startup form Index is the one that needs to be able to load the settings for cdgFont(the Color Dialog control), and The code I tried to use is here:
Private Sub Index_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Prefs.cdgFont.Color = My.Settings.FontColor
Prefs.cdgBackground.Color = My.Settings.Background
Prefs.UpdateCheckState()
End Sub
And that code is not loading it up like it should. Here is the code for my button(in the Prefs form) that is supposed to save the application settings. By the way, all my strings are set to User.
Private Sub btnFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFont.Click
'Declare the variables
cdgFont.Color = My.Settings.FontColor
'Show the Color Dialog
If cdgFont.ShowDialog = Windows.Forms.DialogResult.OK Then
'Set the FontColor property of the form
Index.txtFile.ForeColor = cdgFont.Color
My.Settings.FontColor = cdgFont.Color
End If
End Sub
My problem is that the program is NOT saving the information, so when I load up the Index form, the settings that should have been saved, are not, or maybe they are, and they do not load up, please help.
I'm new...
|
|
|
|
|
i try to have an SQL to show the data that is between today date and the specific date which is 2 months b4 the specific date. but i just cant get it write
sql = "select * from SoftContract where BETWEEN [ContractEnd]AND NOW "
i try many way like where [ContractEnd]-NOW =60 , contractend >=now AND now <60 but not really got the result i want
anyone can help?
|
|
|
|
|
If you are looking to return all records between [ContractEnd] and two months before, the WHERE clause should be something like:
WHERE [ContractEnd] BETWEEN DATEADD(MONTH, -2, [ContractEnd]) AND [ContractEnd]
Hope this helps.
|
|
|
|
|
there is error when i use that,
Run-time error
no value given for one or more required parameters
highlight---> Adodc1.Refresh
i wonder y dateadd?
Actually i want to show it in datagrid so there will be many data show if the value is there.
-- modified at 23:43 Sunday 20th August, 2006
|
|
|
|
|
What type of database are you executing this query against? Also, it would be helpful if you could better explain exactly what data you are trying to return and post the entire query you are currently executing.
|
|
|
|
|
i use microsoft access as the database .mdb
I have create a button to run that function to show the result in a data grid in VB
Here the coding::
Private Sub Image3_Click()
MsgBox ("Following are customer contract that going to expire in the next 2 months.")
sql = "select * from SoftContract WHERE [ContractEnd] BETWEEN DATEADD(MONTH, -2, [ContractEnd]) AND [ContractEnd]"
Adodc1.RecordSource = sql
Adodc1.Refresh
DataGrid1.Visible = True
Adodc1.Visible = True
showtotal
End Sub
|
|
|
|
|
The syntax is different in Access. Use "m" instead of MONTH.
---
b { font-weight: normal; }
|
|
|
|
|
i try it but thinks not that error cause if syntax error it will show the msg
|
|
|
|
|
No, there will not be a syntax error, as the syntax is valid.
It will think that MONTH is a parameter that you want to pass to the query, and as you don't pass any parameters to the query, the error message will be that it is missing parameters.
---
b { font-weight: normal; }
|
|
|
|
|
Ok, since you want to return the data where [ContractEnd] is between today's date and two months from today's date, the where clause would be:
WHERE [ContractEnd] BETWEEN NOW AND DATEADD("m", 2, NOW)
I am relying on guffa's post for the Access syntax here, as I haven't used Access in many years. This should return all the records from your table where the [ContractEnd] falls between today's date and two months from today's date.
Hope this helps.
-- modified at 8:08 Monday 21st August, 2006
|
|
|
|
|
yes i got it work.
is with the single quote '
thanks
WHERE [ContractEnd] BETWEEN NOW AND DATEADD('m', 2, NOW)
i was trying to enchance it to let user to search their own specific month but it not really working when i place a varible with it. Is it not allow to put variable inside? Example:
----
Public userin
userin = InputBox("Search data (Month)", "How many month do you want to check before the expire date?")
WHERE [ContractEnd] BETWEEN NOW AND DATEADD('m', userin, NOW)
|
|
|
|
|
Are you receiving an error, or is it just giving unexpected data?
|
|
|
|
|
recieve error
Run-time error
no value given for one or more required parameters
|
|
|
|
|
Ok, you will need to create the SQL Query string to incorporate the user's input. The way you are trying to do it is causing the Database to treat userin as a parameter.
Dim myQuery as String
myQuery = "SELECT yourFields FROM yourTables WHERE [ContractEnd] BETWEEN NOW AND DATEADD('m'," & userin & ",NOW)"
This simply concatenates the string to include the user input. Of course, it is likely better to create a parameter for the user's input in the query, then pass the user's input to it. I am not sure how you would do this in Access, as I have not used it in many years.
-- modified at 23:07 Monday 21st August, 2006
|
|
|
|
|
|
I am using visual studio .net 2002 i installed it in win-2000.
the software is running effectively in 2000.
.exe file which are made in vb.net are not running in XP why?
|
|
|
|
|
YOu haven't supplied enough information to solve the problem. Are there any error messages? What does this app do? What function of this app isn't working? Is there anything in the event logs that pertains to your app? Is the .NET Framework 1.0 installed on the XP machine?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I've no idea.
What do you mean by "not running in XP"?
|
|
|
|
|
the problem is "the software which is made in vb.net on win 2000 amd succesfully executed is not running on win-xp"
the errror shown as "the application is failed to initialize proprly"
|
|
|
|
|
Does the XP machine have the .NET Framework 1.0 installed??
Get it here[^] if it's not.
Visual Studio .NET 2002 -> .NET Framework 1.0
Visual Studio .NET 2003 -> .NET Framework 1.1
Visual Studio .NET 2005 -> .NET Framework 2.0
-- modified at 15:59 Monday 21st August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am moving to VS 2005 and .Net 2.0
Could anyone recommend books on all forms of .Net 2.0 programming, ASP.NET, VB.NET, ADO.NET, Forms 2.0 etc
Also for SQL Server 2005.
Many thanks.
Steve
-- modified at 13:17 Sunday 20th August, 2006
|
|
|
|
|
There are plenty of books on all these topics and you will get different answers from different people! If you already have experience of .NET 1.1 you should be able to get by quite well just by reading the online resources as and when you need them. If you're new to .NET as such - well, I learnt initially from Jesse Liberty's "Programming C#" book.He has one for VB as well. I also bought his Programming ASP.NET book, which is in both C# and VB. The only .NET 2 book I've got so far is Professional .NET Generics. But then I haven't used .NET 2 very much yet except to do a bit of stuff with my personal web site. At work we're still on .NET 1.1.
Kevin
|
|
|
|
|
Thanks for your input.
I have got an MCSD in .NET 1.1 so I'm fairly familiar with that. I do feel that I need to update my skills to .NET 2.0 and SQL Server 2005.
I've had no real need for it as yet, but I would like to know more about it before I am thrown in the deep end!
I learned for a long time from the Microsoft books. It was quite some time before I realised that other people are so much better at teaching than Microsoft are. I just want to know if anyone has any recommendations, so that I don't have to battle with Microsoft's grammar again! I was also surprised of how much they actually have WRONG in their books...
Steve
|
|
|
|
|
If you're an MCSD I'm sure you'll get along just fine without books.
Kevin
|
|
|
|