DataSource Controls :: Unique Numbers For Pulling Data?

Feb 3, 2010

I currently designed a school result portal. If the students want to view their result, they input their student school number in a text box to search out their result. But this is not secured because anybody can look up any students result if you have the number which is even written on their school uniform for identification.

I have being trying to secure this result by trying to generate or code special numbers that the students will input with their school number. The special numbers will be random numbers and may be from 10 and above, it might even contain letters. How do
I code this. I believe this is the best asp.net forum. I want the students to be inputing this special unique numbers and their student numbers so that there result will be avaliable to them.

View 2 Replies


Similar Messages:

DataSource Controls :: Storing And Pulling Data In DB To Get Google Map Location

Jul 22, 2010

I have this simple project which needs to show location on a google map by pulling data from the DB.I am using asp.net, mysql DB, google map and i found out from some website that i needed to use ajax.

The process is like this

1. I have a event form where i have multiple fields to fill in and it includes a Location/Venue fields which i can enter a location by Name(Not the Co-ordination). I am located in Singapore. So all fields will be stored into the DB.

2. I have a webpage displaying a table of the data from the same DB, and it comes with a embedded Google Map. On the table, the value of the Location column will be Hyperlinked, and when i click it, it will act as a search query in the embedded google map and locate the address without reloading the page again(which i believe i gotta use iframe?)

View 3 Replies

DataSource Controls :: Appending Data To An SQL Server Database After Pulling From An ODBC?

Jul 15, 2010

I am working on an asp webform that pulls from an ODBC datasource then puts the data in an sql server. Once the data is in the sql server several queries pull data from it to provide information for a report.

This is an example of what I am talking about

