一定比这更简单吗? [英] It must be more simple than this?

查看:85
本文介绍了一定比这更简单吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VB(VS2010)和SQL Express2013.

我正在使用WPF作为表示层,但是我没有绑定到字段(主要是因为我无法理解这一点),并且我不想使用此应用程序走那条路.

我遇到的问题是,我找不到我需要做的任何简单示例来使此组合起作用.我已经成功构建了一个简单的控制台应用程序,但是一旦开始构建WPF应用程序,它就会发生所有变化,我该怎么做才能转换.

这适用于控制台应用程序

I am trying to use VB (VS2010) and SQL Express 2013.

I am using WPF as the presentation layer, but i am not Binding to the fields (mainly cuz i cannot get my head round that) and i do NOT want to go that route with this app.

The problem i am having is that i cannot find any simple examples of what i need to do to make this combination work. I have managed to build a simple console app, but as soon as start building a WPF app it all changes, what do i have to do to convert.

This works for a console app

Sub Main()

        Dim db As New DataClasses2DataContext("Data Source=HPUG-GAC\SQLEXPRESS;Initial Catalog=MaxGate;Integrated Security=True")

        Dim passQry = From pass In db.Passes Select pass.PassID, pass.First_Name, pass.Last_Name
        For Each MaxPass In passQry
            Console.WriteLine(MaxPass)
        Next

    End Sub

推荐答案

[ ^ ]可能是您做到这一点的一种方法.
还有 [
This[^] might be one way you can do it.
There is also this[^] way.


这篇关于一定比这更简单吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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