|
How about changing the current cell reference to a corresponding cell on the new selected row? The selection rectangle should also move then?
|
|
|
|
|
Just figured it out. Little embarrassing...I was changing the row/cell, but then not toggling the handled property (so the grid view was still moving the cell since I was using the right button).
All is well now. Sigh. LOL.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
I'm looking to create a VBS that will query the RSoP and return the security settings of the system e.g. account policys, local policys, event log etc.
So far with a bit of research i have this, however this seems to just display password details - min password age, lockout duration, min max length etc.
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\rsop\computer")
Set colItems = objWMIService.ExecQuery _
("Select * from RSOP_SecuritySettings")
For Each objItem in colItems
Wscript.Echo "Key Name: " & objItem.KeyName
Wscript.Echo "Precedence: " & objItem.Precedence
Wscript.Echo "Setting: " & objItem.Setting
Wscript.Echo
Next
Can anyone help me further or point me in some directions.
Cheers
Gary
|
|
|
|
|
Hi
I'm converting this C# code to VB.net. I'm using online conveters but the converted code give me errors please help
private void IveGotEventDataToReport(String str)
{
SystemMessageArgs args = new SystemMessageArgs(str);
lock (this)
{
Delegate[] delegates = m_EventChannelDataReceived.GetInvocationList();
foreach (Delegate aDelegate in delegates)
{
EventChannelMessage sink = (EventChannelMessage)aDelegate;
sink.BeginInvoke(this, args, null, null);
}
}
}
Converted VB Code
Private Sub IveGotEventDataToReport(ByVal str As String)
Dim args As New SystemMessageArgs(str)
SyncLock Me
Dim delegates As [Delegate]() = m_EventChannelDataReceived.GetInvocationList() 'Error
For Each aDelegate As [Delegate] In delegates
Dim sink As EventChannelMessage = DirectCast(aDelegate, EventChannelMessage)
sink.BeginInvoke(Me, args, Nothing, Nothing)
Next
End SyncLock
End Sub
I get the error on line number 4 , the error message is
Error 2 'Private Event m_EventChannelDataReceived(sender As Object, se As SystemMessageArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.
Please help with this Regard
Thanks in advance
|
|
|
|
|
You were told how to fix this earlier today, and you gave him a 1 vote and asked again. If you're not smart enough to follow simple instructions, perhaps you should learn Logo instead or something.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: should learn Logo instead
I was introduced to Logo in 1982 when our school got a brand spanking new Apple ][e
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
See Graus' response.
Blog link to be reinstated at a later date.
|
|
|
|
|
declaring a new IP address
Dim add As IPAddress(New Address As Long)
the long value of IP Address? how to find that?
it says like a value 0x3l3443 in big endian format...
how to convert IP to big endian or Long?
|
|
|
|
|
Just use shift operators to move your 4 bytes into the right locations of your single digit.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
didn't get that honestly!
say i ve an IP 123.212.4.3
hot to find its long or big endian form?
|
|
|
|
|
In C#, you'd do do 123 << 8 to move the byte across by 8 bits. I don't know how to do that in VB, but that's the general idea. You could just multiple by 2 to the power of 8, 2 to the power of 16 and 2 to the power of 24, if you can't find the shift operator.
Oops - this is the C# forum.
123 << 24 + 212 << 16 + 4 << 8 + 3 would move them so they were in order, left to right. I'm sure that's not big endian, so get the order of digits right and that should work.
http://www.codeproject.com/KB/cs/leftrightshift.aspx[^] explains how it all works. There's at least one other article that has a helper class you may want to check out.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Are the IPAddress.NetworkToHostOrder and IPAddress.HostToNetworkOrder methods of any use to you?
Alan.
|
|
|
|
|
i am currently using vs 2005 to send mass sms, such that the request goes to SQL server 2005 and then to ozeki sms server.
it was working perfectly fine and it just suddenly stop working.
these are (part of) my codes:
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
Call SelectAllUsers()
End Sub
Protected Sub SelectAllUsers() 'Method to select all users data to send
Dim connStr As String = ConfigurationManager.ConnectionStrings("SMSConnectionString2").ConnectionString
Dim conn As New SqlConnection(connStr)
conn.Open()
Dim ds As DataSet
Dim mySQL As String = "Select phone_number from users where category = 'A'"
Dim da As SqlDataAdapter
da = New SqlDataAdapter(mySQL, conn)
ds = New DataSet()
da.Fill(ds, "phone_number")
Dim tblNumbers As DataTable
tblNumbers = ds.Tables("phone_number")
Dim drNum As DataRow
For Each drNum In tblNumbers.Rows
InsertSMSRecord(drNum("phone_number").ToString)
Next
Me.textboxError.Visible = True
Me.textboxError.Text = "Message has been sent to all users in Category A."
...
Protected Sub InsertSMSRecord(ByVal recepientNumber As String) 'Inserting Record to Database, To trigger
Dim connStr As String = ConfigurationManager.ConnectionStrings("SMSConnectionString2").ConnectionString
Dim conn As New SqlConnection(connStr)
Dim mySQL As String = "Insert Into ozekimessageout (receiver,msg,timetosend,status,sender,category) values (@receiver,@msg,@timetosend,@status,@sender,@category)"
Dim SqlInsert As SqlCommand = New SqlCommand(mySQL, conn)
SqlInsert.Parameters.AddWithValue("@receiver", recepientNumber)
SqlInsert.Parameters.AddWithValue("@msg", Me.txtMsg.Text)
SqlInsert.Parameters.AddWithValue("@timetosend", Me.showTime.Text)
SqlInsert.Parameters.AddWithValue("@status", "send")
SqlInsert.Parameters.AddWithValue("@sender", Me.lblShowUser.Text)
SqlInsert.Parameters.AddWithValue("@category", Me.dd_category.SelectedValue)
conn.Open()
SqlInsert.ExecuteNonQuery()
conn.Close()
End Sub
nth get sent to the database and when i manually add something into the database, my server doesn't respond as well.
help
|
|
|
|
|
so, which line is failing ?
peanutong wrote: when i manually add something into the database, my server doesn't respond as well
Sounds like the server is dead, no ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
my server is a sms server. now it can send single smses. but cant send multiple smses at one go, as in mass send? can u see any problem with my sql statement?
as my server is able to send single sms, so its not dead. i just don't know why i was able to mass send smses a few days ago. today it just suddenly died.
modified on Thursday, August 21, 2008 6:49 AM
|
|
|
|
|
No, it's pretty vanilla SQL. I guess the issue is the limitations of the server.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
if dats the case, why i could mass send a few days ago?
|
|
|
|
|
What the hell is 'dats' ? You're not SMSing now, speak english.
I have no idea, you're the one with the funky SMS server. Seems to me like you have an issue with a server that you've not named, and so even if someone was using it, we wouldn't know to help you. Don't the people who provide the server offer support ? We're happy to help, but we need to have experience with the product you're using, so if it's not core language stuff, asking the vendor or their help boards is often faster.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
i'm using ozeki sms server. i've emailed them, it's been 2 days and there's no reply. thanks.
|
|
|
|
|
OK, if you make that more prominent by editing your original post, you may get lucky, someone who has used it may read it. I'd even put it in the header, actually, to help attract the rare people who can help.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I'm doing a masterdetail form, so far when you typed the data in the detailed form and datagridview, it works, but the moment you save it and load it again nothing appears in the datagridview, but the one in the detailed form works properly
here is the code I used:
Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.OrderIDTableAdapter.Fill(Me.Database1DataSet.OrderID)
Me.ProductsTableAdapter.Fill(Me.Database1DataSet.Products)
End Sub
Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductsBindingNavigatorSaveItem.Click
If Validate() Then
ProductsBindingSource.EndEdit()
OrderIDBindingSource.EndEdit()
Try
Me.OrderIDTableAdapter.Update(Me.Database1DataSet.OrderID.Select("", "", DataViewRowState.Deleted))
ProductsTableAdapter.Update(Me.Database1DataSet.Products.Select("", "", DataViewRowState.Added Or _
DataViewRowState.ModifiedCurrent Or DataViewRowState.Deleted))
Me.OrderIDTableAdapter.Update(Me.Database1DataSet.Products.Select("", "", DataViewRowState.Added Or _
DataViewRowState.ModifiedCurrent Or DataViewRowState.Deleted))
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End Sub
|
|
|
|
|
is this possible in visual basic.net?
cant seem to make it work
vb.net
using access database
oledb
update t1
set t1.f1 = (select sum(t2.f1)
from t2
where t1.code=t2.code)
ty in adv
|
|
|
|
|
You're posting SQL. Does the SQL work in Access ? If not, that is your issue. if so, then your issue is with the code you're not posting, the code that is appropriate for this forum. You know, in VB.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
In MSSQL, the syntax would be
UPDATE t1
SET f1 = SUM(t2.f1)
FROM t1
INNER JOIN t2
ON t1.code = t2.code
I assume it would be the same in Access. The key here is that the column receiving the update is not aliased, and any tables used in the update need to have their own references in the FROM statement.
Don't use old style SQL Join syntax (from t1, t2 where t1.code=t2.code) if you can help it. Its difficult to follow.
|
|
|
|
|
ty for the reply
but i get this error
Syntax error (missing operator) in query expression 'SUM(Accessory_Table.Qty * Accessory_Table.Cost) FROM Stock_Table INNER JOIN Accessory_Table ON Stock_Table.StkCode = Accessory_Table.StkCode'.
this is my actual code
"UPDATE Stock_Table " & _
"SET StkCost = SUM(Accessory_Table.Qty * Accessory_Table.Cost) " & _
"FROM Stock_Table " & _
"INNER JOIN Accessory_Table " & _
"ON Stock_Table.StkCode = Accessory_Table.StkCode"
maybe UPDATE and SUM doesnt really work together in access?
|
|
|
|
|