Unique constraint - these columns currently doesn't have unique values..?? I have created Unique Constraint with 3 columns. My code works perfectly but once - two users @ same time entered same data and somehow it saved in DB; after that incident. This UniqueConstraint gives me error - These columns currently doesn't have unique values. How can I check if user enters this kind of entry or how can I restrict the Entry?
I am using VB .Net to access the eBay API and store all completed orders in a database. This database is then fed into a proprietary shipping system, which can not handle an order number larger than 20 characters. eBay returns an order number like so 230407279314-680141236013 which is too long. The order number is always 12 numbers a hyphen and 12 more numbers. What I need to do, is turn this (the result can be alpha numerical) into a shorter, unique order key to store in my database alongside the true orderId (so that this can be referenced by the shipping software instead of the actual order number). The reason for the 20 character limit is the barcode algorithm used. Is there any way to achieve this in VB .Net 2010? This number can be anything unique, so long as it does not exist already (even a good uniqueid function would work, but I would have to query the database to make sure it isn't taken)
I'm trying to make a method that can get unique values from a specified column of a DataTable. The problem is that the column may be string, integer, etc. I'm not sure what type of variable the (Of T) is.
Private Sub GetColumnUnique(ByVal dbTable As DataTable, ByVal ColumnNumber As Integer, ByVal ColumnType As ???) Dim results As List(ColumnType) = (From item In dbTable.AsEnumerable Select item.Field(ColumnType)(ColumnNumber)).Distinct.ToList End Sub
How generate the unique no. 1,2,3 and so on .... on button click of each new user ..
the code mentioned below is a readwrite coding in vb.net ...
but the problem is it generate the same id for different users on button click event... but i want the no. of times button clicked the new ids will be generated
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim FILE_NAME As String = Server.MapPath("counts.vbi")
I have a problem that adding a new ROW with duplicate UNIQUE id throws CONSTRAINTException that I cannot always catch.. Randomly general exception halts my VB software, sometimes catching works. here is my code.
When user inserts a duplicate entry in a unique field, Castle ActiveRecord throws the following exception: Castle.ActiveRecord.Framework.ActiveRecordException was unhandled Message="Could not perform Save for SerieNotaFiscal" Source="Castle.ActiveRecord" StackTrace: [Code] .....
Sub emailConfirm() Dim email As String = txtMail.Text Dim name As String = txtPrenom.Text + txtNom.Text[code]....
note:I want to send Link contains a unique identifier and verify the unique identifier in the login.aspx.I don't know when to do this...I found nothing interesting on the net ...
is there a way to filter out unique values in a dataview or an array? I currently filter a dataview as such: [code] So now I have a dataview filtering the table, but can I further filter this data to find the unique instances of an item in this table? I eventually have to pass a portion of this table to an array, so if there is a way to find unique values in an array, I can use that.
So now I have a dataview filtering the table, but can I further filter this data to find the unique instances of an item in this table? I eventually have to pass a portion of this table to an array, so if there is a way to find unique values in an array, I can use that.
I am trying to store 5 values and an associated unique key. I need to search for this key and update the 5 associated values. I'm guessing I would use an object as the value but how do I get the values out from the object?
I am using a DataGridView that has a filtered dataset and I like to validate a column in a new or changed row via a sub in the partial dataset class so that I can set the errorprovider to an error if the entered value isn't unique.I started out to set the field in SQL server with a unique key and then catch the sqlerror on the form. But data validation is best practice to do in the partial dataset class so I am trying to do it for this particular problem aswell. But after spending a lot of time I am stuck and wonder if it is even possible to do this particular validation in the partial class?
I am using XtraGrid in my application. Now, I want to display only Unique values for particular column when user will click filter button. I want to display this list check box items initially all checked. Also I want the information that what items user has selected/deselected from from checked list box.
I need to create an array, then iterate through a string, adding the string value to the array only is it does not already exist, to produce an array of unique values. The issue I am having is with the array.length operation - on a array that is nothing I am unable to retrieve the array length (0), as such I am unable to redimensionalise the array to be array length (must be array length as arrays are indexed from 0), providing me the ability to add the new value to the array and then continue the loop until all values have been checked to see if they exist within the array (using contains) and the value contain only unique values..
I am trying to populate an array with all the unique values in a string, to prevent me ReDim'ing an array every time I find a value that not already contained in the array I am trying to create (consumes alot of time), I am trying to get the unique values first so I only have to ReDim once and after that I can simply iterate through the string and the array I have will be the correct size for the unique values I aquire (I am using this...)
I'm using MySQL to store some numbers. One of the columns in the database is defined as unique, but it does allow multiple NULL-values. That is exactly how I want it.ut when I'm trying to load the data into my strongly typed DataSet, I get a error saying that a constraint fails... I do understand why that happens (several rows with NULL-values in a unique column), but is it a way to keep a DataColumn in vb.net unique, but still allow several rows with NULL-values like in MySQL?
I'm using an Infragistics UltraWinGrid with a column of drop-down boxes. I don't want the user to be able to select the same value for multiple rows in that column. Is there a simple (or heck, I'd settle for advanced) way to do this? I'm using VB.NET
-EDIT-
I tried setting a filter on the data source for the drop-down box. But when I did that, the values in the other boxes in that column started disappearing (not the values themselves, but the descriptions that they were supposed to represent, so instead of reading "Information", it just said "1"). All of the cells in a column refer to the same combo box, so if you filter out a value from the data source for one of them, you filter it out for all of them. I'm currently trying to catch a CellChange event and check against all other currently-used values. If it was already used, I would put up a message saying as much and revert back to the old value. However, the value comes back as the previously-saved one, so... not helpful. About to see if I can use the "text" property.
How can I query a DataTable to find all of the unique values in a column? SQL has the 'unique' or 'distinct' keywords, but I dont know how to do this against a DataTable.
I am having so trouble with the ToUpper() procedure with strings. I am using LINQ to find unique values in a list of objects. In that whole process I set the values to compare to all lowercase in order to get a proper list. My goal is to populate a dropdown list with the values. I'm attempting to set the first letter of of the string to uppercase and keep the rest lowercase however the toUpper() procedure is not working?
Private Function FixCase(ByVal strIn) As String Dim strOutput As String Dim intStringLength As Integer = strIn.Length - 1 strOutput = strIn.Substring(0, 1)
I have a List (Of Type) which contains many instances of a class with three properties, IPAddress, AlertDate and AlertTime.There can be many duplicates of IPAddress in this list :-
[code]...
I need to be able to pull out just the latest (by date and time) entry in the list for each unique IPAddress. Is there any simple way of doing this?
The program must generate 6 unique random numbers but when I click display numbers sometimes it gives me 6 unique numbers and sometimes I get duplicate numbers. I will add the code I have so far.
Public Class frmMain
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
I like to add a gradient brush to each row of my datagridview. I like to change the gradient colors for each row independently depending of some cell values in the row.
I know how to add a solid background color to each, cell, row, column etc. but I do not know how to add a gradient brush to each row individualy.
I need to fill the datagridview with values, the datagridview is disconnected from any database or other data source. After filling the datagridview, I want to step trough each row, find my key values, decide the gradient colors and then add the gradient to the row.
I like to do something similar to what I now do with a background color:
For Each R As DataGridViewRow In DGV.Rows Dim CS As New DataGridViewCellStyle Select Case i
I'm using vb.net on vb 2005, I create datagrid view that when i click search button on the main form. It will show datagrid view that I want and when i click OK to select any record, the selected record will show on the desire text box in the main form. The problem is the record i choose is record no. 5 of all 10 record but the Bindingnavigator tools bar show that it's the first record of all 10 and when I click Next record arrow, the error message show that the 'PK column name' is unique and the 'value of the PK from my selected record' is already exist. [Code]
I have a stored procedure (I cannot edit) that I am calling via linq.
The stored procedure returns values (more complex but important data below):
Customer Stock Item Date Price Priority Qty -------------------------------------------------------- CUST1 TAP 01-04-2012 £30 30 1 - 30 CUST1 TAP 05-04-2012 £33 30 1 - 30 CUST1 TAP 01-04-2012 £29 20 31 - 99 CUST1 TAP 01-04-2012 £28 10 1 - 30
I am trying to limit this list to rows which have unique Dates and unique quantities in LINQ. I want to remove items with the HIGHER priority leaving rows with unique dates and qty's.
I have tried several group by's using Max and order by's but have not been able to get a result.
Is there any way to do this via linq?
EDIT:
Managed to convert brad-rem's answer into VB.net.
Syntax below if anyone needs it:
returnlist = (From p In returnlist Order By p.Qty Ascending, p.Priority Group By AllGrp = p.Date, p.Qty Into g = Group Select g.First).ToList