Link Unit
Friday, October 30, 2009
How to find the current value of a sequence number
Select s.currval from dual
ORA-08002: sequence S.CURRVAL is not yet defined in this session
CURRVAL doesn't represent anything global about the sequence number generator. It only represents the value returned to your session (the database session processing the current statements) the last time you called NEXTVAL for that sequence
Solutions :
#1 before using CURRVAL you should call NEXTVAL .
#2 You can get the current value of the Sequence by querying DBA_SEQUENCES , which is Last_number.
An attempt was made to load a program with an incorrect format (Exception from HRESULT:0X800700008)
If an add-on is set to run on a 64 bit environment ensure it is compiled with a 32 bit operating system. The reason is the current SAPbobsCOM.dll can not run with 64 bit compiled add-ons.
You must compile your add-on and your installation program at 32 bit. You must force it because SAPBouiCom e SAPBobsCom are 32 bit component. A 64-bit program cannot call a 32-bit component.
Solution:When you create your application and when you are creating through your B1 installer. Go to the project properties-->select compile option and in that Advanced compile option-->change your target CPU to x86..rebuild your project again and create your refresh ard using these settings...
After doing above steps we faced following Error: "wrong digital signture for addon instller" Solution:The problem may be that rebuilding add-on project then generate ARD, while the old add-on executable is included in your add-on installer.
You should make sure it is the same executable of your add-on when generate the ARD and Installation. And you're recommended to do this with B1DE, it helps you to generate ARD and Installation once.
Actually, In ARD file it has unique digital signature for the add-on executable. The mismatch of the executable of add-on in ARD and Installer will lead to wrong digital signature error. Reason for Wrong digital signature:
1.You build the add-on project, then add-on executable is generated. e.g. MyAddOn.exe
2.You use this executable in the add-on installer (what ever InstallShield or other)
3.You rebuild the add-on project, then actually it is a different executable generated. Even its name is still MyAddOn.exe
4.You generate ARD on the basis of the second one. Then you will get the Wrong Digital Signature. Again, you should make sure it is the same executable file of your add-on that is used in ARD generation and included in your install shield. Meaning you shouldn't rebuild the add-on project when generate ARD or Installation, make sure ARD and Installer are referring to the same "version" of add-on executable
Every time you create an installer, you should create a new .ard file. This file contains an digital signature of your installer executable, and one digital signature of the main executable of your Add-on. (with digital signature SB1 means some kind of hash/checksum of the file)The notice you've get is because you don't have the correct signature in your .ard file for the Add-on executable. If you are creating it manually, select the correct Add-on Exe Full Path in the Add-On Registration Data Generator.
I hope this will help...as it solved my problem
Monday, September 07, 2009
DataBinding: 'Microsoft.SharePoint.SPListItem' does not contain a property with the name
DataBinding: 'Microsoft.SharePoint.SPListItem' does not contain a property with the name 'Extension'
In case I tried the following it ran successfully
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Departments"];
cboDepartment.DataSource = list.Items;
cboDepartment.DataValueField = "Title"; // List field holding value
cboDepartment.DataTextField = "Title"; // List field holding name to be displayed on page
cboDepartment.DataBind();
}
So, I believe that whatever it is tryed to bind through DataTextField and DataValueField is supposed to be a property of the object we are binding to. For instance, SPListItem do have Title and ID properties, but it does not have 'Extension' property (in the meaning of the SPListItem class member).
So the following solutions were tried.
Solution #1
SPWeb site = SPContext.Current.Web;
DropDownList cboExtensions = new DropDownList();
SPList list = site.Lists["ImageExtensionList"];
SPListItemCollection lstCollection = list.Items;
cboExtensions.DataSource = lstCollection.GetDataTable();
cboExtensions.DataValueField = "Extension"; // List field holding value
cboExtensions.DataTextField = "Extension"; // List field holding name to be displayed on page
cboExtensions.DataBind();
this.Controls.Add(cboExtensions);
Solution #2
SPWeb site = SPContext.Current.Web;
DropDownList cboExtensions = new DropDownList();
SPList list = site.Lists["ImageExtensionList"];
foreach (SPListItem listRecords in list.Items)
{
//ListItem tempItem = listRecords["Extension"].ToString();
ListItem tempItem = new ListItem(listRecords["Extension"].ToString(), listRecords["Extension"].ToString());
cboExtensions.Items.Add(tempItem); //ddlFromSPList is the name of the dropdown list
}
Conclusion:
Whenever Title or ID is specified it will work without any issue. When the ListItemCollection is bounded to the DropDownList ,it is expecting Valuefield and TextField to be Properties. "Title" and "ID" are properties of List , hence it worked without any issue.
So the simple solution is to get the DataTable from the ListCollection or Get the items of the list , iterate the list and add the items to DropDownlist.
Hope it Helps
Jatinder Singh
Friday, September 04, 2009
This solution contains two assemblies with the same name, or the SharePoint server already has an assembly with the specified name.
#1 See if the feature that you're trying to add still exists in the "\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES" path. Delete it.
#2 Uninstall the particular Assembly from c:\windows\assembly folder too.
#3 Try to deploy it again.
Design decision to use ascx control in sharepoint webpart versus pure sharepoint webpart
1. Create asp.net webusercontrol (.ascx), and then load that user control in the newly created webpart.
2. Create a webpart from scratch, by putting the code to generate each and every control in code.
if you need to create a control with a really advanced user interface, for example many controls and stuff, then a user control could be much easier to create.
I have found that the execution lifecycle (control viewstate, event bubbling, etc.) is a pain when going with Option 2. I choose Option 1 because the viewstate is easily managed in the code. Additionally, I like Option 1 because I can visually design the page using the VS toolbox to drag and drop controls on the design surface as opposed to Option 2 where you have to handle each control manually in code.
The approach 2 may sound difficult because of not very great integration with Galleries , but if you have the luxury of invest the time, you'll be better off in the long run.
The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?)
This is a common but simple problem to solve , below is explanation and steps to solve.
using Directives at the top of code files just allows you to use types in a namespace without having to fully qualify them.
e.g. using System.Data directive allows you to declare a DataColumn as following:
DataColumn dc = new DataColumn();
instead of:
System.Data.DataColumn dc = new System.Data.DataColumn();
using statements define scope, but you still need a reference to the Library so that the project will build.
Do you see System.Data listed under it?
Open your solution explorer and Expand References:
More than likely not, hence the complaint from the Compiler.
What to do/ how to Solve??
Right click on References, and from the Context Menu, select "Add Reference"
The Add Reference view will default to the .NET tab, scroll down until you find the System.Data, select it and click the OK button.
Build your app.
Hope it Helps
Wednesday, September 02, 2009
The feature name WebPart1 already exists in SharePoint. You need to rename the feature before solution deployment can succeed
“The feature name WebPart1 already exists in SharePoint. You need to rename the feature before solution deployment can succeed.”
The error may seem stupid , the solution to it is simple.
A simple method to avoid the above error is as follows
- Immediately after creating a new webpart project, remove the Webpart1 folder completely.
- Add new web part to the project by right clicking on the project and selecting new item from the context menu.
- In the Add new item dialog box select Sharepoint from categories and Select Web Part from templates.
- Give a name for your webpart and click Add button.