So, in Sql server 2005 and above you can use parenthesis before and after you param.
Here you go:
SELECT TOP (@elements) * from tableCities
It is pretty easy, isn't it?
How to write code in C#, Asp.Net, Php, Javascript, C. On this blog you will find example codes that will help you to understand concepts of programming.
SELECT TOP (@elements) * from tableCities
///
/// Adds business days to a date
///
///
///
///
public static DateTime AddBusinessDays(this DateTime dateTime, int businessDays)
{
DateTime resultDate = dateTime;
while (businessDays > 0)
{
resultDate = resultDate.AddDays(1);
if (resultDate.DayOfWeek != DayOfWeek.Saturday &&
resultDate.DayOfWeek != DayOfWeek.Sunday)
businessDays--;
}
return resultDate;
}
gridControl1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat; gridControl1.LookAndFeel.UseDefaultLookAndFeel = false; gridView1.Appearance.HeaderPanel.Options.UseBackColor = true; gridView1.Appearance.HeaderPanel.BackColor = System.Drawing.Color.Red;If this helped you, go ahead and share :)
|
||||||
public class AbstractCommunicatorProvider : TypeDescriptionProvider
{
public AbstractCommunicatorProvider()
: base(TypeDescriptor.GetProvider(typeof(UserControl)))
{
}
public override Type GetReflectionType(Type objectType, object instance)
{
return typeof(UserControl);
}
public override object CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, object[] args)
{
objectType = typeof(UserControl);
return base.CreateInstance(provider, objectType, argTypes, args);
}
}
You define this class in inherited class(it only worked for me in this way) and you must also put this for base class and inherited class: [TypeDescriptionProvider(typeof(AbstractCommunicatorProvider))]
public partial class TabUC : TabBaseControl{}
[TypeDescriptionProvider(typeof(AbstractCommunicatorProvider))]
public abstract class TabBaseControl : UserControl, ITabBase{}
Of course that you will have to include System.ComponentModel namespace and others just as needed.
if (!this.DesignMode)
{
//your code here that generates the error
}
Well, hope that I helped you today with this error. Keep up the good code ;)