M.Waqas Aslam 67 Posting Pro in Training Featured Poster

ashuag i think this is almost not possible to get exact solution which you want ,there so many opensource application dealing with doctors , chemists , labs etc , in order to get better solution according to your prob you have to hire a professional programmer or develop it by your slef , we here to help you at any step . but you have to take your first step . :)

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

just try to make some changes in code , where i am minus 1 from hr , use add . without efforts you cant learn anything.

regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
please check the attach sample project of count down counter .
here is a code ,
i have three textboxes , txtsec , txtmint , txthours. and a timer here is a code .

    Dim sec As Int16
    Dim mint As Boolean
    'use this code at the timer 
     sec = sec + 1
        txtSec.Text = sec
        If sec = 60 Then
            txtmint.Text = Val(txtmint.Text) + 1
            If txtmint.Text = 60 Then
                mint = True
                txtmint.Text = 0
            End If

            If txtmint.Text = 0 And mint = True Then
                txthr.Text = Val(txthr.Text) - 1
                mint = False
            End If
            sec = 0
            txtSec.Text = 0
        End If

set your timer interval according to your equirement . 1000 is equal to 1 sec.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello
try something like this.

dim con as new sqlconnection("connection string")
dim cmd as new sqlcommand
con.open()
cmd.connection = con 
cmd.commandtext = "update table1 set col1=@col1,col2=@col2,col3=@col3,col4=@col4 where recid = @recid"
cmd.paramerter.addwithvalues("@col1",txt1.text)
cmd.paramerter.addwithvalues("@col2",txt2.text)
cmd.paramerter.addwithvalues("@col3",txt3.text)
cmd.paramerter.addwithvalues("@col4",txt4.text)
cmd.paramerter.addwithvalues("@recid",txtRecId.text)
cmd.ExecutenonQuery()
con.close()

hope this will help you .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

and also you can use delete command in place of update and insert command.
Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

well there is a site Click Here you can find your required application from here , hope this will solve your prob

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

try something like this

dim con as new sqlconnection("connection string")
dim cmd as new sqlcommand
con.open()
cmd.connection = con 
cmd.commandtext = "update table1 set col1=@col1,col2=@col2,col3=@col3,col4=@col4 where recid = @recid"
cmd.paramerter.addwithvalues("@col1",txt1.text)
cmd.paramerter.addwithvalues("@col2",txt2.text)
cmd.paramerter.addwithvalues("@col3",txt3.text)
cmd.paramerter.addwithvalues("@col4",txt4.text)
cmd.paramerter.addwithvalues("@recid",txtRecId.text)
cmd.ExecutenonQuery()
con.close()

i typed it here so may be there are some spelling mistakes in it ,hope this will solve your prob :)

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thread is solved now .thanks both of you.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

yes there are values in grid .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thanks for the reply bro , but i find nothing form your link about my prob .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello ,
i am getting error on it , object refrence is not set to an instance of an object ,
my code is

  if (dgvBlockSites.Rows[j].Cells[1].Value.ToString() != "-1")
                    {
                    //-------------- some code here
                    }

i dont know what is wrong with it , i have 4 or 5 rows in my grid , it give above mentioned error .
do any one has any idea how to deal with it ?

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thanks both of you for your help . i just run my application as administrator and just make changes in my file ,

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

as you said jim

Wrong. First of all there are only eight planets. Furthermore, the outer four bear no resemblance to Earth. Two are gas giants and two are ice giants. Please tell me your definition of similar.

then if you move back about 4 or 5 years then there were 9 planets , but after some more research pluto is droped from the list , so you dnt know about up comming researches but yes God knows every thing.

At each of these stages, changes were introduced by accident, for political or ideological reasons, or because the translator did not understand the idioms of the time.

as you accept that there is changes in bible which means there is doubt in its teachings , because human make changes in it according to their needs , so rules made by bible are not valid , but in quran not a single word changes in 1400 years , 1400 years is not a small time to change any book written by humans , islam is way to spend life in quran there are rules made by the creator of universe for humans to spend their life according to them ,in quran Allah said ,
1-speak truth
2-respect others
3-never kill anyone who is innocent.
4-avoid alcohol
5-stay away from voilence.
6-Islam is against rape.
7-respect women
.
.
.
etc
there are uncount able things …

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

