Naveed_786 25 Posting Whiz in Training

Here is the solution i have resolve it

Private Sub dataGridView1_CellClick(ByVal sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles DataGridView1.CellClick

        DataGridView1.CurrentRow.Cells(0).ReadOnly = True
        DataGridView1.CurrentRow.Cells(7).Value = Now
    End Sub
Naveed_786 25 Posting Whiz in Training

Yes, the user should not be able to edit the value of the cell and also i want to show date in one cell.

Naveed_786 25 Posting Whiz in Training

How can we disable a cell of datagrid in vb.net and how to show date in datagrid cell in vb.net

Naveed_786 25 Posting Whiz in Training

I have resolved the issue thanks.

Naveed_786 25 Posting Whiz in Training

Here is the code which is working fine for me on another form but creating problem when i use the same code on another form it gives me this error message when i try to insert a new record in DB "Value cannot be null Parameter name: Data Table"

and here is the code

Imports System
Imports System.Data.OleDb
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Public Class frmprrec
    Private myDA As OleDbDataAdapter
    Private mydataset As DataSet
    Private bindingsource1 = New BindingSource
    Private Sub frmprrec_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.ColumnHeadersDefaultCellStyle.Font = New Font("Tahoma", 9, FontStyle.Bold, GraphicsUnit.Point)
        DataGridView1.ColumnHeadersDefaultCellStyle.BackColor = SystemColors.ControlDark
        DataGridView1.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.[Single]
        DataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
        DataGridView1.DefaultCellStyle.Font = New Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point)
        DataGridView1.DefaultCellStyle.BackColor = Color.Empty
        DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = SystemColors.ControlLight
        DataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.[Single]
        DataGridView1.GridColor = SystemColors.ControlDarkDark

        DataGridView1.AutoGenerateColumns = False

        Dim clmprno As New DataGridViewTextBoxColumn
        clmprno.HeaderText = "PR NO"
        clmprno.DataPropertyName = "PR_NO"
        DataGridView1.Columns.Add(clmprno)

        Dim clmItemName As New DataGridViewTextBoxColumn
        clmItemName.HeaderText = "ITEM NAME"
        clmItemName.DataPropertyName = "ITEM"
        DataGridView1.Columns.Add(clmItemName)

        Dim clmqty As New DataGridViewTextBoxColumn
        clmqty.HeaderText = "QUANTITY"
        clmqty.DataPropertyName = "QTY"
        DataGridView1.Columns.Add(clmqty)


        Dim clmprr As New DataGridViewTextBoxColumn
        clmprr.HeaderText = "PUR REASON"
        clmprr.DataPropertyName = "PUR_REASON"
        DataGridView1.Columns.Add(clmprr)


        Dim clmPDate As New CalendarColumn
        clmPDate.HeaderText = "PR Date"
        clmPDate.DataPropertyName = "PR_DATE"
        DataGridView1.Columns.Add(clmPDate)


        Dim clmst As New DataGridViewComboBoxColumn
        clmst.HeaderText = "STATUS"
        clmst.DataPropertyName = "STATUS"
        DataGridView1.Columns.Add(clmst)
        clmst.MaxDropDownItems = 10
        clmst.Items.Add("ITM")
        clmst.Items.Add("AITM")
        clmst.Items.Add("PM")
        clmst.Items.Add("SDF")
        BindData()
        DataGridView1.DataSource = bindingsource1
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            For r = 0 To DataGridView1.RowCount - 2 ' Why RowCount-2? 
                For Each cell As DataGridViewCell …
Naveed_786 25 Posting Whiz in Training

Are you sure you are using vb.net as i know there is only one name by default which is datagridview1 if you have changed the name of datagridview1 to datagrid1 then just replace datagridview1 with datagrid1

Naveed_786 25 Posting Whiz in Training

Yes debasisdas is right you must show your code so that anybody could be able to help you.

Naveed_786 25 Posting Whiz in Training

