|
Good Morning to all,
My customer Need to touch Screen Applications,screen fully show to icon and touch to show sub group image icon.how to possible this procedure,i have used few buttons but i don't know load sql values to buttons,so please help me to all......
thanks
dha NAA
|
|
|
|
|
dha NAA wrote: load sql values to buttons What exactly does that mean? SQL values may be strings, numbers, BLOBs, etc. Buttons are GUI copntrols, so there is no direct correlation between the two.
|
|
|
|
|
We'll need a lot more info from you as to where you are stuck if we are to be able to help.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
What is it exactly you are trying to do? More information may be helpful. What have you accomplished so far?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
In a current vb.net 2010 application, there is a dropdown list where the user selects who they are. From this list, the application knows what files are unique to the user.
In the past there was only one user. Now there is going to be 4 to 8 different users. The dropdown list is used to point to where the files are located for each user. This occurs since the user selects their individual names from the dropdown list and all the files uniquely start with the name of the person. In other words if the name Joe is selected then all the file names are Joe_file1,Joe_file2, etc.
The users are concerend that they will accidently update each others files. The users do not want to this to occur. This solution was determined by the previous programmer so each person could backup each other.
Thus I am trying to determine what a good solution would be.
Here is what I am thinking a good solution should be:
1. Change the application to determine what windows logon the person is using. Possibly the windows identity property could be used. This way the application will determine what files the user has access to.
2. Have another windows user created that basically has admin rights. This admin user logon would have access to all the users files. Basically when a person signs on with the windows admin user account, they would have to know what files they are trying to access.
|
|
|
|
|
1. I absolutely agree with point 1 - user should not be selecting their name from a list - open to abuse/security breaches etc.
2. I also agree that you should have an "admin" logon with access to everything.
In addition - How about also having a "delegates" list (I mean this in the English sense not the .NET sense) ... on the database have a table that maps each user to the other users whose files they are allowed to see and/or update ... similar to the way Outlook / Lotus Notes allows. Individual users should be able to configure who they will allow to see their files but a user may not "demand" the access by just picking a name of a list.
If UserA logs on they see their own files by default, but can pick another user from a list, that list only shows the list of users who have given that permission
|
|
|
|
|
You have a good suggestion. However each person has their own access 2013 database. Thus would I setup each person to point to their correct files using the Access 2013 database?
|
|
|
|
|
If they all have individual databases then that does complicate matters a little (I originally thought of a shared database) ... not sure how you are going to be able to grant access to other files that way
|
|
|
|
|
If Focus is on DataGridview if Escape key is pressed then set focus to textbox1
If Focus is not on DataGridview if Escape key pressed then i want to close the form
how do? please help me.
|
|
|
|
|
|
I have used this code to access the webcam of my laptop and it perfectly works, but once i try to open it in my tablet it just shows me a black screen, the same thing happen when i test the code with a PC that does not have a webcam!
ANY IDEAS?
Dim hCap As Long
Private Sub cmd4_Click()
Dim sFileName As String
Call SendMessage(hCap, wm_cap_set_preview, CLng(False), 0&)
With CDialog
.CancelError = True
.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt
.Filter = "Bitmap Picture(*.bmp)|*.bmp|JPEG Picture(*.jpg)|*.jpg|All Files|*.*"
.ShowSave
sFileName = .FileName
End With
Call SendMessage(hCap, WM_CAP_FILE_SAVEDIB, 0&, ByVal CStr(sFileName))
DoFinally:
Call SendMessage(hCap, wm_cap_set_preview, CLng(True), 0&)
End Sub
Private Sub Cmd3_Click()
Dim temp As Long
temp = SendMessage(hCap, WM_CAP_DRIVER_DISCONNECT, 0&, 0&)
End Sub
Dim hwdc As Long
Dim startcap As Boolean
Private Sub cmdCapture_Click()
Dim temp As Long
hCap = capCreateCaptureWindow("Take a Camera Shot", ws_child Or ws_visible, 0, 0, PicWebCam.Width, PicWebCam.Height, PicWebCam.hWnd, 0)
If (hwdc <> 0) Then
temp = SendMessage(hwdc, wm_cap_driver_connect, 0, 0)
temp = SendMessage(hwdc, wm_cap_set_preview, 1, 0)
temp = SendMessage(hwdc, WM_CAP_SET_PREVIEWRATE, 30, 0)
startcap = True
Else
MsgBox ("No Webcam found")
End If
End Sub
Private Sub Cmd2_Click()
Dim temp As Long
temp = SendMessage(hCap, WM_CAP_DLG_VIDEOFORMAT, 0&, 0&)
End Sub
Private Sub Form_Load()
cmd1.Caption = "Start &Cam"
cmd2.Caption = "&Format Cam"
cmd3.Caption = "&Close Cam"
cmd4.Caption = "&Save Image"
End Sub
|
|
|
|
|
I created a simple application that uses an interface to implement MEF (and yes its a stupid and simple example, or so I thought):
Imports System.ComponentModel.Composition
<InheritedExport(GetType(IMathFunctions))>
Public Interface IMathFunctions
Function DoMath(ByVal Num1 As Double, ByVal Num2 As Double) As Double
End Interface
So In the same project I have one class that uses the interface:
Imports WpfImportedFiles
Imports System.ComponentModel.Composition
<Export(GetType(WpfImportedFiles.IMathFunctions))>
Public Class Substract
Implements WpfImportedFiles.IMathFunctions
Public Function DoMath(Num1 As Double, Num2 As Double) As Double Implements IMathFunctions.DoMath
Return (Num1 - Num2)
End Function
End Class
And I load this into the program using this code:
Imports System.Collections.Generic
Imports System.Linq
Imports System.ComponentModel.Composition
Imports System.ComponentModel.Composition.Hosting
Imports System.Reflection
Imports System.IO
Public Class Importer
<ImportMany(GetType(IMathFunctions))>
Private operations As IEnumerable(Of IMathFunctions)
Public Sub DoImport()
Dim catalog = New AggregateCatalog()
Dim asm = Assembly.LoadFrom("C:\Users\ ... \LibImportedClasses.dll")
Dim catalog2 As New AssemblyCatalog(asm)
Dim catalog3 As New AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly())
catalog.Catalogs.Add(catalog3)
catalog.Catalogs.Add(catalog2)
Dim container As New CompositionContainer(catalog)
container.ComposeParts(Me)
End Sub
Public ReadOnly Property AvailableNumberOfOperations() As Integer
Get
Return (If(operations IsNot Nothing, operations.Count(), 0))
End Get
End Property
Public Function CallAllComponents(a As Double, b As Double) As List(Of Double)
Dim result = New List(Of Double)()
For Each op As IMathFunctions In operations
result.Add(op.DoMath(a, b))
Next
Return result
End Function
End Class
This works well for the class that is inside the original project, except for one thing; It gets loaded twice, and I don't understand why.
The other question is, how do I load a lib file that is in a separate project (i.a. the interesting case). I could not get it to work, but managed to load the assembly, that did contain the class I wanted to load, but I couldn't use it.
I hope that you could assist me in answering the two (hopefully) simple questions.
|
|
|
|
|
Because the InheritedExport AND the Export attributes export it. Remove the InheritedExport on the interface to fix it.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I couldn't make that work, but I could keep it in the interface and remove it from the classes, that way only one instance was created. So thank you for your help
But I still can't add the method created in the separate project.
|
|
|
|
|
There is just one problem left, I can't seem to load the Assembly from the imported dll. But I am able to get the type that Im interested in by using this method:
Dim Path As String = ("C:\Users\ ... WpfPlayingAroundWithMEF\LibImportedClasses\bin\Debug")
Dim pluginFiles() As String = Directory.GetFiles(Path, "*.dll")
Dim ipi = (From file In pluginFiles
Let asm2 = Assembly.LoadFile(file)
From type In asm2.GetExportedTypes()
).ToArray()
So why doesn't the lines:
Dim asm = Assembly.LoadFrom("C:\Users\ ... LibImportedClasses\bin\Debug\LibImportedClasses.dll")
Dim catalog2 As New AssemblyCatalog(asm)
Load the assembly so I can use them?
Edit:
My other project lib looks like this:
Imports System.ComponentModel.Composition
Imports WpfImportedFiles
Public Class Add
Implements WpfImportedFiles.IMathFunctions
Public Function DoMath(Num1 As Double, Num2 As Double) As Double Implements IMathFunctions.DoMath
Return Num1 + Num2
End Function
End Class
I have tried to add the Export attribute, but that seems to be provided by the inheritedexport in the interface.
modified 8-Oct-15 2:31am.
|
|
|
|
|
I don't know what the issue was, but a rebuild of the library fixed it.
|
|
|
|
|
i have added a button named book, and a panel below it.when mouse will hover over book button the panel will be visible (i used increment of panel height for this).but my requirement is, the panel to be visible as long as the mouse hover over the panel.
if u can't under stand what i'm saying just check this page..
flipkart. check the header menu which contains electronics, men, women etc.
i want that type of menu in my form. i hope someone will help me asap.
here is my code.
Private Sub AdminPage_Load(sender As Object, e As EventArgs) Handles Me.Load
BookPanel.Height = 0
End Sub
Private Sub Book_MouseEnter(sender As Object, e As EventArgs) Handles Book.MouseEnter
Do While BookPanel.Height < 210
BookPanel.Height += 1
Loop
End Sub
Private Sub Book_MouseLeave(sender As Object, e As EventArgs) Handles Book.MouseLeave
Do While BookPanel.Height > 0
BookPanel.Height -= 1
Loop
End Sub
|
|
|
|
|
Using VWD2008 and Office 2010 - I am trying to create an excel object.
When run through VWD, a spreadsheet is created, formatted and saved fine. When the code is compiled (and run on the same machine), the create object or new Excel.Application falls over.
1) as object using Microsoft.Office.Core dll:
Dim xlApp As Object = CreateObject("Excel.Application")
2) As Excel application using Microsoft.Office.Interop.Excel dll
Dim xlApp As Application = New Application
|
|
|
|
|
Are we supposed to guess the exception that's thrown when the code "falls over"?
Provide the full details of the exception, the line of code where it's thrown, and any relevant parts of the surrounding code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The exception message was 'Cannot create ActiveX component.' I have updated the DCOM config permissions for Excel Application and restarted IIS, but still no joy
The following is all of the code behind (this page is cut down from a page that gets mountains of data - just to test the create & save excel part )
Imports CommonFunctions
Imports Microsoft.VisualBasic
Imports Microsoft.Office.Core
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class FEMain_ContractAdmin_TestExcel2
Inherits System.Web.UI.Page
Dim objCF As New CommonFunctions
Protected Sub btnKPI_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnKPI.Click
Dim xlApp As Object
Try
xlApp = CreateObject("Excel.Application")
Catch ex As Exception
objCF.logError(System.IO.Path.GetFileName(System.Web.HttpContext.Current.Request.Url.AbsolutePath) & " :: " & System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message)
Exit Sub
End Try
Dim xlWorkBook As Object
Dim xlWorksheet As Object
Dim misValue As Object = System.Reflection.Missing.Value
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorksheet = xlWorkBook.Sheets("Sheet1")
xlWorksheet.Cells(1, 1) = "Test 123456"
Dim strSavePath As String
Dim strFilename As String
Dim strFullPath As String
strSavePath = AppDomain.CurrentDomain.BaseDirectory & "Documents\KPI\Concerns\"
'create kpi concern directory
If (Not Directory.Exists(strSavePath)) Then
Directory.CreateDirectory(strSavePath)
End If
strFilename = "Test_" & CStr(Date.Now.Year) & objCF.addZeros(CStr(Date.Now.Month), 2) & objCF.addZeros(CStr(Date.Now.Day), 2) & "_" & objCF.addZeros(CStr(Date.Now.Hour), 2) & objCF.addZeros(CStr(Date.Now.Minute), 2) & objCF.addZeros(CStr(Date.Now.Second), 2) & objCF.addZeros(CStr(Date.Now.Millisecond), 3) & ".xlsx"
strFullPath = strSavePath & strFilename
'save and close
xlWorkBook.SaveAs(strSavePath & strFilename)
xlWorkBook.Close(True, misValue, misValue)
xlApp.Quit()
'release COM objects
Call objCF.releaseObject(xlWorksheet)
Call objCF.releaseObject(xlWorkBook)
Call objCF.releaseObject(xlApp)
'show the hyperlink to the excel file
hypKPI.Visible = True
hypKPI.NavigateUrl = "~\Documents\KPI\Concerns\" & strFilename
End Sub
End Class
|
|
|
|
|
You should read the following Microsoft knowledgebase article:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
It documents the various hoops that you'll have to jump through to stand any chance of getting Office Interop working in ASP.NET; however, there is no guarantee that you'll be able to get it working, or that it won't stop working at some random point in the future.
There are various ways to read and create Excel spreadsheets on the server without using Office interop. For example:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Also, if you're on a 64-bit OS, check your AppPool settings to make sure you've selected "Enable 32-bit Applications". A 64-bit AppPool won't be able to create and use an instance of a 32-bit COM component.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Why are you defining everything as Object? That's actually going to hurt you, not help you. You loe all type safety when you do that.
|
|
|
|
|
DAH_bham wrote: strFilename = "Test_" & CStr(Date.Now.Year) & objCF.addZeros(CStr(Date.Now.Month), 2) & objCF.addZeros(CStr(Date.Now.Day), 2) & "_" & objCF.addZeros(CStr(Date.Now.Hour), 2) & objCF.addZeros(CStr(Date.Now.Minute), 2) & objCF.addZeros(CStr(Date.Now.Second), 2) & objCF.addZeros(CStr(Date.Now.Millisecond), 3) & ".xlsx"
You really need to look at Custom Date and Time Format Strings[^] and the String.Format method[^]:
strFilename = String.Format("Test_{0:yyyyMMdd_HHmmssfff}.xlsx", Date.Now)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I tried Excel Package (OpenOfficeXML) instead of Office COM dlls and it worked fine for my needs -
thanks for your help.
|
|
|
|
|