and please also watch this video Click Here
mr jim , you want some proofs here they are .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

quran is a Word OF GOD , if you dont think so please visit this link Click Here
you can get positivity from any discussion when you are willing to understand others point of view istead of putting your point of view on theres ,
there are lots of other points in quran about modren science about universe about sea about human body , but for those , who are willing to understand.

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

quran is word of God , and there is no changes in it even after 1400 years .There are currently millions of muslims who fully memorised same exact qur'an down to the dots and crosses so to speak
These millions of people are spread in all corners of the world from as young as 7 yo child to 90 yo.

Had there been any alterations during 1,400 years, there would have been no way these millions of muslims read and memorised the same qur'an.
but if you are talking about bible and other religious books then you will find many versions of each , how will you explain it ?

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

can you please explain it little bit , i cant get your point.

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i am working on a simple application that can block the sites ,after searching i found that if i add name of the site in c:\windows\system32\drivers\etc\hosts then i can block those sites , for this i want to open this hosts file in my textbox with administrator rights , so that it can save changes. how i can do this ? do i have to run my application with administrator rights or i can just open hosts file in my textbox with administrator rights ?

regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thanks hericles . i have to come to know that i can just block any website byu just entering its name in C:\windows\system32\drivers\etc\hosts . but prob is that i want to open this file as administrator so that i can make changes init ,is there any way to open any text file with administrator right and show its all data in my textbox. using vb.net or c# ?

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

your code worked for me . i just make some changes init according to my requirement. thank you so much ,
Thread is solved.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

