Search Results

Search found 31 results on 2 pages for 'lndcobra'.

Page 1/2 | 1 2  | Next Page >

  • Visual Studio DataSet Designer Refresh Tables

    - by LnDCobra
    In visual studio datasource designer(The screen where you have all the UML Diagrams including relations) is there any way to refresh a table and its relations/foreign key constraints without refreshing the whole table? The way I am doing it at the moment is removing the table and adding it again. This adds all the relations and refreshes all fields. Also if I change a fields data type, is there a way to automatically refresh all the fields in the datasource? Again without deleting the table and adding it again. Reason for this is because some of my TableAdapters have quite a number of complex queries attached to them and when I remove the table the adapter gets removed as well including all its queries. I am using Visual Studio 2008 and connecting to a MySQL database.

    Read the article

  • C# WPF XAML DataTable binding to relation

    - by LnDCobra
    I have 2 tables: COmpany {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 Any ideas? Edit: I still can't get this to work, What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • MVVM Binding to Properties.Settings

    - by LnDCobra
    In a MVVM approach how would I go about binding to Properties.Settings? Is there a way to bind a property in C# code(in the ViewModel) to another property(Properties.Settings.Default) or should i just bind to standard properties and on save make sure each property gets propogated manually to the Properties.Settings?

    Read the article

  • C# WPF XAML DataTable binding to relationship

    - by LnDCobra
    I have the following tables: Company {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • C# Modify Connection String that exists inside a library

    - by LnDCobra
    I have a Class Library, which inside just has a DataSet (MySQL connector) and a Connector class. I use this class in multiple projects to connect to the database, and I always had the password embedded in the connection string but now I need to be able to modify this string(for security purposes) so I can have the user connect using their own account. How can I modify this connection string. I have tried the following Properties.Settings.Default.DataBaseConnectionString = "String"; But it seems that the connection string is readonly becase it doesn't appear to have a setter value. I also tried the following with no luck Properties.Settings.Default.DatabaseConnectionString.Insert( Properties.Settings.Default.DatabaseConnectionConnectionString.Length - 1, "Password=dbpassword;");

    Read the article

  • C# WPF XAML binding to DataTable

    - by LnDCobra
    I have the following tables: Company {CompanyID, CompanyName} Deal {CompanyID, Value} And I have a listbox: <ListBox Name="Deals" Height="100" Width="420" Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="Visible" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" SelectionChanged="Deals_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding companyRowByBuyFromCompanyFK.CompanyName}" FontWeight="Bold" /> <TextBlock Text=" -> TGS -> " /> <TextBlock Text="{Binding BuyFrom}" FontWeight="Bold" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> As you can see, I want to display the CompanyName rather then the ID which is a foreign Key. The relation "companyRowByBuyFromCompanyFK" exists, as in Deals_SelectionChanged I can access companyRowByBuyFromCompanyFK property of the Deals row, and I also can access the CompanyName propert of that row. Is the reason why this is not working because XAML binding uses the [] indexer? Rather than properties on the CompanyRows in my DataTable? At the moment im getting values such as - TGS - 3 - TGS - 4 What would be the best way to accomplish this? Make a converter to convert foreign keys using Table being referenced as custom parameter. Create Table View for each table? This would be long winded as I have quite a large number of tables that have foreign keys.

    Read the article

  • MVVM Good Design. DataSet or a RowViewModel

    - by LnDCobra
    I have just started learning MVVM and having a dilemna. If I have a a main ViewModel and inside this model I have a number of datasets. Now should I be creating a new ViewModel for each row inside the dataset? Or expose the DataSet itself as a DependencyProperty? For now the dataset has about 20 rows inside it, and the thought of iterating through each row to create a ViewModel binding to each row.... might not be the best option for performance reasons and memory reasons in the future, like when there are 1000+ rows. Should I still go ahead and create a RowViewModel and iterate through the dataset? And have an ObservableCollection of it or just expose the dataset? Any help would be greatly appreciated.

    Read the article

  • NHibernate MySQL Composite-Key

    - by LnDCobra
    I am trying to create a composite key that mimicks the set of PrimaryKeys in the built in MySQL.DB table. The Db primary key is as follows: Field | Type | Null | ---------------------------------- Host | char(60) | No | Db | char(64) | No | User | char(16) | No | This is my DataBasePrivilege.hbm.xml file <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="TGS.MySQL.DataBaseObjects" namespace="TGS.MySQL.DataBaseObjects"> <class name="TGS.MySQL.DataBaseObjects.DataBasePrivilege,TGS.MySQL.DataBaseObjects" table="db"> <composite-id name="CompositeKey" class="TGS.MySQL.DataBaseObjects.DataBasePrivilegePrimaryKey, TGS.MySQL.DataBaseObjects"> <key-property name="Host" column="Host" type="char" length="60" /> <key-property name="DataBase" column="Db" type="char" length="64" /> <key-property name="User" column="User" type="char" length="16" /> </composite-id> </class> </hibernate-mapping> The following are my 2 classes for my composite key: namespace TGS.MySQL.DataBaseObjects { public class DataBasePrivilege { public virtual DataBasePrivilegePrimaryKey CompositeKey { get; set; } } public class DataBasePrivilegePrimaryKey { public string Host { get; set; } public string DataBase { get; set; } public string User { get; set; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != typeof (DataBasePrivilegePrimaryKey)) return false; return Equals((DataBasePrivilegePrimaryKey) obj); } public bool Equals(DataBasePrivilegePrimaryKey other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Host, Host) && Equals(other.DataBase, DataBase) && Equals(other.User, User); } public override int GetHashCode() { unchecked { int result = (Host != null ? Host.GetHashCode() : 0); result = (result*397) ^ (DataBase != null ? DataBase.GetHashCode() : 0); result = (result*397) ^ (User != null ? User.GetHashCode() : 0); return result; } } } } And the following is the exception I am getting: Execute System.InvalidCastException: Unable to cast object of type 'System.Object[]' to type 'TGS.MySQL.DataBaseObjects.DataBasePrivilegePrimaryKey'. at (Object , GetterCallback ) at NHibernate.Bytecode.Lightweight.AccessOptimizer.GetPropertyValues(Object target) at NHibernate.Tuple.Component.PocoComponentTuplizer.GetPropertyValues(Object component) at NHibernate.Type.ComponentType.GetPropertyValues(Object component, EntityMode entityMode) at NHibernate.Type.ComponentType.GetHashCode(Object x, EntityMode entityMode) at NHibernate.Type.ComponentType.GetHashCode(Object x, EntityMode entityMode, ISessionFactoryImplementor factory) at NHibernate.Engine.EntityKey.GenerateHashCode() at NHibernate.Engine.EntityKey..ctor(Object identifier, String rootEntityName, String entityName, IType identifierType, Boolean batchLoadable, ISessionFactoryImplementor factory, EntityMode entityMode) at NHibernate.Engine.EntityKey..ctor(Object id, IEntityPersister persister, EntityMode entityMode) at NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) at NHibernate.Impl.SessionImpl.Get(String entityName, Object id) at NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id) at NHibernate.Impl.SessionImpl.Get[T](Object id) at TGS.MySQL.DataBase.DataProvider.GetDatabasePrivilegeByHostDbUser(String host, String db, String user) in C:\Documents and Settings\Michal\My Documents\Visual Studio 2008\Projects\TGS\TGS.MySQL.DataBase\DataProvider.cs:line 20 at TGS.UserAccountControl.UserAccountManager.GetDatabasePrivilegeByHostDbUser(String host, String db, String user) in C:\Documents and Settings\Michal\My Documents\Visual Studio 2008\Projects\TGS\TGS.UserAccountControl\UserAccountManager.cs:line 10 at TGS.UserAccountControlTest.UserAccountManagerTest.CanGetDataBasePrivilegeByHostDbUser() in C:\Documents and Settings\Michal\My Documents\Visual Studio 2008\Projects\TGS\TGS.UserAccountControlTest\UserAccountManagerTest.cs:line 12 I am new to NHibernate and any help would be appreciated. I just can't see where it is getting the object[] from? Is the composite key supposed to be object[]?

    Read the article

  • WPF ComboBox IsSynchronised Default Value

    - by LnDCobra
    I am trying to display a default value (or even NO value) when selected index is -1, or selecteditem is null. This normally works perfectly fine but when I enable IsSynchronizedWithCurrentItem and set it to True, the first value in my DataTable gets displayed. How can I have both IsSynchronizedWithCurrentItem ="True" and show no/default value when it is loaded. My Combo Box XAML: <GroupBox Name="ClientGroup" Header="Client" Margin="63,182,0,177" FontSize="14" HorizontalAlignment="Left" Width="298"> <ComboBox Name="Supplier" Grid.IsSharedSizeScope="True" ItemsSource="{Binding}" IsEditable="True" Text="Please Choose..." TextSearch.TextPath="CompanyName" IsSynchronizedWithCurrentItem="True" Height="23" VerticalAlignment="Top" Margin="0,6,6,0" FontSize="11" StaysOpenOnEdit="True"> <ComboBox.ItemTemplate> <DataTemplate> <Grid Margin="0,5,0,5"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" SharedSizeGroup="CompanyName" /> <ColumnDefinition Width="Auto" SharedSizeGroup="EIC" /> </Grid.ColumnDefinitions> <TextBlock Text="{Binding CompanyName}" Grid.Column="0" /> <TextBlock Text="{Binding EIC, StringFormat=' ({0})'}" Grid.Column="1" FontFamily="Courier New" FontWeight="Bold" FontSize="12" /> </Grid> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </GroupBox> My CS code behind: ClientGroup.DataContext = (new CompanyDealsDataSetTableAdapters.CompanyTableAdapter()).GetData(); When I start my application it automatically selects the first row in my data table. It works as expected when I remove IsSynchronizedWithCurrentItem. Any ideas?

    Read the article

  • WPF Error when implementing Login.xaml

    - by LnDCobra
    I am getting the following exception: "Nullable object must have a value" Everything was working when I was using StartupURI="MainWindow.xaml" but I wanted to implement a login screen so I changed this to Startup="Application_Startup" and then created the following method in App.xaml.cs: private void Application_Startup(object sender, StartupEventArgs e) { UpdateAccounts(); bool result = true; ///* LoginWindow login = new LoginWindow(); result = login.ShowDialog().Value; /* */ if (!result) { return; } MainWindow window = new MainWindow(); bool main = window.ShowDialog().Value; } Does anyone have any idea what is going on? Or any suggestions on what is the best practice for implementing login interface.

    Read the article

  • Best method to store Enum in Database

    - by LnDCobra
    What is the best method of storing an Enum in a Database using C# And Visual Studio and MySQL Data Connector. I am going to be creating a new project with over 100 Enums, and majority of them will have to be stored in the database. Creating converters for each one would be a long winded process therefore I'm wondering if visual studio or someone has any methods for this that I haven't heard off.

    Read the article

  • Storing Preferences/One-to-One Relationships in Database

    - by LnDCobra
    What is the best way to store settings for certain objects in my database? Method one: Using a single table Table: Company {CompanyID, CompanyName, AutoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter} Method two: Using two tables Table Company {CompanyID, COmpanyName} Table2 CompanySettings{CompanyID, utoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter}

    Read the article

  • Visual Studio DataSet Designer keep queries

    - by LnDCobra
    In visual studio datasource designer(The screen where you have all the UML Diagrams including relations) is there any way to refresh a table and its relations/foreign key constraints without refreshing the whole table? The way I am doing it at the moment is removing the table and adding it again. This adds all the relations and refreshes all fields. Also if I change a fields data type, is there a way to automatically refresh all the fields in the datasource? Again without deleting the table and adding it again. Reason for this is because some of my TableAdapters have quite a number of complex queries attached to them and when I remove the table the adapter gets removed as well including all its queries. I am using Visual Studio 2008 and connecting to a MySQL database.

    Read the article

  • NDbUnit MySQL Assembly Version Conflict

    - by LnDCobra
    I am trying to use NHiberanate with NDbUnit but I cannot as NDbUnit tried to load MySql.Data version 1.0.10.1 and NHibernate tries to load version 6.2.2.0 and I can only reference one of them. Here is the error I get when i try to run NDbUnit Set Up System.IO.FileLoadException: Could not load file or assembly 'MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at NDbUnit.Core.MySqlClient.MySqlDbCommandBuilder.GetConnection(String connectionString) at NDbUnit.Core.DbCommandBuilder..ctor(String connectionString) at NDbUnit.Core.MySqlClient.MySqlDbCommandBuilder..ctor(String connectionString) at NDbUnit.Core.MySqlClient.MySqlDbUnitTest.CreateDbCommandBuilder(String connectionString) at NDbUnit.Core.NDbUnitTest.GetDbCommandBuilder() at NDbUnit.Core.NDbUnitTest.ReadXmlSchema(Stream xmlSchema) at NDbUnit.Core.NDbUnitTest.ReadXmlSchema(String xmlSchemaFile) at Proteus.Utility.UnitTest.DatabaseUnitTestBase.SaveDatabase(String connectionString, String schemaFilePathName, String datasetFilePathName, DatabaseClientType clientType) at TGS.UserAccountControlTest.UserAccountManagerTest._TestFixtureSetup() in C:\Documents and Settings\Michal\My Documents\Visual Studio 2008\Projects\TGS\TGS.UserAccountControlTest\UserAccountManagerTest.cs:line 69 Does anyone know how to resolve this?

    Read the article

  • Database Design Primay Key, ID vs String

    - by LnDCobra
    Hi, I am currently planning to develop a music streaming application. And i am wondering what would be better as a primary key in my tables on the server. An ID int or a Unique String. Methods 1: Songs Table: SongID(int), Title(string), Artist*(string), Length(int), Album*(string) Genre Table Genre(string), Name(string) SongGenre: SongID*(int), Genre*(string) Method 2 Songs Table: SongID(int), Title(string), ArtistID*(int), Length(int), AlbumID*(int) Genre Table GenreID(int), Name(string) SongGenre: SongID*(int), GenreID*(int) Key: Bold = Primary Key, Field* = Foreign Key I'm currently designing using method 2 as I believe it will speed up lookup performance and use less space as an int takes a lot less space then a string. Is there any reason this isn't a good idea? Is there anything I should be aware of?

    Read the article

  • Good Name for a Music Player (like Spotify)

    - by LnDCobra
    I can't think of anywhere else to ask therefore I thought asking here would be the ideal place. Reason I'm asking is because for my Dissertation in my report I pretty much got told my name sucks. I ain't going to argue as its just "My Music Player" so any suggestions would be highly appreciated! I know it's pretty subjective but ANY help would be appreciated! I am not of the creative types of people :(

    Read the article

  • Why use MVVM???

    - by LnDCobra
    Okay, I have been looking into MVVM pattern, and each time I have previously tried looking into it, I gave up for a number of reasons: Unnecessary Extra Long Winded Coding No apparent advantages for coders (no designers in my office. Currently only myself soon to be another coder) Not a lot of resources/documentation of good practices! (Or at least hard to find) Cannot think of a single scenario where this is advantageous. I'm about to give up on it yet again, and thought I'd ask to see if someone answer the reasons above. I honestly can't see an advantage of using this for a single/partner coding. Even in complex projects with 10's of windows. To me the DataSet is a good enough view and binding like in the answer by Brent following question

    Read the article

  • Change ClickOnce Publish Folder Location

    - by LnDCobra
    How can I change the Publishing Folder of already deployed applications? E.G. Currently the path is \\Server1\App but I want to change this to \\Server2\App For performance reasons (Server1 is becoming overloaded) and therefore I'm planning to move majority of our shared folders including the Apps folder to a different server

    Read the article

  • MVVM Binding Password

    - by LnDCobra
    I am re-factoring my application to implement the MVVM design and i came across my first problem... Compiler won't let me bind to the Password property of the PasswordBox control. Anyone have any ideas / suggestions.

    Read the article

  • NHibernate MySQL Mapping Set Column Type

    - by LnDCobra
    In my MySQL database, I have the following column type. Field | Type | Null | ---------------------------------- Column_priv | set('Select','Insert','Update','References') | No | And I cannot figure out what to map this to. Can anyone tell me how I can map this to something?

    Read the article

  • Change ClickOnce Publich Folder Location

    - by LnDCobra
    How can I change the Publishing Folder of already deployed applications? E.G. Currently the path is \\Server1\App but I want to change this to \\Server2\App For performance reasons (Server1 is becoming overloaded) and therefore I'm planning to move majority of our shared folders including the Apps folder to a different server

    Read the article

  • ClickOnce disallow publishing of Debug builds

    - by LnDCobra
    Is there anyway to disallow publishing Debug builds when publishing ClickOnce aplications using Visual Studio 2008? I know this was asked before, but i can't figure out how from the answer. THe Accepted answer for previous question was: One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build. The condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail. Could anyone elaborate on that answer or tell me where/or how I can add this condition. [Original Question][1] [1]: http://One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build. The condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail.

    Read the article

  • MVVM Group Radio Button

    - by LnDCobra
    What is the best way of binding a number of RadioButtons to an enum using MVVM? The only way I can think of is binding each group box's IsChecked to a property, and in the setter of that property assign a value to an enum in the view model. Any help is appreciated.

    Read the article

1 2  | Next Page >