private
void ODBCpdEmployeeAb()
{
DataTable dt =
new
DataTable();

[Code]....

The first part gets the data from the ODBC connection and the next part stores it in an sql server table. The problem is I have these methods in the page load event of the webform so everytime it loads it just puts the exact same data in the sql server table which would then provide incorrect information on the report.

Is there a way to append the most recent data from the ODBC table to the sql server ?

View 3 Replies

Web Forms :: How To Generate Unique Random Numbers

Sep 27, 2010

I want to generate a unique random number everytime a user submits a form. As the form is submited the data of the form should be placed in a database and a unique random number should be generated so that the user can later use this unique random number to reterieve his details from the database that refer to his unique random id. The unique random number should be atleast 9 digits long.

View 5 Replies

SQL Server :: How To Generate Unique Random Numbers

Mar 30, 2011

I have an ID field where I need to insert unique ID's

the ID should be like -

S- (YY)(MM)9999. where, (YY) is year, (MM) is month and 9999(is a four digit random number)

for example - S-11030001

View 5 Replies

DataSource Controls :: How To Get The Unique Records Randomly From Data Table

Mar 22, 2010

I have a data table with 20 records i have to get the 15 unique records randomly and have to store it in Arraylist but now problem is that how i select the 15 unique records from Data table each time .

View 9 Replies

DataSource Controls :: SQL Left Select Not Pulling Records?

May 12, 2010

The DoctorGen Table has primary key DocId and Doctors has Keys set on DocId and MemId. I want to get all records from DoctorGen where UserID = @UserId even if there are no matches in the Doctors Table. I'm not getting any records.

[Code]....

View 13 Replies

DataSource Controls :: Pulling A Date From An Access Database?

May 26, 2010

I am pulling a date from an Access Database and inserting into my Dataset. I am assigning it to "myDate" and then assigning it to my SQL parameter @StartDate.

When I run my ExecuteNonQuery I get a null value in my SQL database. There are no null values in my access database. I must have the syntax wrong.

[Code]....

View 4 Replies

DataSource Controls :: Select Statement Pulling Multiple Times From Same Row

Jan 5, 2010

[Code]....

I have a select statement that is supposed to be filling grid with information from an income table. It's only supposed to pull if the income is from the current fiscal year or is less than 1 year old. Currently, what it does is pull multiples of rows and also rows from past income years but only if there is a mixture. For instance, if a person has income from 2005 and 2010 what it will show is this

Income 2005
Income 2005
Income 2010
Income 2010
Income 2010

Does anyone know what I've done wrong? BTW, those results are exact, old income is shown twice, current is shown 3X

View 16 Replies

DataSource Controls :: Find The Biggest Two Numbers Out Of Three

Mar 30, 2010

I have to write a stored procedure to get the biggest two values out of three in three different columns in the same table.

I have a table , for instance,

total marks1 - column1 ( eg values - 1000)

total marks2 - column 2 (eg values - 500)

total marks3 - column 3 (eg values - 800)

i have to get (return the value) 1000 and 800.

View 6 Replies

DataSource Controls :: Excluding Zero Numbers From The Query?

Jan 4, 2010

Is there any way, I can exclude the whole row if one particular column has zero in it. I have this query

select first_name, last_name , employee_num, cubeNumber, extension

from tblData left join tblfacility
ON tblData.employee_num = tblfacilit.employee_num
left join tblextension ext
on tblData.extension = ext.extension

tablExtension has phone number extension in it. If we don't know someones phone extension, we put zero for their extension, now there are tons of people who have zero extension.when I run this query, it returns same name lot of times with different cubeNumber so I get

Fisrt_name last_name employeenum cubeNumbae extension

a ax 1 12 0
a ax 1 13 0
a ax 1 14 0
b bx 2 12 0
b bx 2 13 0
b bx 2 14 0

Both emploee a and employee b extensions are zero in above case. I want both a and b to be displayed only once .Right now it is displaying them so many times with all the cubesNumber that have extension zero.

View 8 Replies

DataSource Controls :: UDF Or Procedure To Get Records For Transposed Numbers?

Mar 8, 2010

I am looking for a function or procedure in sql server which assists me in figuring out the records which is having Transposed numbers. E.g one record is having invoice number as 1234 and another record is having invoice number as 2134(this is the definition for transposed records for me). My another problem is that the length of invoice number is not known. It can be from 1 character to 15 characters or more than that.

View 2 Replies

DataSource Controls :: Columns Don't Currently Have Unique Values?

May 3, 2010

I am returning a dataset from a method and trying to set one of the columns as Primary Key.

CategoryList.Tables[0].PrimaryKey = new DataColumn[] { CategoryList.Tables[0].Columns["CategoryNodeId"] };

Interestingly it gives me this error at run-time, These columns don't currently have unique values.

Now I perfectly know why this error should error, but there are no duplicate keys in this data column. I broke the code in between and bound the dataset to gridview to check if this column contains any duplicates and this is not the case. Here is the result set underneath. Have a look at the first column 'CategoryNodeId'.

CategoryNodeId
CategoryId
Name
ParentCategoryNodeId [code]...

unable to find a work around for now.

View 3 Replies

DataSource Controls :: SQL Statement / Don't Have Any Unique Identifier?

Mar 11, 2010

I am just wondering how do I get the very last row of a join statement if I don't have any unique identifier... as in row_number field?Is there a way of creating a dummy column on my SQL statement to hold the record numbers of all records ..[1 to n] etc ???Id like to know how to do this and then I can get the MAX record number.Im using SQL server 2005 so the last() function doesn't work.

View 3 Replies

DataSource Controls :: Insert Row Only When A Certain Field Is Unique?

Jan 3, 2010

For example: INSERT INTO table (col1, col2, col3) VALUES ('value1','value2,'value3')But I would only like to insert the row if value3 isnt already present in col3 in some previous row. What is the best way to do that?And the insert command is run 50+ times in a loop (with different values each time for value3)

View 4 Replies

DataSource Controls :: Maximum Numbers Of Records Handled By SQL SERVER

May 12, 2010

I want to know the Maximum numbers of records Handled by SQL SERVER???

View 2 Replies

DataSource Controls :: Unique Columns In A Northwind Database

Apr 6, 2010

im creating a database that needs a unique constraint on columns. does anyone know how to add this within the northwind database?

View 4 Replies

DataSource Controls :: Return Unique Rows : T-SQL Query

Jun 11, 2010

I have an SQL database table like the following:

ID // Code // Shape

The ID is the integer identifier.

On one line the Code may be OX01 and shape Hexagon for example

Then the next line the code is still OX01 but the shape is Triangle.

What I want to do is be able to pull back data for every line that is equal to a unique Code column. in the above example OX01 Hexagon would be returned but not OX01 Triangle.

I've tried using SELECT DISTINCT but it brings back all records and doesn't filter them correctly.

I've considered having another column which could have Child/Parent data so that only the parent is returned but i'm sure there must be a better way of doing this.

View 2 Replies

DataSource Controls :: Datatable Defaultview On Unique Date?

Jun 8, 2010

I have a datatable and I want to have a view on it with unique dates. The thing is that I want the date to be unique if the year,month and day are the same, I dont care for the exact time.

I now have:

Dim dtUniqueDates As System.Data.DataTable
dtUniqueDates = dt.DefaultView.ToTable(True, "updatedate")

So in this case 12 february 2011 13:54 is different from 12 february 2011 15:54. But since year,month and day are the same I want them to be unique.

View 1 Replies

DataSource Controls :: Concatenate Field For Unique Identifier?

Feb 3, 2010

I'm using Visual Web Developer Express 2008 and SQL Management Studio Express 2005. I need to link 2 tables to either present in a Master/Detail or GridView/Form view.The goal is to allow the user to view time card information from the AS400 (read only) and then enter any corrections into a SQL table. My problem is in trying to connect the two tables.I've asked the AS400 administrator to add a unique identifier field to the table (HAPOINT), but he says he can't. I've tried to concatenate a field within Visual Web Developer's Query Builder but keep getting errors.Table 1 - exists in AS400, is non-permanent (cleared every 3 months) and can't be modifiedEmpl ID WO Date In Time In Date Out Time Out Table 2 - exists in SQL Server, newly created for this project (no data yet, so can be modified)Rev ID Empl ID Date (of revision entry) X (Revise - y/n) Revised Time In Revised Time Out I tried finding a solution through the SQL Forum, but haven't gotten a solution, so I'm posting here. There are additional details at that post:http://forums.asp.net/p/1516929/3658517.aspx#3658517Can anyone tell me how to concatenate "Empl ID /WO / Date In / Time In" from Table 1 to produce a unique identifier that I can then use in Table 2, thus providing the link between the two tables? Or, is there another way?

View 8 Replies

DataSource Controls :: Insert Sequential Numbers Into A Primary Key Column Using A Script?

Jan 29, 2010

I need to insert multiple records using a script.

My table is

Region
(
ID int,
Name varchar(50),
Description varchar(51)
)

One thing I can use is to retrieve the max(ID) from region and store it in a variable and increment the variable sequentially and insert. But, if any other user inserts a record while I am executing this script then max(id) might clash with the id inserted with other user causing my script to fail.

Is there any other option to insert record sequentially base on the highest number in the table.

View 3 Replies

DataSource Controls :: Generate A Unique Ref Number And Insert Into The Database

Jul 5, 2010

I am generating a unique Ref number using this sql statement: SELECT REPLACE(STR(CAST(CAST(NEWID() AS binary(5)) AS bigint),12),0,0) as REF Subsequently, I need to insert this REF into sql database table in stored procedure. Here is what I did in my stored procedure:

USE [iBankRecords]
GO
/****** Object: StoredProcedure [dbo].[stp_addPayee] Script Date: 07/05/2010 21:57:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[stp_addPayee]
(
@CUSTID char(10),
@PAYEEACCNUM nvarchar(20),
@PAYEEACCTYPE char(10) ,
@PAYEENAME char(20),
@PAYERINITIAL char(20),
)
AS
DECLARE
@ReturnValue int
INSERT INTO PAYEE (CUSTID, PAYEEACCNUM,PAYEEACCTYPE,PAYEENAME,PAYERINITIAL, REF)
VALUES (@CUSTID,@PAYEEACCNUM,@PAYEEACCTYPE,@PAYEENAME,@PAYERINITIAL, REF)
IF @@ERROR<>0
BEGIN
PRINT 'ERROR'
SET @ReturnValue=1
RETURN @RETURNVALUE
END
ELSE
BEGIN
SET @ReturnValue=0
RETURN @RETURNVALUE
END

May I know how do I have generating a unique ref num and inserting the REF into the above statement?

View 1 Replies

Forms Data Controls :: Pulling A Value From A Gridview?

Jun 28, 2010

I'm trying to pull a value from a Gridview so that I can create a running subtotal. I've looked at a number of examples but they all seem to fail.

Why does this not work? Each and every reference I try to make to the cells "value", comes up null.

Sample code1:

[Code]....

Sample code2:

[Code]....

In sample code 2, I get the "header text" for the column...but I know the value in the cell...so it fails on a data conversion.

View 5 Replies

Forms Data Controls :: Formview Data - Pulling Data From A SQL Database In Cases The Rows Contain One Or More Null Values

Feb 1, 2011

Using a class component, an Object data source and a formview I am successfully pulliing data from a SQL database. In some cases the rows contain one or more Null values and I would like them to be ignored completely. My simple code follows:-

<%# Eval("add_1") & ","%>
<%# Eval("Add_2") & ","%>
<%# Eval("Add_3") & ","%>

OUTPUT:-

Rose Cottage, 123 New Road, Margate,

View 2 Replies

Forms Data Controls :: Pulling The Value Of A TemplateField From A GridView?

Nov 23, 2010

I have a GridView, bound to a table (Meals) in a SqlDataSource.

Into that GridView, I have added a TemplateField, which contains a DropDownList (which displays the numbers 1 - 10, added manually; no Data Binding). And, I've added a ButtonField.

When I click the Button, I want the values of some of the GridView rows PLUS whatever value was selected in the DropDownList to be pulled out and stored in a second Sql table (Orders).

Pulling the rows bound to the SqlDataSource is easy but JavaScript is needed (I think) to pull the SelectedValue from the DropDownList. I understand women more than understand JavaScript (that's how little I know) and the code below has been kindly offered by another forum user who is at a loss, himself, now.

Here's the code and the error message I'm getting.

ASPX:

[Code]....

And here's the Code Behind:

[Code]....

No design time errors reported but here's the run time error:

Object reference not set to an instance of an object.

On the following line:

Line 28: if (row.RowType == DataControlRowType.DataRow)

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved