Wednesday, 8 January 2014

Solved :Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.



Please Change your app.config.exe file 


find that line in your file
<!--<startup>
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>-->
and replace that line with:
<startup useLegacyV2RuntimeActivationPolicy="true">
 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
 
    </startup>

just before the configuration end tag like </configuration>




Tuesday, 7 January 2014

save yes and no in ultragrid in place y and n in ultragrid column

Hi everyone i have that column in ultragrid 1 so i place that code in initialize row event


Private Sub UltraGrid1_InitializeRow(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles UltraGrid1.InitializeRow
        If Not IsDBNull(e.Row.Cells("ACTIVE").Value) Then
            If (e.Row.Cells("ACTIVE").Value = "Y") Then
                e.Row.Cells("ACTIVE").Value = "YES"
End If

     End If

    End Sub

Wednesday, 21 August 2013

Remove the highlighting from combobox when selected

To remove the highlight from a selected item in a combo box:

ComboBox1.SelectedIndex = -1

Friday, 14 June 2013

How to make a pop up window in vb.net

HI user you can make popup window by writing that piece of code
here FrmProviderMedicationsis name of form which you open as pop window

 Dim obj As New FrmProviderMedications()
                obj.ShowDialog()

Regards:
Ahmad Khalid
Software Engineer

Convert String rgb to color IN VB.NET

Hi user  i solve that problem by using that piece of code .here NOTE_STATUS_COLOUR is string in which color is save i convert into color in this way.and put in background of row color in ultragrid

If e.Row.Cells("NOTE_STATUS_COLOUR").Value IsNot Nothing Then
  Dim noteColor As Color =System.Drawing.Color.FromName(CStr(e.Row.Cells("NOTE_STATUS_COLOUR").Value).Trim)
            e.Row.Appearance.BackColor = noteColor
            e.Row.Appearance.BackColor2 = noteColor
        End If


Thursday, 13 June 2013

disable(readonly) all control of a form(window) from other window in vb.net

Hi  i  made all control except close button disable all read only in this way. my all control in the panel and i disable all that and also made disable all toolbar control


Private Sub FrmTodoList_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

  If IsReadOnly Then
            DisableAll()
        End If
    End Sub

 Private Sub DisableAll()
        Me.PnlCSDetail.Enabled = False
        For Each tool As Infragistics.Win.UltraWinToolbars.ToolBase In Me.TBMCSDetail.Toolbars(0).Tools
            If Not tool.Key.ToLower.Equals("dclose") Then
                tool.SharedProps.Visible = False
                tool.SharedProps.Enabled = False
            End If
        Next

 Public Property IsReadOnly() As Boolean
        Get
            Return _isReadOnly
        End Get
        Set(ByVal value As Boolean)
            _isReadOnly = value
        End Set
    End Property
Regards:
Ahmad Khalid
Software Engineer

Wednesday, 12 June 2013

Prevent From Duplicate Record editing in Ultragrid

I Resolve this Problem By using That Type of Check

  Dim frmdrug As New frmDrugSearch
                If Cbxprovider.Text = Nothing Then
                    MessageBox.Show("Please Select the Provider First.........")
                Else
                    Dim rw As UltraGridRow = Cbxprovider.SelectedRow()

                    If frmdrug.ShowDialog(ListFormOpenMode.SelectionOnly) = Windows.Forms.DialogResult.OK Then
                        If dsView.Tables(0).Select("DRUG_NDC = '" + frmdrug.DRUG_NDC + "' AND PROVIDER_ID = " + selectedProvider + " ").Length = 0 Then
                            Dim newRow As DataRow = dsView.Tables(0).NewRow
                            newRow("DRUG_ID") = frmdrug.MEDICATION_ID
                            newRow("DRUG_NDC") = frmdrug.DRUG_NDC
                            newRow("DRUG_NAME") = frmdrug.BRAND_NAME
                            newRow("ACTIVE") = True
                            newRow("PROVIDER_ID") = selectedProvider
                            dsView.Tables(0).Rows.Add(newRow)
                        Else
                            MessageBox.Show("Selected Grug Already Exists", "Add")
                        End If

                    End If