|
Good Morning fellows,
I always use the following procedure to receive Data from
the Jet-Engine or even from the MS-SQL-Server
Imports System.Data.OleDb
...
Dim oOleDbConnection As OleDbConnection
Dim DBAdapt As OleDbDataAdapter
Dim DT As New DataTable
DIM SQLT as String
Dim DBPath as String
'***Don't forget to specify the correct databasepath
DBPath="C:\mypath\nwind.mdb"
Dim sConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & DBPath & ";" & _
"User ID=Admin;" & _
"Password="
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
'***check if the Connection had opened correct. If not
'***you receive a first tip where the probleme might be
If oOleDbConnection.State = ConnectionState.Open Then
'***Set the SQL-Statement
SQLT="Select * from Customer;"
'***Create a new Adapter-Object
Dim DBAdapt As New OleDbDataAdapter(SQLT, oOleDbConnection)
'***Because of the fact that we only select Data from one Table
'***it is enough to use a DataTable Object instead of a DataSet
'***And now lets fill it!
OleDbDataAdapter.Fill(DT)
'***we don't need the connection to be open longer, so lets close it.
oOleDbConnection.Close()
'***it will be better to give a Name to the DataTable....
DT.TableName="Customer"
'***lets bind the DataTable to a DataGridView
DGV.DataSource=DT
'***Thats all! This should work!
Else
Call MsGBox("Connection not open!")
End If
|
|
|
|
|
Hi,
I want to create application when i click button i want to show the from like Yahoo Messenger show when user come online,
Please help me
Thanks
Socheat
|
|
|
|
|
hi,
if you search code project, then you can find article about popup form. I already read this article which is in C# but i forget the web address. However i convert it in vb.net .So converted code is following
import statement are following
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
private variable declaration statement and other sub procedure
<br />
Public Class PopUpForm<br />
<br />
Dim X As Integer = 0<br />
Dim Y As Integer = 0 <br />
Private Sub PopUpForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
'*The Screen.GetWorkingArea(control) will provide you the working<br />
'area of a screen without the system tray area. The working area <br />
'depends on the resolution of your monitor*/<br />
<br />
X = Screen.GetWorkingArea(Me).Width ' This line gives the width of working area<br />
Y = Screen.GetWorkingArea(Me).Height ' This line gives the width of working area <br />
Me.Location = New Point(X - Me.Width, Y + Me.Height) ' This line sets the initial location of the form<br />
<br />
Timer1.Enabled = True<br />
Timer1.Start() ' We'll start the timer which handles the opening of form.<br />
End Sub<br />
<br />
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
' The logic is that, first we will open the form below<br />
' taskbar at specified location and then in Timer's TICK event <br />
' we() 'll just bring the form above taskbar to have the animated <br />
' effect.<br />
Dim i As Integer<br />
<br />
i = Me.Location.Y ' First we will know form's Y-axis location<br />
' which will act as upper limit for form's location<br />
If (i > Y - Me.Height) Then<br />
<br />
Me.Location = New Point(X - Me.Width, i - 8) ' Here we just change the location<br />
' of form by 8 pixels(i-8)<br />
<br />
Else ' else we stop Timer1 and start Timer3 which holds the form for some time<br />
<br />
Timer1.Stop()<br />
Timer1.Enabled = False<br />
<br />
Timer3.Start()<br />
Timer3.Enabled = True<br />
End If<br />
End Sub<br />
<br />
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick<br />
<br />
'Here the logic is same as opening the form, only location value of Y-axis<br />
'is increased, so that form slowly hides behind Task Bar.<br />
<br />
Timer3.Stop()<br />
Timer3.Enabled = False<br />
Dim i As Integer<br />
i = Me.Location.Y<br />
If (i < Y) Then<br />
Me.Location = New Point(X - Me.Width, i + 8)<br />
Else<br />
Timer2.Stop()<br />
Timer2.Enabled = False<br />
Me.Close()<br />
End If<br />
End Sub<br />
<br />
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick<br />
Timer2.Start() ' Here we start Timer2 which handles closing of form<br />
Timer2.Enabled = True<br />
End Sub<br />
End Class
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
see this below code, which is generate a popup form at runtime.
This code from my DLL application ,
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Drawing.Drawing2D
'===================================================
'
' Module : Atm_rs232_GSMGPRS
' Description : Class for handling RS232 communication with VB.Net 2005 and
' sending SMS and Data Dialing through Serial Port
' Created : 26/04/2007 08:30:00
' Author : Rajesh B ---A poor workman blames his tools---
' Company : Analogics Tech. India Limited. Hyderabad.
''-----------------------------------------------------------------------------------------------
Public Class AnalogicWindows
Public SMSPopupform As New Form
Public SMSPopupPICBOX As New PictureBox
Public analink As New LinkLabel
Public footlbl As New Label
Public popuptext As New Label
Public backcolor1 As New Color
Public backcolor2 As New Color
Private smsimg As Bitmap = New Bitmap(Application.StartupPath & "\images\sms.bmp")
Private portimg As Bitmap = New Bitmap(Application.StartupPath & "\images\port.bmp")
'//////////////////////////////////////////////////
' Method: getlinklabl
' FullName: AnalogicWindows.getlinklabl
' Access: public
' Returns: String)
' Parameter: ByVal popuptextmsg As String
'//////////////////////////////////////////////////
Public Sub getlinklabl(ByVal popuptextmsg As String)
'analink.AutoSize = True
'analink.Font = New System.Drawing.Font("Verdana", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'analink.LinkColor = System.Drawing.Color.Red
'analink.Location = New System.Drawing.Point(154, 85)
'analink.Name = "LinkLabel1"
'analink.Size = New System.Drawing.Size(224, 17)
'analink.TabIndex = 0
'analink.TabStop = True
'analink.Text = "http://analogicgroup.com"
'analink.BackColor = Color.Transparent
'footlbl.AutoSize = True
'footlbl.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
'footlbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
'footlbl.ForeColor = System.Drawing.Color.White
'footlbl.Location = New System.Drawing.Point(58, 105)
'footlbl.Name = "Label2"
'footlbl.Size = New System.Drawing.Size(192, 16)
'footlbl.TabIndex = 3
'footlbl.Text = "ANALOGIC CAMR Network Server 2.0"
'footlbl.BackColor = Color.Transparent
popuptext.BackColor = Color.Transparent
popuptext.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
popuptext.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
popuptext.ForeColor = System.Drawing.Color.WhiteSmoke
popuptext.Location = New System.Drawing.Point(56, 18)
popuptext.Name = "RichTextBox1"
popuptext.Size = New System.Drawing.Size(210, 57)
popuptext.TabIndex = 4
popuptext.Text = popuptextmsg
End Sub
''SMSPopup Properties
'//////////////////////////////////////////////////
' Method: Generate_SMSPopup
' FullName: AnalogicWindows.Generate_SMSPopup
' Access: public
' Returns: String, ByVal Showtext As String)
' Parameter: ByVal Maintitle As String
' Parameter: ByVal Showtext As String
'//////////////////////////////////////////////////
Public Sub Generate_SMSPopup(ByVal Maintitle As String, ByVal Showtext As String)
Dim octform As Double
Call getlinklabl(Showtext)
backcolor1 = Color.Pink
backcolor1 = Color.LightBlue
SMSPopupform.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
SMSPopupform.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
SMSPopupform.BackColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(255, Byte), Integer))
SMSPopupform.ClientSize = New System.Drawing.Size(350, 130)
SMSPopupform.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
SMSPopupform.Location = New System.Drawing.Point(674, 612)
SMSPopupform.Name = "Form1"
SMSPopupform.StartPosition = System.Windows.Forms.FormStartPosition.Manual
SMSPopupform.Text = Maintitle
SMSPopupform.ResumeLayout(False)
SMSPopupform.ShowInTaskbar = False
SMSPopupform.TopMost = True
'' For Picture box
'SMSPopupPICBOX.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
SMSPopupPICBOX.Location = New System.Drawing.Point(1, 0)
SMSPopupPICBOX.Name = "PictureBox1"
SMSPopupPICBOX.Size = New System.Drawing.Size(125, 110)
'SMSPopupPICBOX.Image = newimg.GetThumbnailImage(79, 39, Nothing, Nothing)
SMSPopupPICBOX.Image = smsimg
'SMSPopupPICBOX.Load(Application.StartupPath & "\temp.bmp")
SMSPopupPICBOX.TabStop = False
SMSPopupform.Controls.Add(footlbl)
SMSPopupform.Controls.Add(SMSPopupPICBOX)
SMSPopupform.Controls.Add(analink)
SMSPopupform.Controls.Add(popuptext)
AddHandler SMSPopupform.Paint, AddressOf SMSPopup
SMSPopupform.Show()
For octform = 0 To 100 Step 0.06
SMSPopupform.Opacity = octform / 100
System.Threading.Thread.Sleep(0)
Application.DoEvents()
Next
SMSPopupform.Location = New System.Drawing.Point(674, 612)
Delay(800)
For octform = 100 To 0 Step -0.06
SMSPopupform.Opacity = octform / 100
System.Threading.Thread.Sleep(0)
Application.DoEvents()
Next
SMSPopupform.Hide()
End Sub
''SMSPopup Properties
'//////////////////////////////////////////////////
' Method: Generate_PortPopup
' FullName: AnalogicWindows.Generate_PortPopup
' Access: public
' Returns: String, ByVal Porttext As String)
' Parameter: ByVal Maintitle As String
' Parameter: ByVal Porttext As String
'//////////////////////////////////////////////////
Public Sub Generate_PortPopup(ByVal Maintitle As String, ByVal Porttext As String, ByVal imgtype As Integer)
Dim backBG As Bitmap = New Bitmap(Application.StartupPath & "\images\PopUp-BG.gif")
Dim popuppic As Bitmap
If imgtype = 1 Then
popuppic = New Bitmap(Application.StartupPath & "\images\Cable-detected.gif")
ElseIf imgtype = 2 Then
popuppic = New Bitmap(Application.StartupPath & "\images\CableUnpluged_Anim.gif")
Else
popuppic = New Bitmap(Application.StartupPath & "\images\CableBUSY_anim.gif")
End If
Dim octform As Double
Call getlinklabl(Porttext)
backcolor1 = Color.GreenYellow
backcolor1 = Color.Violet
SMSPopupform.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
SMSPopupform.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
'SMSPopupform.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(128, Byte), Integer))
SMSPopupform.ClientSize = New System.Drawing.Size(300, 94)
SMSPopupform.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
SMSPopupform.Location = New System.Drawing.Point(725, 640)
SMSPopupform.Name = "Form1"
SMSPopupform.StartPosition = System.Windows.Forms.FormStartPosition.Manual
SMSPopupform.Text = Maintitle
SMSPopupform.ResumeLayout(False)
SMSPopupform.ShowInTaskbar = False
SMSPopupform.TransparencyKey = System.Drawing.SystemColors.ButtonFace
SMSPopupform.BackgroundImage = backBG
SMSPopupform.TopMost = True
'' For Picture box
'SMSPopupPICBOX.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
SMSPopupPICBOX.Location = New System.Drawing.Point(4, 0)
SMSPopupPICBOX.Name = "PictureBox1"
SMSPopupPICBOX.Size = New System.Drawing.Size(74, 92)
SMSPopupPICBOX.Image = popuppic
SMSPopupPICBOX.TabStop = False
'SMSPopupPICBOX.Image = portimg
'SMSPopupform.Controls.Add(footlbl)
SMSPopupform.Controls.Add(SMSPopupPICBOX)
'SMSPopupform.Controls.Add(analink)
SMSPopupform.Controls.Add(popuptext)
'SMSPopupPICBOX.ImageLocation = Application.StartupPath & "\temp.bmp"
SMSPopupform.Show()
For octform = 0 To 100 Step 0.06
SMSPopupform.Opacity = octform / 100
Application.DoEvents()
Next
SMSPopupform.Location = New System.Drawing.Point(725, 640)
Delay(2000)
For octform = 100 To 0 Step -0.06
SMSPopupform.Opacity = octform / 100
Application.DoEvents()
Next
SMSPopupform.Hide()
End Sub
'//////////////////////////////////////////////////
' Method: SMSPopup
' FullName: AnalogicWindows.SMSPopup
' Access: public
' Returns: Object, ByVal e As System.Windows.Forms.PaintEventArgs)
' Parameter: ByVal sender As Object
' Parameter: ByVal e As System.Windows.Forms.PaintEventArgs
'//////////////////////////////////////////////////
Public Sub SMSPopup(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
Dim mp As GraphicsPath = New GraphicsPath()
Dim myrect As New Rectangle(0, 0, SMSPopupform.Width, SMSPopupform.Height)
Dim c1, c2, c3, c4 As Color
c1 = Color.Black
c2 = Color.Transparent
c3 = backcolor1
c4 = backcolor2
Dim mypenbrush As New LinearGradientBrush(myrect, c1, c2, LinearGradientMode.Vertical)
Dim mybrush As New LinearGradientBrush(myrect, c3, c4, LinearGradientMode.ForwardDiagonal)
Dim mypen As New Pen(mypenbrush, 10)
Dim itpen As New Pen(Color.Transparent)
Dim myfont As New Font("Arial", 25, FontStyle.Bold)
e.Graphics.DrawRectangle(mypen, myrect)
e.Graphics.FillRectangle(mybrush, myrect)
'e.Graphics.DrawImage(PictureBox1.Image, 0, 0)
mp.AddRectangle(myrect)
SMSPopupform.Region = New Region(mp)
End Sub
'//////////////////////////////////////////////////
' Method: graphCalendarDateToXLDate
' FullName: AnalogicWindows.graphCalendarDateToXLDate
' Access: public
' Returns: Double
' Parameter: ByVal year As Integer
' Parameter: ByVal month As Integer
' Parameter: ByVal day As Integer
' Parameter: ByVal hour As Integer
' Parameter: ByVal minute As Integer
' Parameter: ByVal second As Integer
' Parameter: ByVal millisecond As Double
'//////////////////////////////////////////////////
Public Function graphCalendarDateToXLDate(ByVal year As Integer, ByVal month As Integer, ByVal day As Integer, ByVal hour As Integer, ByVal minute As Integer, ByVal second As Integer, ByVal millisecond As Double) As Double
Dim ms As Double = millisecond
graph_NormalizeCalendarDate(year, month, day, hour, minute, second, ms)
Return graph_CalendarDateToXLDate(year, month, day, hour, minute, second, ms)
End Function
End Class
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
One, this post is just too long to be of any use, especially since a bunch of code is commented out. It's too loarge to be of any use as a sample that can be learned from.
Second, SHORTEN YOUR NAME! You don't need "-- A Poor Workman Blames His Tools --" as part of your name. Make it part of your signature instead.
|
|
|
|
|
Dave Kreskowiak wrote: SHORTEN YOUR NAME!
Most irritating thing I have seen today
|
|
|
|
|
I have a pretty big program that I am developing. There are 2 different forms in the program. One of the forms has several panels on it and each panel has a form, or several forms.
I had all of my queries coming from one dataSet but I had problems with conflicting dataTables. Then I created another dataSet for a couple of my list boxes and then it worked. Then I Tried to create 2 different dataSets for one of my panels. One of the dataSets included the database tables and fields that were needed to fill list and combo boxes with info and the other with the profile and schedule info. When I did this suddenly my form is glitchy. When I get the query from the original dataset it works fine, but when I get the query from the new dataset it does not work.
What is the best way to design the datasets for a program to avoid these kinds of problems.
Should I use multiple datasets?
Would it be better for me to use a getData method instead of a fill method instead of using different datasets.
|
|
|
|
|
basically dataset is collection of datatable and it is always better to work with data table in such cases.. so please try to fetch data in minimum number of dataset (possibly one dataset). tehn bind the controls with various datatables...this will work in most cases...
Ashish Sehajpal
|
|
|
|
|
I generally do the opposite of what Ashish recommends. Get each table as data discreet entity (1 table per dataset)
I use 2 types of data, static for lookup lists etc and transactional. The static tables I populate the first time they are used and remain in memory. These are in a class called MasterTables eg
'Local var to hold the table<br />
Private mvApp As DataTable<br />
<br />
'Public property to expose the table<br />
Public Property App() As DataTable<br />
Get<br />
If mvApp Is Nothing Then<br />
mvApp = LoadApp()<br />
End If<br />
Return mvApp<br />
End Get<br />
Set(ByVal Value As DataTable)<br />
'this allows the system to reload the table when the value is nothing<br />
mvApp = Value<br />
End Set<br />
End Property<br />
<br />
Private Function LoadApp() As DataTable<br />
' Load the app table from the database<br />
Dim oClass As New clsApp<br />
Return oClass.GetRecord(cAllRecords)<br />
End Function
Note if you use a dataview to filter a table (when populating a list) then this can be reflected in the base table unless you copy the table.
|
|
|
|
|
I want to Write a program that lists all current installed services (running and stopped),the program should be able to stop/start/Pause/Resume/remove any service. Also the program should display the path of the service executable and its description
How Can i start?
|
|
|
|
|
You can start by reading all of the documentation on the ServiceController class[^]. That means reading all of the docs on all of those properties and methods because you're going to need just about all of them to do this project.
|
|
|
|
|
I am working with vb.net 2005 so there are many function is not exsit in vb.net 2005 as stop() as and start
Ahmed hassan
|
|
|
|
|
My VS2005 knows about ServiceController.Start() and Stop() ...
of course you need to add:
a reference to System.ServiceProcess
and an Imports System.ServiceProcess line
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.
|
|
|
|
|
What is the best way to store a small amount of data that the user does not have access to? I don't want to have to worry about licensing. Just need to store data from a listbox that is retrieved on startup.
I mainly work with a SQL server 2005 backend that has tens of thousands of entries. I am developing my own app that I would like to distribute.
Mark Thibodeaux
|
|
|
|
|
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?
|
|
|
|
|