在C#中使用SQL Server express 2012和LINQ [英] using SQL server express 2012 with LINQ in C#

查看:97
本文介绍了在C#中使用SQL Server express 2012和LINQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,先来这里发帖。



我受委托为我的老板创建一些软件,一对使用数据库,sql,手机等的软件。所以我有一个列表,我想知道它是否在C#中都可行。我目前正在学习语言和LINQ,有sql server 2012快速安装,并且该死的学习态度很好,所以请轻松一点:)



这里是我的清单:



1.一种记录软件,利用数据库为客户创建报告,记录事件和某些区域以外的人数,所以我们知道如何很多人一次在现场



2.支票系统,我们可以检查警卫何时办理登机手续。这将使用专用的自动电话号码警卫呼叫并输入他们的密码,然后它会显示在电脑上,如果一名警卫已经或没有在一定时间内办理登机手续



3.一个rota系统,保持所有员工的工作,使用数据库包含网站,员工等



4.用于保存员工详细信息,记录,审核,访谈,会议记录的数据库,就像一个存储系统,其中一名工作人员将拥有多个文件和类型相关文件



任何人都可以提供帮助的方式将受到大力赞赏。阿尔西,如果你不介意的话,你会告诉我我需要知道什么,或者我将如何开始每个项目,有意识地我希望自己做学习和工作,但是朝着正确的方向迈出了一步(你需要这个来设置一个自动电话线到软件等)将是一个巨大的帮助。



谢谢你们!

Anthony

Hey guys, first post on here.

I have been commissioned to create some software for my boss, a couple which use databases, sql, phones etc. So i have a list of things, and I would like to know if it's all doable in C#. I am currently learning the language and LINQ, have sql server 2012 express installed, and a damn fine learning attitude to boot, so please, go easy :)

Here is my list:

1. A logging software, that utilises a database to create reports for clients, logging incidents and numbers of people out of certain areas, so we know how many people are on site at one time

2. A check calling system, so we can check when guards are checking in. This will use a dedicated automated phone number where the guard calls and enters their pin number, then it shows up on the computer if a guard has or hasnt checked in by a certain time

3. A rota system, to keep all staff rotas on, using a database to contain the sites, staff etc

4. A database for keeping staff details, records, audits, interviews, meeting notes, like a storage system where one staff member will have several documents and types of files associated

Any way someone can help would be massively appreciated. Alsi, if you wouldnt mind, would you tell me what i would need to know or how i would go about getting started for each project, obciously i expect to do the learning and work on my own, but a point in the right direction (you would need this to set up an automated phone line to the software etc) would be a massive help.

Thanks guys!
Anthony

推荐答案

Hello Brucey,



1.问题不是很安静......但......如果我理解你的问题是正确的 - 你在不知名的地方找到SQL服务器并且你想从它做一些报告。

在这种情况下你应该做以下事情:

1.1创建SQlConnection并打开它(这里有更多信息:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx [ ^ ]

1.2打开该连接并创建数据读取器以读取数据您的报告所需。更多信息:

http:// msdn。 microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx [ ^ ]

之前我的任务非常相似所以我将所有数据都读到了通用List< t>然后用LINQ我过滤并创建了另一个我移动到Excel用于演示目的。

更多关于如何在这里做到这一点:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx [ ^ ]



2.问题再次不清楚 - 不清楚你有什么,因此不清楚哪种方式最好。

但是,如果您将所有数据都流入SQL Server,那么请尝试使用触发器。关于触发器的更多信息:

http:// msdn .microsoft.com / zh-cn / library / microsoft.office.interop.excel.aspx [ ^ ]



3.不知道问题是什么。对不起;]



4.一个数据库?我以为你有一个SQL Server ...



干杯!



Modestas。



PS:尊重所有人 - 请提出详细的问题,因为我怀疑有很多人热衷于照看孩子:)
Hello Brucey,

1. Question is not quiet clear... but... If I understood your question correct - you got SQL server somewhere in the middle of nowhere and you want to do some reporting from it.
In this case you should do the following:
1.1 Create SQlConnection and open it (more info here:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx[^]
1.2 Open that connection and create a data reader to read data which is required for your reporting. More info here:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx[^]
I had very similar tasks before so I read all data to generic List<t> and then with LINQ I filtered and created anotherone which I moved into Excel for presentationla purpose.
More about how to do it here:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx[^]

2. Question again not clear - not clear what you have and therefore not clear which is the best way to go.
But if you have all data flowing into SQL Server - then try doing it with a triggers. More about triggers here:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.aspx[^]

3. No idea what the question is about. Sorry ;]

4. A database? I thought you have an SQL Server...

Cheers!

Modestas.

P.S.: With all respect mate - please ask detailed questions as I doubt that there are many people keen on babysitting :)


这篇关于在C#中使用SQL Server express 2012和LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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