LINQ插入 [英] linq insert

查看:115
本文介绍了LINQ插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有2个表,一个是主表,另一个是事务表
主表是履历表
字段是1.resume_id,它是自动递增no
2.名称
3.技能
4.phoneno
交易表是凭证",字段是
1.document_id自动递增编号
2. resume_id
3.file_type
4.file_content
5.property_id可为空

在事业页面上,当您单击提交名称,技能和电话号码的数据时,文件上传选项将带有名称,技能和电话号码,并使用简历_id保存在简历表中,而resume_id再次存储在文档表中,上传的文件的file_type.如何使用linq检索resume_id.


任何人都可以为此编写存储过程

Hi all

I ve 2 table one is master and another is transaction table
The master table is resume
the fields are 1.resume_id which is auto increment no
2.name
3.skill
4.phoneno
the transaction table is Document the fields are
1.document_id auto increment no
2.resume_id
3.file_type
4.file_content
5.property_id which is nullable

In the career page the file upload option is there with name,skill and phoneno when u click on submit the data of name,skill and phone no is saved in resume table with the resume _id.and that resume_id is again stored in document table with file_type of uploaded file.how i retrieve the resume_id using linq.


Anybody can write the store procedure for this
thank a lot in advance!

推荐答案

您需要编写LINQ查询才能获取插入到主表中的最大resume_id.

例如:

You need to write LINQ query in order to fetch the max resume_id inserted in the Master table.

example:

int maxresumeID = (from resume in dbContext.Resume
                   select resume.resume_id).Max();


这篇关于LINQ插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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