Questions tagged as 'c#'

1
answer

SQL insert more than one record in a table in an INSERT

I would like to make a query where I insert a record that is related to 2 more tables. MaximosyMinimos INSERT INTO MaximosYMinimos (ProductoID, SucursalID, Max, Min) VALUES ((select p.ID from Productos as p where p.ID = 1325 ), (select s...
asked by 19.02.2018 / 20:23
1
answer

Indicate that a record already exists in the database

I would like to know how I do to indicate within the code, that the product already exists in the database. I explain: The form asks to enter an existing code, it is searched in BD, it is obtained and it shows the user a message that indi...
asked by 20.02.2018 / 13:56
1
answer

Replace the use of "var" when creating a variable in C # 2.0

Good my query is this: var items = new Normaslist(); try { conn.Open(); //using (var dr = cmd.ExecuteReader()) using (SqlDataReader dr = cmd.ExecuteReader()) { in the code shown I define a variable...
asked by 02.03.2018 / 18:47
1
answer

error: DataSource must be the identifier of a control of type IDataSource? ASP.NET C #

Hi, I have the following gridview in asp .Net <asp:GridView ID="grid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" CssClass="table table-bordered bs-table" allowpaging="True" ShowFooter="True" BackColor...
asked by 02.03.2018 / 18:03
1
answer

How to modify the webconfig connection string from the controller

I have this conexionstring and I would like from the controller to change the data source and other parameters, how can I do this? Thanks in advance     
asked by 17.01.2018 / 15:47
3
answers

Query about catching exceptions within a function - C #

I was wondering if I could catch all the exceptions within a function, for that I would consider the following example. My question is mainly if I can catch dividebyzeroexception within the definition of the function and not from outside....
asked by 09.03.2018 / 23:54
1
answer

How to keep the sound when reading an augmented reality

I have the following situation. I am reading a pattern with RA with vuforia . At the moment of reading the pattern, it begins to play a sound while I am reading but if I stop reading the pattern the sound stops. My question is the following the...
asked by 09.03.2018 / 16:26
1
answer

Change Header pripiedad in "Expand" control

I try to change the property Header of an Expander to vary the title of this variable depending on but there is no way ... If I add a constant to the Header, it works correctly; <Expander Name="Header" Margin="4" Header="Config ni...
asked by 08.01.2018 / 20:35
1
answer

Access object methods contained in a stackpanel.Children

Suppose that I put in StackPanel 5 objects of the class ConfigNivel , I would like later to access the methods of these 5 objects, for example, the method GetTotal() , which are housed inside ConfigNivel().GetTotal()...
asked by 08.01.2018 / 21:25
2
answers

search strings list

Good, someone could help me please or give an idea of how to solve the following problem I have a string in the phrase "CASA", I need to go through the list of letters and form the word CASA is the string that is in the phrase list     
asked by 03.02.2018 / 21:52