有人可以帮我创建一个sdf查看器应用程序 [英] can someone help me with creating a sdf viewer application

查看:70
本文介绍了有人可以帮我创建一个sdf查看器应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信此代码会查看数据网格中sdf文件中的数据。



i believe that this code views the data in the sdf file in a datagrid.

Imports System.Data.SqlServerCe
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim scon As SqlCeConnection = New SqlCeConnection("Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf")

        Dim ceda As SqlCeDataAdapter = New SqlCeDataAdapter("Select * from Suppliers", scon)

        Dim ds As New DataSet

        ceda.Fill(ds, "MyTable")

        DataGridView1.DataSource = ds.Tables("MyTable").DefaultView

        ' Also you can iterate data from datatable like this:

        'ds.Tables("MyTable").Rows(rowIndex).Item(colIndex).ToString()
    End Sub
End Class







但我需要创建一个打开sdf文件的应用程序而不将sdf文件放在vb.net的源代码中

我的意思是当你想在你的程序中添加一个数据库文件你把它添加为现有项目。

我想要的是用户可以在他/她的目录中搜索sdf文件,应用程序在数据库中显示数据。



但我不知道从哪里开始。伙计你对此有什么想法吗?

i想要达到这样的效果 http://sdf-viewer.software.informer.com/ [ ^ ]

推荐答案

哇。这样做会很顺利。



我们已经告诉过你关于OpenFileDialog的事情,你仍然对它一无所知。这告诉我们你几乎会忽略我们告诉你的任何东西,而不是自学任何东西,除了你之外的任何人都会写完这个应用程序的绝大部分。



你不能从一堆论坛帖子中写这个应用程序。你没有经验告诉你如何设计应用程序(你不会在论坛中学到这一点!)并且没有关于你要去的所有小部分的线索需要把它放在一起。



例如......你知道如何使用SQL SELECT语句获取数据库中的所有表吗?桌子的列怎么样?他们的定义?指标?关键信息?



如何消除所有这些信息?你知道如何布置你的表格吗?你需要什么控制?保持应用程序和视觉状态信息怎么样?



...而且这只是我昏昏沉沉的小大脑想出的大约5秒钟的想法那个app。
Wow. This is going to go well.

We already told you about the OpenFileDialog and you still don''t know anything about it. This tells us that you''re pretty much going to ignore anything we tell you, not teach yourself anything, and anyone but you is going to end up writing the vast majority of this app.

You can''t write this app from a bunch of forum posts. You''ve got no experience to tell you how to design the app (you''re NOT going to learn that in forums either!) and don''t have a clue about all of the little bits you''re going to need to put this together.

For example... Do you know how to get all of the tables in a database using and SQL SELECT statement? How about the columns of a table? Their definitions? Indexes? Key information?

How about how you''re going to disaply all of this information? Do you know how you''re going to layout your forms? What controls you''re going to need? How about maintaining the application and visual state information?

...and that''s only what my groggy little brain came up with in about 5 seconds of thinking about that app.


这篇关于有人可以帮我创建一个sdf查看器应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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