|
Sorry, did not get you. Neway, I m using MS Access. some usefull tips will be helpful.
With Best Regards,
Mayur
|
|
|
|
|
mayhem_rules wrote: Sorry, did not get you.
Your code is succeptable to a SQL Injection Attack. A mallicious attacker could gain control of your database through your web application if you don't defend it.
The article I linked to will explain what a SQL Injection Attack is and it will give some advice on how to defend yourself from it.
mayhem_rules wrote: Neway, I m using MS Access
Dismissive attitudes like this cause security problems. Regardless of the database platform you are using you need to at least understand what security threats exist in order for you to put together even a basic plan of defence.
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
|
|
|
|
|
Anyone here knows how to trap the mouse cursor in the main form of a vb .net application? so that the user won't be able to use windows until it is unlock. can somebody help me with this?
|
|
|
|
|
You can track the mouse position with the Form's MouseMove event. Then handle the Form's MouseLeave event, and reset the mouse to the last known position recorded by the code in MouseMove through the Form's Cursor property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 7:51 Friday 20th January, 2006
|
|
|
|
|
Hello All
I want to manually enter items in the combox as:
cbo.Items.Add("Supplier")<br />
cbo.Items.Add("Customer")
How i can add ValueMember Field data manually? As we have an option in VB6 as:
cbo.AddItem ("Supplier")<br />
cbo.ItemData(cbo.NewIndex) = 1 'How this can be done in VB.Net?<br />
<br />
cbo.AddItem ("Customer")<br />
cbo.ItemData(cbo.NewIndex) = 2 'How this can be done in VB.Net?
''''''''''' I have done this way is there any solution better than this? ''
<br />
Dim lDT As New DataTable<br />
Dim col As DataColumn<br />
Dim row As DataRow<br />
<br />
col = New DataColumn<br />
col.ColumnName = "PartyClassType"<br />
lDT.Columns.Add(col)<br />
<br />
col = New DataColumn<br />
col.ColumnName = "PartyClassTypeID"<br />
lDT.Columns.Add(col)<br />
<br />
row = lDT.NewRow<br />
row(0) = "Supplier"<br />
row(1) = "S"<br />
lDT.Rows.Add(row)<br />
<br />
row = lDT.NewRow<br />
row(0) = "Customer"<br />
row(1) = "C"<br />
lDT.Rows.Add(row)<br />
With cbo<br />
.DisplayMember = "PartyClassType"<br />
.ValueMember = "PartyClassTypeID"<br />
.DataSource = lDT<br />
End With<br />
Regards
|
|
|
|
|
|
I was wondering, is there any differences between :
1.
<code>
Import System.Data.Oledb
Dim con as New OledbConnection()
</code>
and
<code>Dim con as new Oledb.OledbConnection() </code>
2.
Dim myString as string = "bla bla bla"</code>
and
<code>Dim myString as String
myString = "bla bla bla"
or it's simply personal preference?
WiL
|
|
|
|
|
1. No. They're exactly the same. In the second Dim statement, you just needlessly typed the extra namespace specifier (OleDb.) You don't have to because the namespace is specifically imported in the first line of code.
2. No. It's just a matter of preference. They're functionaly the same.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
when i define a new class/module so it is a new datatype..
i can define an object from it,, how i can save the object to a file on the hard disk and to retrieve it(load from file)???
|
|
|
|
|
I'm not sure what default serialisation code exists, but you probably need to write code to save the data in your class, and to reload it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i need a sample code in vb.net to write/read a barcode?
|
|
|
|
|
Google is your friend and the code you write will depend HEAVILY on the barcode scanner your using. There is no "generic" code that works with every barcode scanner out there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When I make a query in sql server 2005 like "SELECT something FROM somewhere", there is a way to know the number of selected rows without the need of other query "SELECT COUNT(*) FROM somewhere" ?
Thanks
|
|
|
|
|
This is returned automatically unless the SELECT statement is preceded by a SELECT NOCOUNT ON statement. This is not applicable to Access databases though. Jet doesn't support returning the "number of rows affected".
What is it your're trying to do. So far, this question has nothing to do with VB.NET...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to redim an array to the number of rows selected, and fill this array from one of the columns of the query.
|
|
|
|
|
Then you're looking in the wrong place. Fill your DataSet, DataTable, or whatver your using to store the results of the query. Then use the count of the number of Rows in the collection to set your array dimensions.
Dim ds As DataSet
' code to fill DataSet with a couple of tables...
Dim arraySize As Integer
arraySize = ds.Tables("whatever").Rows.Count
Dim myArray(arraySize) As String
.
.
.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yes, you are right. I was working with a not too good method. With a dataset it's better implemented.
Thanks a lot.
|
|
|
|
|
No problem!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can i see the content of a sql database in a datagrid in a SmartDeviceApplication made in vb.net 2005?
I am developing a pocket pc se 2003 application and i cannot get to bind the sql data base with the datagrid in the pocketpc emulator
if anyone could help me... Thanks a lot
Mario
|
|
|
|
|
I want to get the windows system message WM_PASTE in my form,I use
If PeekMessage(wMsg, Me.Handle.ToInt32, WM_PASTE, WM_PASTE, <br />
<br />
PM_NOREMOVE) <> 0 Then<br />
...<br />
end if
But i cann't receive the WM_PASTE message when i paste one file from one folder to another.i changed "Me.Handle.ToInt32" to "vbnull",it failed,too.
i read msdn,know that this method can only receive message in current thread,then how can i get the message of the system?
-- modified at 10:37 Saturday 21st January, 2006
|
|
|
|
|
Are you saying that your trying to intercept the WM_PASTE message system wide? No matter what application the message is sent to?
You can't do it using PeekMessage. It'll only return messages that were sent to your application. The only way to get system-wide notification of messages is to implement a system-wide WH_GetMessage hook procedure. Any application that calls PeekMessage or GetMessage will force windows to send the message to your hook procedure first, you do whatever you want with it, then the message is sent to the application that called PeekMessage or GetMessage.
This is not for the faint of heart! Your hook procedure code must be tight...really tight! This is because your code is going to get called A LOT and any bottle neck in your hook proc code is going to slow down the entire system!
You can find out more by Googling for VB.NET WH_GetMessage[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i write a Module as follows
<br />
Imports System.Runtime.InteropServices<br />
Module modGetWinMsg<br />
Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As GetWinMsgDelete, ByVal hmod As Integer, ByVal dwThreadId As Integer) As Integer<br />
<br />
Private Declare Function CallNextHookEx Lib "user32" Alias "CallNextHookEx" (ByVal hHook As Integer, ByVal ncode As Integer, ByVal wParam As Integer, ByVal lParam As MSG) As Integer<br />
<br />
Private Declare Function UnhookWindowsHookEx Lib "user32" Alias "UnhookWindowsHookEx" (ByVal hHook As Integer) As Integer<br />
<br />
Private Const WH_GETMESSAGE As Integer = 3<br />
<br />
Private Const WM_PASTE As Integer = &H302<br />
<br />
Dim hRet As Integer<br />
<br />
Private Structure MSG<br />
Private hwnd As Integer<br />
Private message As Integer<br />
Private wParam As Integer<br />
Private lParam As Integer<br />
Private time As Integer<br />
Private pt As POINTAPI<br />
End Structure<br />
<br />
Private Structure POINTAPI<br />
Private x As Integer<br />
Private y As Integer<br />
End Structure<br />
<br />
Private Delegate Function GetWinMsgDelete(ByVal nCode As Integer, _<br />
ByVal wParam As Integer, _<br />
ByVal lParam As MSG) As Integer<br />
Private Function proGetWinMsg(ByVal nCode As Integer, ByVal wParam As Integer, ByVal lParam As MSG) As Integer<br />
If nCode = 0 Then<br />
If wParam = WM_PASTE Then<br />
MessageBox.Show("asdfsad")<br />
Return 1<br />
End If<br />
Return CallNextHookEx(hRet, nCode, wParam, lParam)<br />
End If<br />
End Function<br />
Public Sub GetMsg()<br />
hRet = SetWindowsHookEx(WH_GETMESSAGE, AddressOf proGetWinMsg, Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32, 0)<br />
End Sub<br />
Public Sub Unhook()<br />
If hRet <> 0 Then<br />
UnhookWindowsHookEx(hRet)<br />
hRet = 0<br />
End If<br />
End Sub<br />
End Module
Then i use it in form as follows
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
GetMsg()<br />
End Sub<br />
<br />
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
Unhook()<br />
End Sub
But i cann't make it right work.Why?
|
|
|
|
|
Hi Guys!! I need a function which can return me the free disk space of any drive for my Project of Bit Torrent Client in .Net. Thanx. Cya!!
Also i need to know how can we initialize all the elements of an array while declaring it. This is coz when ever i give Dim strArray() as String
and later when i use any element like: strArray(0) = "something"
i get an error on strArray saying that the array is beeing use before it can be be assigned a value. Plz help, What should i do???
Devraj Raut!!!
|
|
|
|
|
You declared an object as a pointer to an array, but you failed to tell the compiler how big to make the array:
Dim strArray(40) As String
will give you an array of 40 empty String objects.
Or, to expand on your code example, you could use something like this:
Dim strArray() As String
ReDim strArray(new size)
strArray(elementNumber) = "something"
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As for your Free Disk SPace problem. Google is your friend! Learn to use it. There's about a 245,000 hits when searching for "VB.NET get drive free space".
Click this[^] for an example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|