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
  <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"/>

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

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()

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

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
        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

 Public Property IsReadOnly() As Boolean
            Return _isReadOnly
        End Get
        Set(ByVal value As Boolean)
            _isReadOnly = value
        End Set
    End Property
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.........")
                    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
                            MessageBox.Show("Selected Grug Already Exists", "Add")
                        End If

                    End If