|
Thanks. I'll give that a try.
George
|
|
|
|
|
Hi! i'm developing an application under VB.NET...while i test it on my computer, everything works fine...but when i try to open it on another computer, an error occurs...the error says something like:
"The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException.....etc"
Then it says that i should grant the application using the .NET security administration tool...do i have to install this tool on EVERY machine in which i want to run my app??? how do i solve this issue???
thanks!!!
|
|
|
|
|
You're apparently trying to run the app from a network drive/share. Network sources are not trusted and run under greater security control that if the code was launched from a local hard drive.
Yes, you'll have to either:
a) Install the app locally on each machine.
b) Modify the security trusts on each machine to tell it to trust network-sourced code. How you do this depends on your networking environment, but is usually done with policies.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
you're right...i was mapped into a drive and running the app from that drive...now, my new question is...
the app is like a resources monitor, that is, it warns an administrator when, for example, some directory has grown a lot in size, or when the free space of one of it disks is low...etc...
the app runs on a server, and monitors a lot of networked PC's and servers...will i have to install the tool on every monitored pc???? because i think it's not very viable to do that, since there are more than 500 pc's to monitor...
thanks!!
|
|
|
|
|
Like I said, you have two options.
1) Either install it on all the PC's. I hope you have a software distribution system...
or
2) You'll have to modify the security policies to tell the machines to trust network-sourced code.
I suggest you read up on Code Access Security[^], specifically Security Policy Best Practices[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all, im having a little problem with this method, im merging two datasets (same table, im just trying to refresh a table, just in case it has been changed by someone else), and it duplicates rows, i think it must be because of the primary keys, Arent primary keys supossed to be in the dataset since I opened the table?? Here is my code:
*OpenTbl is just a function that returns a datatable
ds1.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
ds2.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
ds1.Merge(ds2)
Me.DataGridView1.DataSource = ds1.Tables("Adscripciones")
===========The previous code duplicates rows
ds1.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
Dim Key(1) As DataColumn
Key(0) = ds1.Tables(0).Columns(0)
ds1.Tables(0).PrimaryKey = Key
ds2.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
ds1.Merge(ds2)
Me.DataGridView1.DataSource = ds1.Tables("Adscripciones")
==========This wont duplicate, but i have to specify primary keys, and i wouldnt like that since im trying to make a generic routine to open tables.
Is there any way to get primary keys information and use it for the merge method without specifying primary keys??
I hope anyone can help me, Ill apreciate it
Thank You
Alexei
|
|
|
|
|
I forgot to say im using SQL 2000 and VB.NET 2005
|
|
|
|
|
I forgot to say im using SQL 2000 and VB.NET 2005
|
|
|
|
|
I found out how to automatically get primary keys
Anyways, i just wanted to post it here, just in case someone else needs it.
On the dataadapter, just set the da.MissingSchemaAction = MissingSchemaAction.AddWithKey
Example:
==================
Dim ds1, ds2 As New DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ds1.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
ds2.Tables.Add(OpenTbl("SELECT * FROM Adscripciones", "Adscripciones"))
ds1.Merge(ds2)
Me.DataGridView1.DataSource = ds1.Tables("Adscripciones")
End Sub
Public Function OpenTbl(ByVal SQL As String, ByVal NombreDeTabla As String) As DataTable
Dim da As New SqlDataAdapter(SQL, conn)
Dim T As New DataTable
Try
'I was missing this line at the beggining
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
da.Fill(T)
T.TableName = NombreDeTabla
Catch ex As Exception
Return Nothing
End Try
Return T
End Function
===========================
Thank anyways
Alexei
Its good to know that theres always someone willing to help others
|
|
|
|
|
Currently, I'm doing a project using VB6. Now, I've create 2 forms, let's say Form1 and Form2. Now, I have done the link between these form. User can click on a button in Form1, then a "pop up" of Form2 is appears. So the user can key in their value here in textbox (in Form2) for example (for other mathematics calculation stuff). The problem here is...HOW I can display what the user "key-in" in the Form2 will be display too in Form1 . Please give the code.
Hopefully to hear from you A.S.A.P, Thank You
Than You
-- modified at 10:21 Wednesday 1st February, 2006
|
|
|
|
|
if I understand what you mean, here's the solution:
make a global variables, 4Ex:
module main
dim objFrm1 as new Frm1
dim objFrm2 as new Frm2
Dim GV_key as string
sub main()
GV_key = objfrm1.key
objfrm2.key= GV_Key
end sub
end Module
Militiaware
Faris Madi
|
|
|
|
|
militiaware wrote: make a global variables
Global variables!!! NO! NO! NO! NO! NOOOO!!!
Jeez, don't they teach that this is bad practice in CS classes any more?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
militiaware wrote: make a global variables
:SMACK: That's REALLY bad practice!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry Faris Madi!
I disagree with you strongly! It is a very bad programing practice to use global variables to pass data between classes (forms). Use events instead!
Supose you have a TextBox on one form and you want to inform the other form whenever it's contents was changed - raise an event with the changed contents as an argumet.
You need to declare the event on the form where the TextBox resides. Then, you need to have a "withevents" variable referencing that form within the second form. Then, attach an event handling procedure on the second form to handle what's need to be done whenever the TextBox's contents changes and the event is raised.
Hope I've helped here.
Walk the way. Top down.
|
|
|
|
|
ohh i forgot this solution completely.....
thanx for the TIP nata.
Militiaware
Faris Madi
|
|
|
|
|
Hi All,
I am new to TAPI and MSComm.I will be greatful if you could
spare some time for me to help me in this regard.
Problem:
I need my phone to go OffHook and OnHook using Visual Basic.
I am able to collect the Device Info(D-Link DFM562E++ Modem)
using my code.
I have read somewhere that,
'You could try doing a lineMakeCall() with a ";" dial string. I
believe this should take the phone off hook and create a new dialtone
call. It may timeout after some time and transition to IDLE or you
may be able to drop it with lineDrop'
I tried this but it didnt work.
I placed one MSComm control and :
MSComm1.Settings = "56000,N,8,1"
MSComm1.CommPort = 2
MSComm1.InputLen = 0 'Default anyway
MSComm1.RThreshold = 1
MSComm1.PortOpen = False
MSComm1.Output = "ATE0" & vbCr
But there was no Offhook Signalling sound generated.
Can anybody please suggest me a solution for this
Thanks
Nishanth
|
|
|
|
|
Hello! I have a picturebox1 and its sizemode is set to strechimage. So the actual image size is bigger than the picturebox1 size. My aim is to draw the image as big as picturebox1 size as streched to see all image not a part of the image. Somethig is wrong in the code below because it only draws the area (Picturebox1 size) of the image. I am not able to scale the image.
Any help!
Thanks!
BJ
Private Function DrawImageCallback(ByVal callBackData As IntPtr) As Boolean
'Test for call that passes callBackData parameter.
If callBackData.Equals(IntPtr.Zero) Then
' If no callBackData passed, abort DrawImage method.
Return True
Else
' If callBackData passed, continue DrawImage method.
Return False
End If
End Function
' Copy the watermark image over the result image.
Private Sub DrawWatermark(ByVal watermark_bm As Bitmap, _
ByVal result_bm As Bitmap, ByVal x As Integer, ByVal y As Integer)
Dim imageCallback As New Graphics.DrawImageAbort(AddressOf DrawImageCallback)
Dim imageCallbackData As New IntPtr(1)
' Create rectangle for adjusted image.
Dim destRect2 As New Rectangle(PictureBox1.Location.X, PictureBox1.Location.Y, PictureBox1.Width, PictureBox1.Height)
Dim es As Graphics = Graphics.FromImage(result_bm)
' Create image attributes and set large gamma.
Dim imageAttr As New ImageAttributes()
'imageAttr.SetGamma(4.0F)
' Draw adjusted image to screen.
' Draw adjusted image to screen.
es.DrawImage(watermark_bm, destRect2, PictureBox1.Location.X, PictureBox1.Location.Y, PictureBox1.Width, PictureBox1.Height, GraphicsUnit.Pixel, imageAttr, imageCallback, imageCallbackData)
imagination is the seed value of creation!
|
|
|
|
|
Private Function DrawImageCallback(ByVal callBackData As IntPtr) As Boolean
'Test for call that passes callBackData parameter.
If callBackData.Equals(IntPtr.Zero) Then
' If no callBackData passed, abort DrawImage method.
Return True
Else
' If callBackData passed, continue DrawImage method.
Return False
End If
End Function
' Copy the watermark image over the result image.
Private Sub DrawWatermark(ByVal watermark_bm As Bitmap, _
ByVal result_bm As Bitmap, ByVal x As Integer, ByVal y As Integer)
Dim imageCallback As New Graphics.DrawImageAbort(AddressOf DrawImageCallback)
Dim imageCallbackData As New IntPtr(1)
' Create rectangle for adjusted image.
Dim destRect2 As New Rectangle(PictureBox1.Location.X, PictureBox1.Location.Y, PictureBox1.Width, PictureBox1.Height)
Dim es As Graphics = Graphics.FromImage(result_bm)
' Create image attributes and set large gamma.
Dim imageAttr As New ImageAttributes()
'imageAttr.SetGamma(4.0F)
' Draw adjusted image to screen.
' Draw adjusted image to screen.
es.DrawImage(watermark_bm, destRect2, PictureBox1.Location.X, PictureBox1.Location.Y, PictureBox1.Width, PictureBox1.Height, GraphicsUnit.Pixel, imageAttr, imageCallback, imageCallbackData)
|
|
|
|
|
hi. i'm a new bie in vb.net. I'm currently developing a multilingual project. I'm unable to change the regional language settings when the current thread changes from one language to the other. If anybody could help me, please find a solution for this.
-Ganesh Pradeep.R
|
|
|
|
|
hi dear friends programmers
i need a program or some code such as an email in windows form vb.net that i want the clients can send and receive file from eachother in the lan in one department.
i am not master in vb.net and i have to solve this problem immediately.
please help me . untile now i cant find functional and good code for it to use.
thanks alot for your care and help.
(i use visual studio 2003)
i am await for your helps....
pantea
|
|
|
|
|
Look up System.Web.Mail.SmtpMail/MailMessage classes. They have methods and properties that allow you to specify attachments/relay server etc.
- Malhar
|
|
|
|
|
Hi And Thanks for your care
but iam new in programming vb.net and really i dont know how to use or make it.
please describe more ,if you can
thanks alot
|
|
|
|
|
The following code in VB shows the error : "Undefined function 'round' in expression".
[CODE]
DataEnvironment1.Commands(1).CommandText="Select Round(Altitude,2) from Alt"
[\CODE]
Here, Altitude is a variable of type 'Number-Double'
Alt is a table in MS-Access Database.
Help me regarding this.
Thanks in advance.
-- modified at 2:18 Wednesday 1st February, 2006
|
|
|
|
|
Try:
DataEnvironment1.Commands(1).CommandText="Select Round(" & Altitude & ", 2) from Alt"
|
|
|
|
|
Altitude is not a variable used in VB. Altitude is a Field in table Alt.
|
|
|
|
|