Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > WPF и Silverlight > WPF работа с данными


Автор: antikom 31.1.2009, 12:17
Здраствуйте. В целях изучения технологии WPF, решил написать броузерную игру. Сейчас делаю страницу и регистрации и озникла проблема. Где можно почитать про работу с данными, в частности WPF + MS Sql server, и вобще возможно ли такое. Дайте ссылки на мануалы у кого есть.

Заранее спасибо.

Автор: mirageb 1.2.2009, 14:47
Лучше все же использовать WPF + WebServices.

Автор: antikom 1.2.2009, 16:23
mirageb, Да спасибо, уже работаю в этом направлении.

Автор: antikom 1.2.2009, 17:54
Создал вэб сервис, прицепил к нему базу. В WPF проекте добавил в web reference сервис. Вызываю web метод вылетает исколючение - Сбой при запросе разрешения типа "System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

Автор: mirageb 2.2.2009, 15:54
А текст исключения какой ? А InnerException есть ?

Автор: antikom 2.2.2009, 16:48
В принципе разобрался в чем проблема пишет типа сервис и бд должны быть на одном сервере. Сервис у меня на http://localhost:2525/Service1.asmx на родном серевере Visual Web Developer'a. Как к нему прицепить бд. 

Спасибо.

Автор: likegift 2.2.2009, 21:59
Цитата(antikom @ 2.2.2009,  19:48)
В принципе разобрался в чем проблема пишет типа сервис и бд должны быть на одном сервере. 

прямо таки должны? полный текст ошибки какой?

Автор: antikom 3.2.2009, 13:13
Попробывал загрузить простой xml файл, так же вылетает исключение -

System.Security.SecurityException was unhandled by user code
  Message="Сбой при запросе разрешения типа \"System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"."
  Source="mscorlib"
  StackTrace:
       в System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
       в System.Security.CodeAccessPermission.Demand()
       в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
       в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
       в System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials)
       в System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
       в System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
       в System.Threading.CompressedStack.runTryCode(Object userData)
       в System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       в System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
       в System.Xml.XmlTextReaderImpl.OpenUrl()
       в System.Xml.XmlTextReaderImpl.Read()
       в System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
       в System.Xml.XmlDocument.Load(XmlReader reader)
       в System.Xml.XmlDataDocument.Load(XmlReader reader)
       в System.Xml.XmlDocument.Load(String filename)
       в System.Xml.XmlDataDocument.Load(String filename)
       в WpfBrowserGame.Register.RegisterButton_MouseMove(Object sender, MouseEventArgs e)
       в System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       в System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       в System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       в System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       в System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       в System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       в System.Windows.Input.InputManager.ProcessStagingArea()
       в System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       в System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       в System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       в System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       в System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       в System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       в System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       в System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       в MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       в System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       в System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       в System.Windows.Threading.Dispatcher.Run()
       в System.Windows.Application.RunDispatcher(Object ignore)
       в System.Windows.Application.StartDispatcherInBrowser(Object unused)
  InnerException: 

Автор: antikom 3.2.2009, 16:44
Всем спасибо. Вопрос решен.

Автор: Alekz 5.2.2009, 16:16
antikom, 
Можешь вкратце рассказать что нужно было и что получилось - может кто-то еще с тем же вопросом попадет в эту тему)

Автор: antikom 6.2.2009, 09:26
Цитата(Alekz @ 5.2.2009,  16:16)
antikom, 
Можешь вкратце рассказать что нужно было и что получилось - может кто-то еще с тем же вопросом попадет в эту тему)

Конечно. Дело оказалось куда проще чем я думал.  В свойствах проекта, на вкладке Security  надо было выставить Settings FileIOPermission - Include. И все будет работать.

Еще раз спасибо всем кто помогал.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)