我的sql数据库中有一个标量值函数.
将此函数导入Entity Framework模型时收到此错误:
Error 6046: Unable to generate function import return type of the store function 'GetContentByIdAndCul'.
The store function will be ignored and the function import will not be generated. ..\EntityModels.edmx
Run Code Online (Sandbox Code Playgroud)
我的函数tsql是:
ALTER FUNCTION [FRM].[GetContentByIdAndCul]
(@Id int,@Culture nvarchar(5))
RETURNS nvarchar(max)
AS
BEGIN
declare @Result nvarchar(max)
if @Id is not null
set @Result='This Content not defined in this Language'
select @Result=Value from CUL.Contents
WHERE ID=@Id AND (CUL.Contents.Culture = LOWER(@Culture)
OR CUL.Contents.Culture = LOWER(SUBSTRING(@Culture,1,2)))
return @Result
END
Run Code Online (Sandbox Code Playgroud) 萨拉姆.
我大多数连接到" Remote server"并通过TCP连接发送和接收数据(来自另一家我们无法更改除TCP之外的通信方法的公司)" Interface Web Service".
这个" Interface Web Service"句柄" Client Apps" Remote server通过TCP连接请求,创建数据并传递给" ",并将解析后的响应" Remote server"传递给" Client Apps".
注意当前的TCP连接,接收Remote server带有OnDataReceived事件的响应.(此事件很好,我想将此事件用于后续步骤).
如何访问和处理这些异步响应并传递" Client Apps"请求的完整响应?
总结一下:
Client app 发送请求 Interface serviceInterface service 为...创建命令 Remote server Remote server 响应命令来自 Interface serviceInterface service,使用OnDataReceivedEVENT 处理响应,我无法从Interface service该句柄Client App请求访问它.问题在这里......查看此图像以完成了解我的场景:
萨拉姆.
在我的项目中,我必须为语言和语言创建两者layout-ldltr和layout-ldrtl布局.Right-To-LeftLeft-To-Right
我启动了从右到左语言的应用程序,每件事都很好.但是当方向改变时,android加载layout-ldltr布局反对layout-ldrtl,虽然当前Locale设置为RTL语言!
怎么解决这个问题?!
在 AndroidManifest.xml
<application
android:name=".QuranApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Run Code Online (Sandbox Code Playgroud)
在layout-ldrtl\activity_main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layoutDirection="rtl">
<include layout="@layout/toolbar" />
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layoutDirection="rtl">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="rtl"/>
<include
layout="@layout/list_view"
android:layout_width="@dimen/drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
UPDATE
在@JohanShogun评论之后,我改变android:layoutDirection="rtl"了android:layoutDirection="locale"并解决了大多数项目的问题.
在第一张照片中,所有元素都显示非常好:
在横向模式下,在粘贴在屏幕顶部的标题项中的StickyListHeader列表视图中,从ltr布局使用android !:
android android-layout right-to-left left-to-right android-5.0-lollipop
萨拉姆.我有这个标志枚举:
public enum DataAccessPoliceis
{
None = 0,
A = 1,
B = 2,
C = 4,
D = 8,
E = B | C | D, // 14
All = A | E // 15
}
Run Code Online (Sandbox Code Playgroud)
我想从int值获取int值(或复杂枚举项的int值列表):
int x = 9; // enum items => D | A
List<int> lstEnumValues = ???
// after this line ...
// lstEnumValues = { 1, 8 }
// and for x = 15
// lstEnumValues = { 1, 2, 4, 8, 14, …Run Code Online (Sandbox Code Playgroud) 所以我创建了一个服务,它运行良好。它所做的只是计数。我有一个自定义类来处理使用通知的麻烦。这个类有一个 getNotification ,它显然返回它使用的通知。一切都很好,但我必须让我的服务在前台运行(它将一些重要数据同步到应用程序,在它完成之前不得中断)现在,当我添加 startForeground 时,我添加了我的通知和一个 id就这样离开了。startForeground(1337, 通知);
我遇到的问题是,由于某种原因,我做的第一个 notify() 独立于其他通知。因此,当我进行此运行时,它会创建两个通知。第一个停留在第一个更新上,其标题为“Zilean”,其内容为“计数”。另一个完美更新。我注意到如果 startForeground 以 0 (startForeground(0,notification)) 的 id 运行,那么这个问题就会得到解决,但是如果我终止了活动,通知就会消失。当 id <> 0 时不会发生。
我遇到这个问题的时间太长了,所以我使用了一个仅重要的虚拟服务。我想知道,如果 Activity 因用户而终止,或者仅仅因为 android 决定删除它的记忆,那么该服务将继续运行。
// onStartCommand
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// NOTIFICATION SECTION
NotificationManager mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this);
notificationManagerClass = new SBNNotification(mNotifyManager,
mBuilder, true, 1, false, "Zilean",
"Initiating Counter", false);
notificationManagerClass.notificate();
final Notification notification = notificationManagerClass.getNotification();
notification.flags = flags;
notification.defaults = Notification.DEFAULT_LIGHTS;
startForeground(1337, notification);
new Timer().scheduleAtFixedRate(new …Run Code Online (Sandbox Code Playgroud) android ×2
c# ×2
asynchronous ×1
enum-flags ×1
enums ×1
linq ×1
service ×1
sql-function ×1
tcp ×1
web-services ×1