|
Your question isn't very clear. Are you saying that this application uses an SQL Server or you application needs one and you're looking for a smallish SQL Server?? Or, are you looking to store a small amount of information somewhere and you want to know the best place to put it??
|
|
|
|
|
the latter, looking to store data, need to know where to put it. I was trying to explain at my job I work with large amounts of data, don't know much about storing small amounts of data.
Mark Thibodeaux
|
|
|
|
|
In that case, I'd say store the data as an XML file in the users Application Data folder. If you need to store the data for multiple users on the same machine, use the Common Application Data folder.
You can build the path to the file using the Environment.GetFolderPath[^] method using an appropriate SpecialFolder[^] enum value and the Path.Combine[^] method.
There are various methods for building a XML file, from using XmlDocument to file stream methods to the very easy DataSet/DataTable WriteXml methods.
|
|
|
|
|
tibmark wrote: What is the best way to store a small amount of data that the user does not have access to
In the file system, for the user to be able to save the data somewhere they must have access (permissions) to it. I'd suggest making a directory for your program under the user's "Application Data" directory. (Could also use the user's registry if the number of list items isn't too excessive.)
I guess you could encrypt the files' contents or registry keys if you really didn't want the user to be able to read the files outside your program.
|
|
|
|
|
what kind of file? .txt?
Mark Thibodeaux
|
|
|
|
|
You can store as a config or an xml by the sound of what you want to do.
|
|
|
|
|
I am having trouble figuring out how to validate some dates. I have to read them in from an excel file and put the into access. The problem is if a null value is entered for a date in the excel file. null values are allowed int the db but I can't pass them through my "insert command". Any suggestions?
All help is welcome
Insert code below:
Sub IncidentReportAdd(ByVal IncNo As String, ByVal IncType As String, ByVal estate As String, _
ByVal MTI As System.DateTime, ByVal INATT As System.DateTime, _
ByVal stopTime As System.DateTime, ByVal MAV As System.DateTime, ---etc....)
Dim cmd As OleDbCommand = New OleDbCommand()
Dim paramContNo As New OleDbParameter()
Dim paramIncDescription As New OleDbParameter()
Dim paramAdd1 As New OleDbParameter()
etc...
With paramContNo
.ParameterName = "ContNo"
.OleDbType = OleDbType.Double
.Size = 4
.Value = splitCont.GetValue(1)
End With
cmd.Parameters.Add(paramContNo)
With paramTimeStop
.ParameterName = "Stop"
.OleDbType = OleDbType..Value = stopTime
End With
cmd.Parameters.Add(paramTimeStop)
Dim param As OleDbParameter
For Each param In cmd.Parameters
If param.OleDbType = OleDbType.VarChar Then
If param.Value = "" Then
param.Value = "null"
End If
End If
Next
'execute command
cmd.CommandText = "EXECUTE ActivityBufferInsert"
con.Open()
cmd.ExecuteNonQuery()
con.Close()
>>
>>the code is called here:
>>
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" _
& "data source=" & e.FullPath & "; " & "Extended Properties=Excel 8.0;")
Dim DtSet As New DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [sheet1$]", MyConnection)
MyCommand.Fill(DtSet, "ExcelFields")
MyConnection.Close()
Dim ir As New DBTier
Dim dr As DataRow
For Each dr In DtSet.Tables("ExcelFields").Rows()
ir.IncidentReportAdd(dr.ItemArray(0).ToString(), dr.ItemArray(1).ToString(), _
dr.ItemArray(5).ToString(), dr.ItemArray(7).ToString(), dr.ItemArray(2).ToString(), _
dr.ItemArray(8).ToString(), dr.ItemArray(10).ToString(), dr.ItemArray(12).ToString(), _
Date.Parse(dr.ItemArray(13).ToString()), Date.Parse(dr.ItemArray(14).ToString()), _
Date.Parse(dr.ItemArray(15).ToString()), Date.Parse(dr.ItemArray(16).ToString()), _
Date.Parse(dr.ItemArray(18).ToString()), Date.Parse(dr.ItemArray(19).ToString()), _
dr.ItemArray(21).ToString())
Next
I know it's a lot to read through but any help would be greatly appreciated.
|
|
|
|
|
Well, you're biggest problem is that teh .NET 2.0 DateTime type is a structure, not a class, and therefore cannot ever be Nothing (null in C#). So, Date.Parse will fail when trying to parse String.Empty or any invalid date representation (including Nothing) into a Date value.
You're going to have to provide code that you can call with a value from each column from your Excel data that returns either a correct Date object or returns a DBNull value, possibly using Date's TryParse method. The existing Date structure methods won't do this for you.
You also have a problem with your database table using a string to represent a Date instead of the database's native DateTime type for a column. You'll have to rewrite your IncidentReportAdd method to accept Date objects instead of strings representing dates.
|
|
|
|
|
I am using VS2005, .net framework 2.0. The program is used to collect and display data from a uSB DAQ. I created the installation file using Inno SetUP. I can install and run the program on any Vista machine without any problem. If I try to run this program on XP machine, it comes up with a general error:
"MyApplication" has encountered a problem and needs to close. We are sorry for the inconvenience.
It installs without any probem, the error comes up when i run the application.
If I copy and run the same program on a XP machine and create an installation file, use this file to install the program on XP computer, it runs just fine.
Does that mean I cannot develop programs on Vista and distribute it to XP customers?
|
|
|
|
|
Chun2 wrote: Does that mean I cannot develop programs on Vista and distribute it to XP customers?
No, it doesn't. Somewhere along the line, the generated installation is missing something. You may want to ask the InnoSetup people about this.
|
|
|
|
|
Dave, Thanks for your response.
I did "build solution", then copied all the files in MyApplication\...bin\release folder from Vista machine to XP machine, run the MyApplication.exe file and got the same error. Then I tried the same with MyApplication\...bin\debug folder. Same error. If the application is developed on XP machine and I copy bin\release folder to another XP machine, the program runs just fine. The error comes up when the files are copied from Vista to XP computer.
So, I dont think it the error is linked to inno setup. Do you have any suggestions on how to solve this problem. How can I distribute my application developed on Vista to XP customers?
|
|
|
|
|
Chun2 wrote: I did "build solution", then copied all the files in MyApplication\...bin\release folder from Vista machine to XP machine, run the MyApplication.exe file and got the same error. Then I tried the same with MyApplication\...bin\debug folder. Same error. If the application is developed on XP machine and I copy bin\release folder to another XP machine, the program runs just fine. The error comes up when the files are copied from Vista to XP computer.
OK. That's not what your original post implied.
If you've copied the entire Debug folder over to the XP machine, it should have worked. Does the code compiled on XP and copied over to Vista work?? Is either one of these machines a 64-bit copy of Windows? Do all machines involved (XP and Vista) have .NET Framework 2.0 Service Pack 1 installed??
|
|
|
|
|
I tried copying the folders after you suggest that problem may be with Inno Setup.
If I copy the entire bin\debug folder from XP to Vista, the application runs without any problem.
I am using 3 computers. 1) One laptop with XP home - for testing the application developed on XP and Vista. 2) A Desktop with XP pro and VS 2005 installed. 3) The laptop which I use for developing applications. It has Vista Business edition and VS 2005.
All computers have 32-bit copy of windows.
I checked in Add/remove programs and verified that I have .net 2.0 with SP1 on both XP machines.
Surprisingly, I could not find .net 2.0 SP1 on Vista laptop! I assumed that If I have VS2005 and my program requires .net 2.0 to run, I would have .net 2.0. Also, the installation file I created, automatically install .net 2.0, if it was not installed already. So I think it must be installed on Vista machine, but I cant find it!
Do I need to install .net 2.0 sp1 on vista machine.. i m confused.
How can I run application developed on XP with .net 2.0 sp1 on Vista machine if it doesnot have .net 2.0?
modified on Friday, April 4, 2008 1:28 PM
|
|
|
|
|
If you're running Visaul Studio 2005, you MUST have the .NET Framework 2.0 installed as well. VS2005 won't run without it. The question is do you have Service Pack 1 for .NET 2.0 installed??
|
|
|
|
|
No, I don't have SP1. I cannot find Service Pack 1 for .net 2.0 for Vista on the internet.
1)Do I need to install 3.5 framework which comes with .net 2.0 sp1 for vista
2)I came across "Microsoft® Visual Studio® 2005 Express Editions Service Pack 1", is it necessary to install this SP too?
modified on Friday, April 4, 2008 2:34 PM
|
|
|
|
|
Chun2 wrote: No, I don't have SP1. I cannot find Service Pack 1 for .net 2.0 on Vista.
It's not "for Vista", it's for the .NET Framework 2.0. Here[^]
Chun2 wrote: 1)Do I need to install 3.5 framework which comes with .net sp1 for vista
No.
Chun2 wrote: which comes with .net sp1 for vista
There's no such thing as ".net sp1 for Vista".
Chun2 wrote: 2)I came across "Microsoft® Visual Studio® 2005 Express Editions Service Pack 1", is it necessary to install this SP?
No. That's the service pack for Visual Studio 2005 Express. It has nothing to do with Vista or .NET 2.0.
*** UPDATE ***
It turns out that the reason the normal SP1 pack won't work on Vista is because Vista uses a different Update installation engine. Installing .NET Framework 3.5[^] also installs the SP1 for .NET 2.0, as well as .NET 3.0 with it's SP1. That link downloads the installer that works on Vista.
What a pain...
|
|
|
|
|
Thank you Dave. I will try installing .net framework 3.5 and I hope it will solve the problem. I appreciate your help.
|
|
|
|
|
I installed .Net framework 3.5 on the Vista computer, restarted the computer, complied the code again, copied the debug folder to XP computer and then tried to run the application. I am still getting the same error. Under Control Panel --> Programs and features --> it shows framework 1.1, framework 1.1 hotfix (KB929729) and framework 3.5
Any suggestions plzz???
|
|
|
|
|
You have checked the .NET Framework 2 is already installed on the destination PC and if not your installer installs it?
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Yes, .net 2.0 is installed on all the computers. The application developed on XP machine, runs on any other XP machine with .net 2.0. However, application developed on Vista doesnot run on XP with .net 2.0 installed on it.
|
|
|
|
|
Just a crazy shot in the dark and hopefully it wasn't already asked: Is the Vista computer 64-bit and the XP computer 32-bit? A 32-bit executable from XP would run on the 64-bit Vista but not vice-versa.
|
|
|
|
|
Thank you for responding. all the computers are 32-bit and have .net 2.0. However, XP pc had SP1 for .net 2.0 but vista didnot. I will try installing .net 3.5 on Vista and see if it solves the problem.
|
|
|
|
|
Hi I hate to tell you but installing .net 3.5 doesn't help. I'm having the same problem.
I've written my program on a vista machine, using vb 2005 and Inno step to install. Like you I've copied over all relevant files etc for install. Works fine on Vista machines but, is using .net 3.5 automatically to compile even though I'm installin .net 2.0. Apparently, Vista automatically updated to .net 3.5 in an upgrade.
What I'm trying to find out is how I can overrun 3.5 and tell the computer to use 2.0?
Complicated, just so you know you're not on your own.
Kris MCP
|
|
|
|
|
Hi Friends,
I have developed one application in vb 6.0 with msaccess as backend.
I am using the following Connection string.
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\deep1\overtime log\Overtime Log\Data\OT_Log.mdb"
In the above line, deep1 is the server name(System name) where the database mdb file is located. the folder overtime log is shared folder.
I packed the application and installing in others system. This is working fine for some of the people and they can able to login inside the application and give data...and I Checked their entries are presented over deep1-Sever mdb file.
But some of us cannot login since, the network could not find the path deep1. So its not logging in. But if they try with the servers ip address they can go inside.
But the problem is the server's ip address will change dynamically. So in code i cannot give ipaddress also. So only that I have given the system name.
The persons who are all in different subnet in network cannot able to access with system name.
Can anyone please help me out.
I m very thankful to you.
Thanks in advance,
Regards
|
|
|
|
|
are these people that can't login able to do a DNS lookup? if not, then your kind of out of luck using APIs to be able to resolve the ip address of deep1. if they can, here's a link to some code that might help you... haven't tested it but looks good...
http://www.mvps.org/access/api/api0067.htm
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|