|
Have you compared the regional settings of the various machines? At a guess I would say that the development environment is using English(United States) or some other culture that has $ for the currency symbol. All the 'helpful' stuff built into the VB conversion routines is probably ignoring the default currency symbol.
|
|
|
|
|
Yes Alan, You are right. Regional Setting issue was causing the problem.
Thanks for the suggestions.
|
|
|
|
|
_ hooray! need help for my project .. I am developing a Payroll System .. I have a Stored Procedure created using SSMS 2005 ..details:
Stored Procedure Name: Find_Emp
Command/Query=
SELECT * FROM EMP0000 INNER JOIN EMP0001 ON EMP0001.EMP_NO =EMP0000.EMP_NO WHERE EMP0000.EMP_NO=@empno
In my GUI using Visual Studio 2010, I have a ListView where the list of employee listed..
I want to call the procedure in SelectedIndexChanged Event of the ListView ..
My problem is don't have an idea how to call this procedure in visual studio 2010 .. any help please ?
|
|
|
|
|
alecxa05 wrote: don't have an idea how to call this procedure in visual studio 2010 The same way you would call it in any version of Visual Studio. Add an event handler for SelectedIndexChanged and put your SQL command in there. See these links[^] for samples and suggestions.
Use the best guess
|
|
|
|
|
|
Dear All,
I have 6 tables created from a class using EF Code First approach, and I'm wondering how to do the relationship between the tables using DataAnnotation, classes as follow:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.ComponentModel.DataAnnotations
Imports System.ComponentModel.DataAnnotations.Schema
Public Class Customer
<Key, ScaffoldColumn(False)>
Public Property CustomerID() As Integer
<Display(Name:="File No"), StringLength(6)>
Public Property CustomerFileNo() As String
<Required(ErrorMessage:="First Name is required")>
<Display(Name:="First Name"), StringLength(20)>
Public Property FirstName() As String
<Display(Name:="Last Name"), StringLength(20)>
Public Property LastName() As String
<Display(Name:="Street"), StringLength(40)>
Public Property Addr_StreetName() As String
<DefaultSettingValue("0")>
Public Property MaritalStatusID() As Integer
<DefaultSettingValue("0")>
Public Property Addr_AreaID() As Integer
<DefaultSettingValue("0")>
Public Property Wrk_OccupationID() As Integer
End Class
Public Class MaritalStatus
<Key, ScaffoldColumn(False)>
Public Property MaritalStatusID() As Integer
<Required(ErrorMessage:="Name Required")>
<Display(Name:="Marital Status"), StringLength(10)>
Public Property MaritalName() As String
<DefaultSettingValue("1")>
Public Property RecStatus() As Boolean
End Class
Public Class Area
<Key, ScaffoldColumn(False)>
Public Property AreaID() As Integer
<Required(ErrorMessage:="Name Required")>
<Display(Name:="Area Name"), StringLength(30)>
Public Property AreaName() As String
<DefaultSettingValue("1")>
Public Property RecStatus() As Boolean
End Class
Public Class Occupation
<Key, ScaffoldColumn(False)>
Public Property OccupationID() As Integer
Public Property OccupationName() As String
End Class
Public Class InvoiceHdr
<Key, ScaffoldColumn(False)>
Public Property InvoiceID() As Integer
Public Property InvoiceNo() As String
Public Property Amount() As Integer
Public Property CustomerID As Integer
End Class
Public Class InvoiceDetails
<Key, ScaffoldColumn(False)>
Public Property InvoiceDetailsID() As Integer
Public Property InvoiceID() As String
Public Property ItemNo() As String
Public Property ItemDescription() As String
End Class
Description:
Customer table has fields:
- MaritalStatusID which linked to MaritalStatus master table, and displayed as drop downlist in the customer formview
- Addr_AreaID which linked to Area master table, and displayed as drop downlist in the customer formview
- Wrk_OccupationID which linked to Occupation master table, and displayed as drop downlist in the customer formview
Then Invoice table has:
- CustomerID which linked to the customer table
Then InvoiceDetails table has:
- InvoiceID which is linked to Invoice table.
Thanks in advance
|
|
|
|
|
|
True .. but (frazzle-me) suggested to submit it in the VB forum so I may get the answer .. so I thought it's ok to do that.
Anyhow thanks for the info.
|
|
|
|
|
A good reason to choose the correct forum in the first place.
Use the best guess
|
|
|
|
|
Yes correct.
But still I'm stuck & looking for the answer
|
|
|
|
|
Hello,
i have an application in vb.net with 2 forms running on a pc with two monitors. I'd like to see the first form on both monitor, but the second form only in one of them. Is it possbile? I know it is because i saw an application with these features. So, does anybody help me ?
Thaks a lot for attention
Nick
|
|
|
|
|
NicoTexas wrote: So, does anybody help me ?
Set Top and Left properties to (0,0) and make the size equal to the cumulative width of the screens. Set the height to equal the largest screen. Something similar to below;
Form1.Top = 0
Form1.Left = 0
Form1.Width = Screen.AllScreens(0).Bounds.Width + Screen.AllScreens(1).Bounds.Width
Form1.Height = Screen.PrimaryScreen.Bounds.Height
Form1.ShowDialog()
Works best if both screens are equal in size and resolution; my PC has a left screen that's smaller than the right one. The part that's not visible on the smaller one is still there - it exists in virtual space, and is simply not drawn. Still, it allows you to move a button to a location "beyond" the screen.
If you go to the configuration-screen and look at the display settings (screen resolution), both monitors will be shown, along with two buttons ("Detect" and "Identify") and some settings for the resolution. If your monitors are differently sized, then you can change their virtual location here.
If you want to show a "neat" screen spanning both monitors and still cope with different sizes, I'd suggest using two forms, one for each screen. This approach would be more suitable if you are going to build a screensaver.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
How to make regular Appointment or Schedule using ListView & MonthCalendar?
|
|
|
|
|
That'd be a bit much to explain in detail in a single post. Worse, it'd be too much for a single lesson.
You'll need to decide where and how to store your data. Let's assume you'll use a database for the appointments; you'd then design the tables to store your data and write code to fetch and manipulate appointments.
After that you can set up a UI, and yes, a ListView would be handy to display a list of appointments, and yes, a calendar would be handy to display the appointment-date.
At which of these parts are you stuck? If you say "all of them", I'd suggest getting a good book on C#.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
TYVM dude, for answering my Question
Have been solved with your opinion ; "Let's assume you'll use a database for the appointments" its about database.
|
|
|
|
|
Yazid Aura Robbani wrote: Have been solved with your opinion ; "Let's assume you'll use a database for the appointments" its about database. Does that mean your question is answered, or did you answer "database" on my question?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Indeed, I have no database before on my appointment design. Your Replay has been reminding me to make the database Thank You So much
1 more question friend, I've made a traditional calendar using VB6 and everything goes well, the problem arises when I want to change it to VB2010 express, I've been try to converting the code with my Knowledge and some converting tools, but still stuck with it, because I'm a Newbie in VB2010.
I hope you do not get annoyed when I asked for an e-mail. I really intend to send you an example so that you can analyze it.
Best Regards
|
|
|
|
|
Yazid Aura Robbani wrote: 1 more question friend, I've made a traditional calendar using VB6 and everything goes well, the problem arises when I want to change it to VB2010 express, I've been try to converting the code with my Knowledge and some converting tools, but still stuck with it, because I'm a Newbie in VB2010.
Post the piece that's giving problems and we'll take a look
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Components :
1 Form
2 Modules
1 MSFlexGrid (optional, can use Listview or GridView)
2 ComboBox
How to convert this to VB 2010 Express
Here my old VB6 codes:
<pre lang="vb">
Dim ahari
Dim shari As String
Dim l As Single
Dim l1 As Single
Dim CekTanggal As Boolean
Dim HariIni As Boolean
Public TextTanggalSekarang As String
Const MaxTahun = 2099, MinTahun = 1901
Private Sub CmbTahun_Click()
If CekTanggal = False Then
Exit Sub
End If
TampilkanTanggal
End Sub
Private Sub CmbBulan_Click()
If CekTanggal = False Then
Exit Sub
End If
TampilkanTanggal
End Sub
Private Sub Form_Load()
If App.PrevInstance = True Then
Unload Me
End
End If
CekTanggal = False
Combo_Status_Load
Combo_Tahun_Load
TanggalSekarang = Now
CmbBulan.ListIndex = Month(TanggalSekarang) - 1
CmbTahun.ListIndex = Year(TanggalSekarang) - MinTahun
HariIni = True
TampilkanTanggal
CekTanggal = True
formloaded = True
Timer1.Interval = 300
ahari = Array("Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu")
End Sub
Private Sub Combo_Status_Load()
CmbBulan.List(0) = "Januari"
CmbBulan.List(1) = "Februari"
CmbBulan.List(2) = "Maret"
CmbBulan.List(3) = "April"
CmbBulan.List(4) = "Mei"
CmbBulan.List(5) = "Juni"
CmbBulan.List(6) = "Juli"
CmbBulan.List(7) = "Agustus"
CmbBulan.List(8) = "September"
CmbBulan.List(9) = "Oktober"
CmbBulan.List(10) = "November"
CmbBulan.List(11) = "Desember"
End Sub
Private Sub Combo_Tahun_Load()
Dim i As Integer
For i = 0 To MaxTahun - MinTahun
CmbTahun.List(i) = i + MinTahun
Next
End Sub
Private Sub Grid_Kalender_Load()
Dim i As Integer
CalGrid.Row = 0
CalGrid.Col = 0
CalGrid.CellAlignment = 4
CalGrid.CellFontBold = True
CalGrid.CellBackColor = &HC0C0FF
For i = 1 To 6
CalGrid.Row = 0
CalGrid.Col = i
CalGrid.CellAlignment = 4
CalGrid.CellFontBold = True
CalGrid.CellBackColor = &HD4D4D4
Next
CalGrid.TextMatrix(0, 0) = "Min"
CalGrid.TextMatrix(0, 1) = "Sen"
CalGrid.TextMatrix(0, 2) = "Sel"
CalGrid.TextMatrix(0, 3) = "Rab"
CalGrid.TextMatrix(0, 4) = "Kam"
CalGrid.TextMatrix(0, 5) = "Jum"
CalGrid.TextMatrix(0, 6) = "Sab"
End Sub
Private Sub TampilkanTanggal()
Dim BanyakTanggal As Integer
Dim TahunTampil As Integer
Dim CekKabisat As Boolean
Dim HariPertama As Integer
Dim BulanTampil As Integer
Dim a As Long
Dim b As Long
Dim i As Integer
'tanggal hari ini
TanggalSekarang = Now
TanggalSekarang = Day(TanggalSekarang)
'hapus tanggal lama
For a = 1 To 6
For b = 0 To 6
CalGrid.Row = a
CalGrid.Col = b
CalGrid.Clear
Next b
Next a
'inisiasi
Grid_Kalender_Load
BulanTampil = CmbBulan.ListIndex + 1
TahunTampil = CmbTahun.ListIndex + MinTahun
HariPertama = Program_HariPertama(BulanTampil, TahunTampil)
CekKabisat = Program_CekKabisat(TahunTampil)
If BulanTampil = 4 Or BulanTampil = 6 Or BulanTampil = 9 Or BulanTampil = 11 Then
BanyakTanggal = 30
ElseIf (BulanTampil = 2 And CekKabisat = True) Then
BanyakTanggal = 29
ElseIf (BulanTampil = 2 And CekKabisat = False) Then
BanyakTanggal = 28
Else
BanyakTanggal = 31
End If
'cari hari pertama jawa kabisat
Dim HariPertamaJawa As Integer
Dim HariJawa As Integer
Dim TahunTampil_temp As Integer
If (TahunTampil > 2000) Then
TahunTampil_temp = TahunTampil - 100
Else
TahunTampil_temp = TahunTampil
End If
If (CekKabisat = True) Then
HariPertamaJawa = Program_HariJawaKabisat(BulanTampil, TahunTampil_temp)
Else
HariPertamaJawa = Program_HariJawaBiasa(BulanTampil, TahunTampil_temp)
End If
'menuliskan tanggal
HariJawa = HariPertamaJawa
a = 1
b = HariPertama - 1
For i = 1 To BanyakTanggal
CalGrid.Row = a
CalGrid.Col = b
CalGrid.CellAlignment = 4
CalGrid.WordWrap = True
If (HariIni = True And i = TanggalSekarang) Then
CalGrid.CellBackColor = &HE0E0E0
TextTanggalSekarang = GetNamaHari(b + 1) & " " & NamaJawa(HariJawa) & "," & i & " " & CmbBulan.List(CmbBulan.ListIndex) & " " & TahunTampil
End If
CalGrid.Text = i & vbNewLine & NamaJawa(HariJawa)
If (HariJawa = 5) Then
HariJawa = 1
Else
HariJawa = HariJawa + 1
End If
If (b = 6) Then
a = a + 1
b = -1
End If
b = b + 1
Next
HariIni = False
End Sub
Private Sub SysTrayBtn_Click()
Me.Hide
Dim nid As NOTIFYICONDATA
With nid
.cbSize = Len(nid)
.hWnd = FormMain.hWnd
.uID = 0
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uCallbackMessage = 1400
.hIcon = FormMain.Icon
.szTip = TextTanggalSekarang & vbNullChar
End With
Shell_NotifyIconA NIM_ADD, nid
oldproc = SetWindowLongA(Me.hWnd, -4, AddressOf proc)
Me.Hide
End Sub
Private Sub Form_Paint()
formloaded = True
End Sub
Private Sub KalenderTray_Click()
Dim nid As NOTIFYICONDATA
With nid
.hWnd = Me.hWnd
.cbSize = Len(nid)
.uID = 0
End With
Shell_NotifyIconA NIM_DELETE, nid
SetWindowLongA Me.hWnd, -4, oldproc
Me.Show
Form_Load
End Sub
Private Sub Timer1_Timer()
shari = ahari(Abs(Weekday(Date) - 1))
Label5(1).Caption = "" & shari & ", " & Format(Date, "dd mmmm yyyy")
Label4(1).Caption = Format(Time, "hh:mm:ss")
End Sub
</pre>
|
|
|
|
|
Yazid Aura Robbani wrote: How to convert this to VB 2010 Express Here my old VB6 codes: Copy & paste to a .NET project and try to run it, focussing on the lines that give a compile-error. As is now, I only see a request to translate a complete project. I'll gladly help looking for a .NET alternative if there's a line that cannot be translated, but you'll have to do the majority of translating on your own
There's a NotifyIcon control that makes showing a tray-icon easy. There's an example on it's use here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Okay, i will try
Thanks a lot for your suggestion dude
|
|
|
|
|
I want to send message WM_COPYDATA from VB for CE to eVC++. My code is looking like this:
Private Structure COPYDATASTRUCT
Public dwData As Integer
Public cbData As Integer
Public lpData As Integer
End Structure
Public Sub CopyData(ByVal strToSend As String)
Dim hWndREC As Long
Dim MyData As COPYDATASTRUCT
hWndREC = FindWindow(vbNullString, "Test 1.0")
MyData.dwData = 0
MyData.lpData = strPtr(strToSend)
MyData.cbData = Len(strToSend) * 2
SendMessage(hWndREC, WM_COPYDATA, Me.Handle, MyData)
End Sub
The problem is that a compiler does not recognize a function strPtr. I have also similar problem with MyData, because they cannot be converted on Integer. What can I do?
modified 15-Apr-13 8:13am.
|
|
|
|
|
Member 9891334 wrote: I have also similar problem with MyData, because they cannot be converted on Integer. What can I do?
According to P/Invoke.NET[^], two of those integers would be pointers. Does eVB have an IntPtr or something similar?
Perhaps this CodeProject-article[^] could help?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
eVB is closer to VBScript and only supports type VARIANT.
It also doesn't support a slew of other VB stuff found in the desktop version.
Compiled to p-code. Interpreted.
Moving over to VB.Net would be a better choice.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Which version of VB for CE?
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|