|
Thank you very much, I noticed that about 5 seconds before you replied.
Thanks,
Jim
|
|
|
|
|
Is this an old question or a new one? Or has your account been hacked?
|
|
|
|
|
Looks to me like something went wrong at CodeProject.
|
|
|
|
|
Dunno. It showed up in moderation yesterday.
|
|
|
|
|
i was declaring the API and got the error
Public Shared Function <DllImport("kernel32")> _
abc(byval str as string)as integer
problem is in <
identifier expected.
|
|
|
|
|
The DllImport attribute has to go on the line before the function declarartion, not in the middle of it...
|
|
|
|
|
it's an api
and the function abc is nothing but i provided as an example.
there is some other function.
|
|
|
|
|
yaa,i know function abc is an example
use this code
<<system.runtime.interopservices.dllimport("kernel32.dll")> _
Public Shared Function abc(ByVal s as string) As Integer
End Function
use following link
http://pinvoke.net/default.aspx/user32.GetWindowLong
Hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
thanks boss .it is working
|
|
|
|
|
How to detect Internet connection is live of disconnected in VBS
Me and Program both have logical waves.
|
|
|
|
|
Can some1 please help me with the VB.NET code to insert/save a picture/image to a sql server db. Please also inclide the one that will help me retrieve those images.
jtc
|
|
|
|
|
i get this exception at the Open() method while connecting to a remote SQL server :
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
while i have
Windows server 2003 on both systems.
SQL Server 2000 on both systems.
application is developed in visual studio 2005
thank you for a quick response
|
|
|
|
|
How to validate the text in the text box when entering an email-id?
sri
|
|
|
|
|
With a regular expression, generally. There are lots of examples on the web of regex for email, Expresso comes with one ( and you should download it as it's invaluable for regex ), and then handle the leave event of the control, so you validate the input via the RegEx class when the user has finished typing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to display some invoice details in a datagridview (dgv). I want the user to be able to click a check box, which I've added to the dgv, so that they can indicate whether they want the invoice amount or invoice total to be used in calculations on that invoice. There are boolean properties called UseInvAmount and UseInvTotal in the invoice object. I can get the check box to appear in the grid okay, but clicking on it does not make a check appear, even though the cellContentClick sub fires when the checkBox cell is clicked. I've got code that handles the 2 events: cellValueNeeded & cellValuePushed, and I've also added 2 event handlers to the dgv (DataGridViewCellEventHandler & DataGridViewRowsAddedEventHandler) and registered the dgv's "with events", but the cellValueNeeded and cellValuePushed code are not triggered by clicking on the checkboxes. Can anyone tell me what I've left out or how to make a checkbox click on & off, and work independently of another one?
Pauki
|
|
|
|
|
i cannot understand your requirement fully pauki.the event CellValueChanged is fired after a checkbox is checked.but before handling that event u have to handle one more even ie CurrentCellDirtyStateChanged.i have given that code below
Private Sub DataGridView1_CurrentCellDirtyStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.CurrentCellDirtyStateChanged
Try
If DataGridView1.IsCurrentCellDirty Then
DataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
Catch ex As Exception
End Try
End Sub
after that handle the event CellValueChanged like this
If e.RowIndex > 0 Then
If DataGridView1.Item(0, e.RowIndex).Value Then
MsgBox("hello")
End If
End If
if u need more explantion reply
shally
|
|
|
|
|
thanx Shally,
I did actually try this code too,
and altho it fired, I was still bothered by the fact that it didn't automatically set the check in the box (I guess I could try to set the value in the checkbox, but instead I tried using 1 unbound checkbox, useInvTotal, rather than the 2 bound boolean properties, and that seemed to work). I can't believe that it's so complicated just to get a checkbox to write back to the db - (i.e. cellContentClick is also fired on clicking a cell, and all this need for cellValueNeeded, cellValuePushed etc. to set the initial values...) I'll see if I can get your suggestion to work anyway. thanks again, PK
|
|
|
|
|
hi all,
I have MS-Access database .So how i can protect by database from running malicious code.I think MS-Access don't provide Stored Procedure.So attacks are obvious on the database.
Thank You
|
|
|
|
|
You can write a type of proc for later versions of Access. For earlier versions, all you can do is sanitise the input yourself, the main thing is to make sure you double quotes, so " and ' become "" and '' within the string. If it's a string, it's going to be fine. If it terminates a string, then anything after it becomes SQL. You should do this anyhow, either get rid of quotes, or prepare them to be passed through to the database.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Christian Graus wrote: "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Seriously?! :swoon:
|
|
|
|
|
hi all,i'm using listview code by vb .net to display a information. how i can get the value from listview .
company customer value
------- --------- -----------
1 a 10
2 b 20
1 c 30
how i get the customer value in row 2, if my mouse click in row 2.
i read the data from the database and the columns sequence maybe change,
eg. the database fields is fldCom,fldCust,fldValue. i will retieve the fldcust only.
eg. fldcust in columns 2 and after change fldcust will in columns 3.
retrive it without know the index.
thank's in advance for your help
-- modified at 2:36 Wednesday 30th May, 2007
|
|
|
|
|
listview1.FocusedItem.SubItems(0).Text
|
|
|
|
|
Hi
I am working on login form using VB 2005 and sql 2000 i made 2 text boxes and 2 buttons
on click on ok button it will cal the follwing function
EmployeeCode = txtEmployeeCode.Text
EmployeePassword = txtEmployeePassword.Text
ConnectionString = "Data Source=HAKMEH;Initial Catalog=HMS;Integrated Security=True"
Login(ConnectionString, EmployeeCode, EmployeePassword)
THE FUNCTION IS :
Public Sub Login(ByVal ConnectionString As String, ByVal EmployeeCode As String, ByVal EmployeePassword As String)
Dim ds As New DataSet
ds.Clear()
Dim MyConnection As New SqlConnection(ConnectionString)
Dim SelectQuery As String = "Select EmployeeCode,EmployeePassword from tblEmployees where EmployeeCode = ('" & txtEmployeeCode.Text & "') and EmployeePassword = ('" &_ txtEmployeePassword.Text & "')"
Dim adapter As New SqlClient.SqlDataAdapter
Dim MyCommand As New SqlCommand(SelectQuery, MyConnection)
MyConnection.Open()
Dim Command As String = MyCommand.ExecuteNonQuery
**** adapter.Fill(ds, "tblEmployees") ****
Dim dt As DataTable = ds.Tables(0)
If dt.Rows.Count <> 0 Then
frmAdministrator.Show()
Else
MsgBox("You are not Authorized to access")
End If
MyConnection.Close()
End Sub
when it comes to the line with stars it gave me the follwoing message
The SelectCommand property has not been initialized before calling 'Fill'.
so where is the error
Final Fantasy Maniac
|
|
|
|
|
You need to change all of this:
1 - your SQL retrieves the correct user password, so anyone who had access to the code, could find out the password.
2 - you're just inserting text from a textbox, which means someone who is not logged in can erase your entire database. Read up on SQL injection attacks.
The code looks wrtong, you create a command, open the connection manually, call ExecuteNonQuery ( this is definately wrong, as it doesn't return a result, why would you run it that way ? ), and then try to fill the dataste from the adapter ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|