Uninstall the visual studio then install it it would resolve the issue.

Naveed_786 25 Posting Whiz in Training

First of all you should mention the language you are using is it VB.NET

if yes then here is the code

Private Sub DataGridView1_UserAddedRow(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles DataGridView1.UserAddedRow
        If DataGridView1.Rows(e.Row.Index).IsNewRow Then
            If e.Row.Index = 1 Then
                DataGridView1.Rows(e.Row.Index - 1).Cells(0).Value = e.Row.Index
            Else
                DataGridView1.Rows(e.Row.Index - 1).Cells(0).Value = DataGridView1.Rows(e.Row.Index - 2).Cells(0).Value + 1
            End If
        End If
    End Sub
Naveed_786 25 Posting Whiz in Training

Dear All,

How can i change the dtPicker style to 2D i.e what i want i want to have dtpicker in my textbox when i click in text box then the dtpicker should open how to achieve this please help me if it is possible in VB.NET.

Thanks in advance.

Unhnd_Exception commented: Post a thread. Respond when people help you. -2
Naveed_786 25 Posting Whiz in Training

It is application log in user which exists in database.

Naveed_786 25 Posting Whiz in Training

How can i display currently login user in crystal reports i.e when i run crystal report through my report form the username should be displayed in crystal report i am able to view the currently login user on my forms but didn't know how to schive this in crystal reports i have a global variable Useraname which contains the currently login user.

Please help me to resolve this issue.

Thanks in advance.

Naveed_786 25 Posting Whiz in Training

How???

Naveed_786 25 Posting Whiz in Training

Its working now please now tell me i want to take backup on two basis

1. Hourly basis
2. Whole backup

For example i want to make automatically folder for every hour and then want to make backup in it with department name(There should be main folder Today then hourly folder should be inside it).
Similarly i want to make backup of whole day which should be date wise

Naveed_786 25 Posting Whiz in Training

Same error on command prompt

Naveed_786 25 Posting Whiz in Training

I have made batch file as the code provided by you here is the code

for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set fdate=%%a%%b%%c
  
      for /f "tokens=1,2,3,4,5 delims=: " %%a in ('time /t') do set ftime=%%a%%b%%c%%d%%e

      exp userid=HR/HR@dummy file=D:\BACKUP\backup%fdate%%ftime%.dmp log=D:\BACKUP\backup%fdate%%ftime%.log

but when i run the batch file it gives me following error

Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
EXP-00056: ORACLE error 942 encountered
ORA-00942: table or view does not exist
EXP-00000: Export terminated unsuccessfully

What could be the problem.

Naveed_786 25 Posting Whiz in Training

Thanks only one thing more how to specify my server which is on My domain
and i want to exp dump for every user in different folder.

Naveed_786 25 Posting Whiz in Training

I want to know how to write this scrip please would you provide steps with coding example

Naveed_786 25 Posting Whiz in Training

Dear all,

Can any one tell me how can i take bakup on Every minute and hourly and complete whole day backup using VB.NET i.e i want to know the coding example

Thanks in advance

Naveed_786 25 Posting Whiz in Training

how to make login form in oracle forms 10g???

please help me

Naveed_786 25 Posting Whiz in Training

It is giving message globel variable does not exists.

Can you make it in this way that user login t through login form and then it should check the user permission and then accordingly it should enable or disable the save,edit,search buttons. you can email me at mrakhter_786@yahoo.com

Thanks for your great help.

Naveed_786 25 Posting Whiz in Training

Ok let me play around the permission if i would any problem i will post here any way thanks for suggestion.

Naveed_786 25 Posting Whiz in Training

Please would you like to provide example with some logic.

Naveed_786 25 Posting Whiz in Training

Can nay one tell me how can i set user permissions on form level to control user i.e i want to allow user1 only add permission and uer2 should have both add and edit permission how to do it on form level.

Thanks in advance.

Naveed_786 25 Posting Whiz in Training

I have resolved the problem by setting the default values of all prices and qunatity to 0 any way thanks for your help.

Naveed_786 25 Posting Whiz in Training

Ok let me try

Naveed_786 25 Posting Whiz in Training

I have posted sql

Naveed_786 25 Posting Whiz in Training

HERE IS THE STATEMENT YOU ASKING FOR

"INSERT INTO PR_REC(pr_no,item1,price1,qty1,item2,price2,qty2,item3,price3,qty3,item4,price4,qty4,item5,price5,qty5,item6,price6,qty6,item7,price7,qty7,item8,price8,qty8,item9,price9,qty9,item10,price10,qty10,Pur_reason,pr_date,Status) VALUES (505056,'CPU',15000, 1,'RAM', 1200,1,'KEYBOARD',1500,2,'',,,'',,,'',,,'',,,' ',,,' ',,,' ',,,'BACKUP',to_date('06/03/2011 11:41:43','mm/dd/yyyy hh24:mi:ss'),'IT Support')"

AND THE INSERT STATEMENT IS THIS I HAVE MADE SOME CHANGES IN IT

com = New OleDbCommand("INSERT INTO PR_REC(pr_no,item1,price1,qty1,item2,price2,qty2,item3,price3,qty3,item4,price4,qty4,item5,price5,qty5,item6,price6,qty6,item7,price7,qty7,item8,price8,qty8,item9,price9,qty9,item10,price10,qty10,Pur_reason,pr_date,Status) VALUES (" & Me.txtprno.Text.Replace(",", ".") & ",'" & Me.txtitm1.Text & "'," & Me.txtprc1.Text.Replace(",", ".") & ", " & Me.txtqty1.Text.Replace(",", ".") & ",'" & Me.txtitm2.Text & "', " & Me.txtprc2.Text.Replace(",", ".") & "," & Me.txtqty2.Text.Replace(",", ".") & ",'" & Me.txtitm3.Text & "'," & Me.txtprc3.Text.Replace(",", ".") & "," & Me.txtqty3.Text.Replace(",", ".") & ",'" & Me.txtitm4.Text & "'," & Me.txtprc4.Text.Replace(",", ".") & "," & Me.txtqty4.Text.Replace(",", ".") & ",'" & Me.txtitm5.Text & "'," & Me.txtprc5.Text.Replace(",", ".") & "," & Me.txtqty5.Text.Replace(",", ".") & ",'" & Me.txtitm6.Text & "'," & Me.txtprc6.Text.Replace(",", ".") & "," & Me.txtqty6.Text.Replace(",", ".") & ",'" & Me.txtitm7.Text & "'," & Me.txtprc7.Text.Replace(",", ".") & "," & Me.txtqty7.Text.Replace(",", ".") & ",'" & Me.txtitm8.Text & " '," & Me.txtprc8.Text.Replace(",", ".") & "," & Me.txtqty8.Text.Replace(",", ".") & ",'" & Me.txtitm9.Text & " '," & Me.txtprc9.Text.Replace(",", ".") & "," & Me.txtqty9.Text.Replace(",", ".") & ",'" & Me.txtitm10.Text & " '," & Me.txtprc10.Text.Replace(",", ".") & "," & Me.txtqty10.Text.Replace(",", ".") & ",'" & Me.txtpr.Text & "',to_date('" & textDateTime & "','mm/dd/yyyy hh24:mi:ss'),'" & ComboBox1.Text & "')", con)
Naveed_786 25 Posting Whiz in Training

well its fine when i try to enter all values its ok but when i try to enter some values and leave some text boxes blank it gives me following error

"ONE OR MORE ERROR OCCURRED DURING PROCESSING OF COMMAND "ORA-00936"

What could be the problem??

Naveed_786 25 Posting Whiz in Training

Every variable has value

Com = nothing

Me.txtprno.Text = "505051"
Me.txtitm1.Text = "CPU"
Me.txtprc1.Text = "21000"
Me.txtqty1.Text = "1"
Me.txtitm2.Text = "LCD"
Me.txtprc2.Text = "25000"
Me.txtqty5.Text = "1"
Me.txtitm3.Text = "RAM"
Me.txtprc3.Text = "6000"
Me.txtqty9.Text = "3"
Me.txtitm4.Text = "MOBILE"
Me.txtprc4.Text = "25000"
Me.txtqty2.Text = "1"
Me.txtitm5.Text = "VGA"
Me.txtprc5.Text = "25000"
Me.txtqty6.Text = "1000"
Me.txtitm6.Text = "POWER"
Me.txtprc6.Text = "15000"
Me.txtqty6.Text = "1000"
Me.txtitm7.Text = "CDS"
Me.txtprc7.Text = "1500"
Me.txtqty10.Text = "1000"
Me.txtitm8.Text = "DVD"
Me.txtprc8.Text = "1500"
Me.txtqty3.Text = "100"
Me.txtitm9.Text = "MOUSE"
Me.txtprc9.Text = "500"
Me.txtqty7.Text = "50"
Me.txtitm10.Text = "BOOKS"
Me.txtprc10.Text = "1500"
Me.txtqty11.Text = "100"
Me.txtpr.Text = "IT BACKUP"
textDateTime = "06/01/2011 17:33:16"
ComboBox1.Text = "IT Support"

These are the values in textboxes

Naveed_786 25 Posting Whiz in Training

This is my sql Statement

com = NEW OleDbCommand("INSERT INTO PR_REC(pr_no,item1,price1,qty1,item2,price2,qty2,item3,price3,qty3,item4,price4,qty4,item5,price5,qty5,item6,price6,qty6,item7,price7,qty7,item8,price8,qty8,item9,price9,qty9,item10,price10,qty10,Pur_reason,pr_date,Status) VALUES ('" & Me.txtprno.Text.TRIM & "','" & Me.txtitm1.Text.TRIM & "','" & Me.txtprc1.Text.TRIM & "', '" & Me.txtqty1.Text.TRIM & "','" & Me.txtitm2.Text.TRIM & "', '" & Me.txtprc2.Text.TRIM & "','" & Me.txtqty5.Text.TRIM & "','" & Me.txtitm3.Text.TRIM & "','" & Me.txtprc3.Text.TRIM & " ','" & Me.txtqty9.Text.TRIM & "','" & Me.txtitm4.Text.TRIM & " ','" & Me.txtprc4.Text.TRIM & " ','" & Me.txtqty2.Text.TRIM & "','" & Me.txtitm5.Text.TRIM & " ','" & Me.txtprc5.Text.TRIM & " ','" & Me.txtqty6.Text.TRIM & "','" & Me.txtitm6.Text.TRIM & " ','" & Me.txtprc6.Text.TRIM & " ','" & Me.txtqty6.Text.TRIM & "','" & Me.txtitm7.Text.TRIM & " ','" & Me.txtprc7.Text.TRIM & " ','" & Me.txtqty10.Text.TRIM & "','" & Me.txtitm8.Text.TRIM & " ','" & Me.txtprc8.Text.TRIM & " ','" & Me.txtqty3.Text.TRIM & "','" & Me.txtitm9.Text.TRIM & " ','" & Me.txtprc9.Text.TRIM & " ','" & Me.txtqty7.Text.TRIM & "','" & Me.txtitm10.Text.TRIM & " ','" & Me.txtprc10.Text.TRIM & " ','" & Me.txtqty11.Text.TRIM & "','" & Me.txtpr.Text.TRIM & "',to_date('" & textDateTime & "','mm/dd/yyyy hh24:mi:ss'),'" & ComboBox1.Text.TRIM & "')", con)
Naveed_786 25 Posting Whiz in Training

Sorry i didn't understand what are you saying

Naveed_786 25 Posting Whiz in Training

I am using oracle 9i database with VB.NET when i am trying to insert record in my PR_REC table it gives me error "ORA-01722 Invalid number" here is my insert statement and the structure of the table

com = New OleDbCommand("INSERT INTO PR_REC(pr_no,item1,price1,qty1,item2,price2,qty2,item3,price3,qty3,item4,price4,qty4,item5,price5,qty5,item6,price6,qty6,item7,price7,qty7,item8,price8,qty8,item9,price9,qty9,item10,price10,qty10,Pur_reason,pr_date,Status) VALUES ('" & Me.txtprno.Text.Trim & "','" & Me.txtitm1.Text.Trim & "','" & Me.txtprc1.Text.Trim & "', '" & Me.txtqty1.Text.Trim & "','" & Me.txtitm2.Text.Trim & "', '" & Me.txtprc2.Text.Trim & "','" & Me.txtqty5.Text.Trim & "','" & Me.txtitm3.Text.Trim & "','" & Me.txtprc3.Text.Trim & " ','" & Me.txtqty9.Text.Trim & "','" & Me.txtitm4.Text.Trim & " ','" & Me.txtprc4.Text.Trim & " ','" & Me.txtqty2.Text.Trim & "','" & Me.txtitm5.Text.Trim & " ','" & Me.txtprc5.Text.Trim & " ','" & Me.txtqty6.Text.Trim & "','" & Me.txtitm6.Text.Trim & " ','" & Me.txtprc6.Text.Trim & " ','" & Me.txtqty6.Text.Trim & "','" & Me.txtitm7.Text.Trim & " ','" & Me.txtprc7.Text.Trim & " ','" & Me.txtqty10.Text.Trim & "','" & Me.txtitm8.Text.Trim & " ','" & Me.txtprc8.Text.Trim & " ','" & Me.txtqty3.Text.Trim & "','" & Me.txtitm9.Text.Trim & " ','" & Me.txtprc9.Text.Trim & " ','" & Me.txtqty7.Text.Trim & "','" & Me.txtitm10.Text.Trim & " ','" & Me.txtprc10.Text.Trim & " ','" & Me.txtqty11.Text.Trim & "','" & Me.txtpr.Text.Trim & "',to_date('" & textDateTime & "','mm/dd/yyyy hh24:mi:ss'),'" & ComboBox1.Text.Trim & "')", con)

Structure of the table:-

Name                            Null?    Type
 ------------------------------- -------- ----
 PR_NO                           NOT NULL VARCHAR2(50)
 ITEM1                           NOT NULL VARCHAR2(100)
 ITEM2                                    VARCHAR2(100)
 ITEM3                                    VARCHAR2(100)
 ITEM4                                    VARCHAR2(100)
 ITEM5                                    VARCHAR2(100)
 ITEM6                                    VARCHAR2(100)
 ITEM7                                    VARCHAR2(100)
 ITEM8                                    VARCHAR2(100)
 ITEM9                                    VARCHAR2(100)
 ITEM10                                   VARCHAR2(100)
 PRICE1                          NOT NULL NUMBER(30)
 PRICE2                                   NUMBER(30)
 PRICE3                                   NUMBER(30)
 PRICE4                                   NUMBER(30)
 PRICE5                                   NUMBER(30) …
Naveed_786 25 Posting Whiz in Training

I have resolved the problem

Naveed_786 25 Posting Whiz in Training

Hi to all,

How can i connect VB.NET with oracle i am using following connecting string for connecting VB.NET with SQL Server

Public ConnectionString As String = "Data Source=%server%; Initial Catalog=Inventory; Integrated Security=SSPI; Trusted_Connection=True;"

And Class for sql server

Imports System.Data.SqlClient

What class should i use for oracle.

Naveed_786 25 Posting Whiz in Training

Hello to all,

How to print the contents of textboxes in proper formate like

Student Name ABC
Father Name BDC
DOB 14/02/2011

Please help if any body know

Thanks in advance.

Naveed_786 25 Posting Whiz in Training

I have installed visual studio 2010 on dc7700 machine when i am trying to open my project made in visual studio 2008 it convets it and didn't work converted file also when i am trying to create new project i did't find languages option like vb.net c# etc please help

Naveed_786 25 Posting Whiz in Training

Can anybody tell me where can i find the complete database application designed in php??

Naveed_786 25 Posting Whiz in Training

Ok fine please just tell me how can i shift the textboxes in the mid of the page and how to adjust below the textboxes

Naveed_786 25 Posting Whiz in Training

Thanks now tell me how to connect the form with database

Naveed_786 25 Posting Whiz in Training

I know this but can you give me some example or source webpage which exactly meets my requirment

Naveed_786 25 Posting Whiz in Training

Can any body help me how can i design my first page in PHP and database sql server2008 which should have four textboxes in the center of the form like this

Name Naveed
FatherName Akhter
DOB -
NIC NO -


and two buttons one for exit and one for changing the record

Please please help me it would be kindness.

Naveed_786 25 Posting Whiz in Training

Yes ShahanDev is very right try this we hope it would resolve your problem also if you have designed some crystal reports then you must include crystal report run time.

Naveed_786 25 Posting Whiz in Training

Please Show us your coding then we will be able to help you

Naveed_786 25 Posting Whiz in Training

Dear AndreRet i have resolved the problem by using validate event now it is working perfectly any way thanks for your kind and great help

Naveed_786 25 Posting Whiz in Training

Please mark the thread as solved if your problem has been resolved

Naveed_786 25 Posting Whiz in Training

I have strugle and find out the way now it is fine i done it in this way

Private Sub txtempno_Validate(Cancel As Boolean)
On Error Resume Next
Set cn = New adodb.Connection
Set rst = New adodb.Recordset
cn.Open "Provider =Microsoft.Jet.OLEDB.4.0;Data Source=D:\EA\DB\EA.mdb;"
rst.CursorLocation = adUseClient
      rst.Open "SELECT * FROM Employee WHERE Empno = '" & txtempno.Text & "'", cn, adOpenStatic, adLockOptimistic
      If rst.BOF = True Or rst.EOF = True Then
      MsgBox "No Such Recrods exsists!", vbOKOnly + vbInformation, "EXCELLENT ACADMY"
      txtempno.SetFocus
      Exit Sub
      Else
      txtsub.Text = rst.Fields!subjects
      txtempname.Text = rst.Fields!TeacherName
      End If
End Sub

any way thanks for your precious time and grate help.

Naveed_786 25 Posting Whiz in Training

Ok i have resolved the problem now its fine but when we didn't have record in database it gives me message no record exists but when i try to exit the form it populates message again and again what should i do

Naveed_786 25 Posting Whiz in Training

So i have removed rst.movenext and If Val(txtempno.Text) = rst.Fields!EmpNo Then but the result is same when i try to enter empno as i press 5 it populates message then i terminate the message then i press 0 then it again populate message i don't why it is so?

Naveed_786 25 Posting Whiz in Training

As per your instruction i have changed the code but it populates no such record exists please help

On Error Resume Next
Set cn = New adodb.Connection
Set rst = New adodb.Recordset
cn.Open "Provider =Microsoft.Jet.OLEDB.4.0;Data Source=D:\EA\DB\EA.mdb;"
rst.CursorLocation = adUseClient
      rst.Open "SELECT * FROM Employee WHERE Empno = '" & txtempno.Text & "'", cn, adOpenStatic, adLockOptimistic
      If rst.BOF = True Or rst.EOF = True Then
      MsgBox "No Such Recrods exsists!", vbOKOnly + vbInformation, "EXCELLENT ACADMY"
      txtempno.SetFocus
      Exit Sub
      Else
      If Val(txtempno.Text) = rst.Fields!EmpNo Then
      txtsub.Text = rst.Fields!subjects
      txtempname.Text = rst.Fields!TeacherName
      End If
      rst.MoveNext
      End If