我想通过音频在日期和时间上显示我的数据库中的标题。 [英] I want to show Title from my database on date and time with audio.

查看:90
本文介绍了我想通过音频在日期和时间上显示我的数据库中的标题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题是制作Notes提醒,无法按时播放音频和时间保存在我的桌面结构上......





I am having a problem to make Notes reminder, unable to play audio on time and time is save on my table structure like this…


CREATE TABLE [dbo].[Notes](
    [SN] [int] IDENTITY(1,1) NOT NULL,
    [Title] [nvarchar](max) NULL,
    [Date] [date] NULL,
    [NoteTime] [nvarchar](20) NULL,
    [Status] [nvarchar](20) NULL,
 CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED
(
    [SN] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]





我必须播放日期声音和NoteTime,它存储在我的数据库中。











I have to play a sound on on date and NoteTime which is stored in my database..




Index (View Page):-

 <p><source src="@Url.Action("myaudio")" type="audio/mp3" /></p>

Controller:-
<pre lang="c#">public ActionResult Index()
{
   var file = Server.MapPath("~/app_data/ipl.mp3");
   return File(file, "audio/mp3"); // I am unable to call two return in one view.
   return View(db.Notes.ToList()); // list of record from my database..

 }





•单独使用两者但音频不是因为我不知道怎么做而在数据库上播放日期和时间。当我们不返回时它会在页面加载时播放

返回视图(db.Notes.ToList());

•我想在日期和时间显示我的数据库中的标题与音频。



• Individually works both but audio is not playing on date and time accroding to database because I don’t know how to do. it play on page load when we not return
return View(db.Notes.ToList());
• I want to show Title from my database on date and time with audio.

推荐答案

创建一个类作为模型,以便从您的动作发送回db.Notes和音频文件。

在您可以将对象作为属性访问后,您可以在视图中使用它们。
Create a class as a model in order to send back to view from your action for db.Notes and audio file.
After you can access objects as properties and you can use them in your view.


这篇关于我想通过音频在日期和时间上显示我的数据库中的标题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