i just check your given links ,but prob is same , :( , is there anyother way to done this .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

i want to calculate the total key press , including space enter , backspace function keys etc. i have this code of keylogger , but this code is not working on vs2008 .net framework 4.0 . please how i can make to work.

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer

 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        On Error Resume Next
        Dim result As Integer
        Dim key As String
        Dim i As Integer
        For i = 2 To 90
            result = 0
            result = GetAsyncKeyState(i)
            If result = -32767 Then
                key = Chr(i)
                If i = 13 Then key = vbNewLine
                Exit For
            End If
        Next i
        If key <> Nothing Then
            If My.Computer.Keyboard.ShiftKeyDown OrElse My.Computer.Keyboard.CapsLock Then
                TextBox1.Text &= key
            Else
                TextBox1.Text &= key.ToLower

            End If
        End If
    End Sub

.

Best Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thanks all of you , i solved my prob , my prob was that i do not make free my foxpro tables from the dbc . i found code in c#, and after making dll , i am using it ,here is a code , to free the foxpro table from the dbc.

private void FreeFoxTable(string cTableName)
        {
            string dataDIR = Path.GetDirectoryName(cTableName);
            string connString = @"Provider=vfpoledb.1;Data Source=" + dataDIR;
            string CDXFile = Path.ChangeExtension(cTableName, "CDX");
            OleDbConnection conn = new OleDbConnection(connString);
            OleDbCommand cmd = new OleDbCommand("EXECS([USE " + cTableName + "])", conn);
            conn.Open();

            try
            {
                // Use the table. If it's a member of a (missing) DBC we get
                // an error cannot open file .... <something>.dbc
                cmd.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                if (err.Message.ToLower().Contains("cannot open file") && err.Message.ToLower().Contains("dbc"))
                {
                    // Free the DBF from the DBC container.
                    // We use the FoxPro command "FREE TABLE" to do this
                    // and execute it through the VFP OLE DB Provider
                    // usign the FoxPro EXECS() function.
                    cmd.CommandText = "EXECS([FREE TABLE " + cTableName + "])";
                    cmd.ExecuteNonQuery();
                    conn.Close();
                    conn.Dispose();
                    cmd.Dispose();
                }
            }

            // Delete any index file that may be associated with the table being checked.
            // This prevents a "variable not found" error opening the table if there happens
            // to be an index expression that uses long field names which may be no longer
            // valid since we removed the DBF from the DBC.
            if (File.Exists(CDXFile)){
                File.Delete(CDXFile);
            }
        } 

and this one.

private void button1_Click(object sender, EventArgs e)
        { …
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

i cant get your point please be more specific , and little bit explain ,it .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i want to restrict user to not visit www.abc.com site , from my pc , how can i do it in c# , user will use chrome , firfox , IE etc ,

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

please use this code , it is working fine at my end.

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Chr(Keys.Enter) Then
            TextBox1.Text = Now().Date.ToShortDateString
        End If
    End Sub

this code is not working with f3 or any function key ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i am working on a simple parental lock application . i want to know all the websites visited by the user , i mean , for example now i am visiting daniweb.com , is there is any way to get the name of daniweb.com and after getting it i want to write this address on a text file . main issue is to get the name of sites visited by the user.
i have no idea how to perform this .
if all above is not possible , then is there any way to close browser if someone want to visit specific site , for example i have a site name www.abc.com , now i want that no on this pc can visit this site , now if user trying to visit this site his browser will closed.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i want to develop the keycounter , i mean i want to get the total no. of key pressed by the user in the specific time , i have a code of keylogger , i can use it to get the text in that time period and after that just get its length , but i dont want to use this . here is a code of VB.net which i found so for on msdn

Private Shared keyPressCount As Long = 0
    Private Shared backspacePressed As Long = 0
    Private Shared returnPressed As Long = 0
    Private Shared escPressed As Long = 0


    Private Sub myKeyCounter(ByVal sender As Object, ByVal ex As KeyPressEventArgs)
        Select Case ex.KeyChar
            ' Counts the backspaces.
            Case ControlChars.Back
                backspacePressed = backspacePressed + 1
                ' Counts the ENTER keys.
            Case ControlChars.Lf
                returnPressed = returnPressed + 1
                ' Counts the ESC keys.  
            Case Convert.ToChar(27)
                escPressed = escPressed + 1
                ' Counts all other keys.
            Case Else
                keyPressCount = keyPressCount + 1
        End Select

        textBox1.Text = backspacePressed & " backspaces pressed" & _
            ControlChars.Lf & ControlChars.Cr & escPressed & _
            " escapes pressed" & ControlChars.CrLf & returnPressed & _
            " returns pressed" & ControlChars.CrLf & keyPressCount & _
            " other keys pressed" & ControlChars.CrLf
        ex.Handled = True
    End Sub 'myKeyCounter

and

    Public Sub New()
        InitializeComponent()

        AddHandler TextBox1.KeyPress, AddressOf myKeyCounter
    End Sub 'New

i get this code from this link Click Here. this code working fine but only when my …

zrehman809 commented: is there an application (or an "innocuous" keylogger) that could tally how often I press the keys on my console amid a particular time +0
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

shortcut key ? please explain little bit . and as i understand your question you can do like this.

' use this code on the textbox keypress event 
if e.keychar = chr(keys.f3)
 textbox1.text = now().tostring
end if

hope this will help you.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

what do mean by passing values , are you want to add value in any cell ?

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

thanks both of you , but still i am not able to connect my .dbf file with vb.net. i dont know how to use these drivers. please if possible then can you explain it.
i am using this code to connect , please check this

import system.data.odbc


'----------------------------------------
dim con as new odbcconnection("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=227;Dbq='C:\TITEM.dbf'")

' and this one

dim con as new odbcconnection("Driver={Microsoft Visual FocPro Driver};UID=;PWD;SourceDB='C:\TITEM.dbf';SourceType=DBF;Exclusive=NO;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes")

but both the strings are not working for me , can you please provide some example code ?

Best Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

please mark this thread solved.

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

the better way is to auto save your data after specific time as in Visual studio .VS save data i think in every 5 mint , in a temp file , so if your system restarted abnormally then VS ask you on the next start that you want to restore ? .
i think you can also use this , just take a backup after 5 mints and when user close application then your program should delete the temp file , but if your computer goes of due to power failuer you can just check if there is temp exist in your directory thats mean your program was closed abnormally now you can read all your saved information . and if file is not in your directory then thats mean that your application was closed normally. hope this will helps you to solve your issue.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

and you can use this query also.

select * from myTable where MovieName = 'VI'

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

dear ninjastormns you can just change the following value Txtrandom.Text = Gen.Next(1, 101).ToString to Txtrandom.Text = Gen.Next(1, 100).ToString it will generates from 1 to 100.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

please always ask to the point question , this will make easy to others to help you , now tell me the basic prob you are facing . so that i can better answer your prob.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

can you please just tell me your requirements , not code or what you have done so far , just to the point tell me your requirements.

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

well i think we can only get the system date time , and we consider it orignal date time , .you can get time from any server , or from any site .

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

if your prob is solved please mark this thread solved,

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

and you can manually format your string of masg by using vbcrlf , vbtab etc ,

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

if you are using vs2010 then GetAsyncKeyState lib will not work ,

regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

or you can use isnull(value , 0 ) in mssql

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

change this code with this

Checkbox1.Text * TextBox2.Text ' it your code change it 

val(Checkbox1.Text) * val(TextBox2.Text) ' use this code.
alexandra.lopez.94043 commented: If Checkbox1.Checked = True Then welcomemessage = TextBox2.Text & vbTab & Checkbox1.Text & Str(Val(Checkbox1.Text) & Val(TextBox2.Text)) & vbCr totalprice = Str(Val(Checkbox1.Text) & Val(TextBox2.Text)) +0
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

try somthing like this.

'on form1 we have two textboxes (txtName ,txtAge) and one button and on form2 we have grid having two columns ,
'name and age .
'now use this code at the button click event on the form1.
form2.show()
'now use this code at the load event of form2.

datagridview1.rows.add(form1.txtName.text,form2.txtAge.text)

'this will show textboxes data into a single row.
'now use this code at the double click event of your grid.
'i assume that form1 is already open.
form1.txtName.text = datagridview1.item(0,datagridview1.currentrow.index).value.tostring()
form1.txtAge.text = datagridview1.item(2,datagridview1.currentrow.index).value.tostring()

hope this will help you.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello !
i want to connect foxpro db file .dbf and want to show all the records in my grid . i am using vs2008
can anyone give some idea.

Regards.

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

well you just need to add a hidden column , when you insert the new row insert -1 to that column , and when you are saving all data in grid , just check that is that column value is -1 , if yes then call insert function and otherwise just call update function ,

for i = 0 to datagridview1.rows.count-1
if datagridview1.item(2,i).value = -1 then
'here you can call insert code.
else
'here you can call update code.
end if

next

regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

hello!
i am developing a simple application which will get data from different database like mssql , access , foxpro , and after getting data it will create 4 text files tows.txt , customer.txt , product.text , trasection.txt ,
prob is this that i am very new to foxpro , i dont know abc of it , and also the names of columns are very strange to me , like Id_t = invoice date , so my question is , how can i get full structure of foxpro db , or is it possible to easily import all the tables into mssql then just fetch data.

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

well you can do like this , by default the grid is editable you can edit its cell by double clicking on it , after adding data or inserting your information in the grid. just use loop and insert your data into your db , here is an example code.

' i create this sub because it will easy to use and it will also easy to chane , 
'i am passing two variables name and age , these variables are used to get the values form the controls.
sub myinsert(byval name as string , byval age as string)

dim con as new sqlconnection("your connection string")
con.open()
dim cmd as new sqlcommand
cmd.connection = con
cmd.commandtext = "insert into table1 (name,age) values (@name,@age)"
cmd.parameters.addwithvalue("@name",name)
cmd.parameters.addwithvalue("@age",age)
cmd.executenonquery()
con.close()

End Sub
' now after creating this sub you can call it on the save button like this.
'i am using loop to insert all the rows into the database , 

for i = 0 to datagridview1.rows.count -1 
myinsert(datagridview1.item(0,i).value.tostring,datagridview1.item(1,i).value.tostring)
Next

this code will insert all the records into the database , you can also use update command to update all your records , hope this time you can better understand .

Regards

M.Waqas Aslam 67 Posting Pro in Training Featured Poster

well , there is not that much time to read all your code , i have a better suggestion for you , you can just edit all the records in your grid , after that save all your records , it is simple fast and it will reduce your work ,

Regards

prancode commented: can you send me the code to do it? +0
M.Waqas Aslam 67 Posting Pro in Training Featured Poster

please have a look on this link Click Here