Data Controls :: Unable To Insert Data Into Database If There Was Mobile Number?

Jun 6, 2013

I have 2 table in database

1-Estate_free Table

2-Black_list Table

in Register.aspx users can insert their information and when click on insertButton it insert their data into Estate_free table

below is code

  protected void insertButton_Click1(object sender, ImageClickEventArgs e)
{
SqlCommand _cmd = new SqlCommand("InsertFreeState1", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();

[Code].....

in above SP I define that if users tell or Mobile number was in Estate_free ro Black_list table it doesn't insert data into database and show 'You can just register 1 Time' and if there wasn't their mobile or Tell in those table it insert their data into Estate_free table and show 'You have been registered'.

problem is that when I enter data in database with new mobile number it didn't insert data in database and show 'you can just register 1 Time'.

I mean it never insert data in database.

what should i do?

View 1 Replies


Similar Messages:

Forms Data Controls :: Unable To Insert Records To Database

Feb 6, 2011

I am unable to insert records into the database due to this error:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object

This sentence is highlighted in red:

osdb.Insert_ItemsRecords(txtID.Text, txtItemName.Text, txtItemDesc.Text);
BindGrid(true);

How do i set set the osdb to a valid instance?

View 6 Replies

DataSource Controls :: How To Insert Data Into Sql Server Mobile Edition

May 5, 2010

i m facing the problem to insert data into database in mobile appliction i have written the code to insert data in c# and its working fine. Executenonquery returns one row but when i select data directly from the database it dont have any data and when i insert data directy into database then data is inserted and show in appliction.

View 4 Replies

Data Controls :: Insert Space And Number From Gridview?

Apr 27, 2016

I have gridview with two column. Id and number. Id begin 1 continue till 300.

Id Number

1 2
2 1
3 4
4 5
5 3
6 2
7 5
8 3
9 1
10 1
11 2
13 2
14 5

But I want insert id and number from gridview into TableNumber like this:

If id in( 1 , 9) then add three space before number .

If id in( 10 ,9 9) then add two space before number .

If id in( 100, 999) then add one space before number .

For example:
" 1"
" 2"
" 3"
" 4"
" 5"
" 6"
" 7"
" 8"
" 9"
" 10"
" 11"
" 100"
" 101"

How I can solve this?

View 1 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

Social Networking :: How To Get Current Location Of Mobile Using Any Mobile Number

May 7, 2015

How to get current location of mobile using any mobileno.It is possible using Asp.net?

View 1 Replies

Forms Data Controls :: Insert New Blank Rows In A Gridview And Insert Them In Database Multiple At A Time?

Oct 19, 2010

I have grid view in ASP.Net 3.5. I need to add multiple blank rows in a gridview and then have to save them in database. How can I do that in most simplest way?

View 7 Replies

Access :: Unable To Insert Data Into Access Database Using OLEDB

Sep 2, 2010

I have a form wilh couple of Drop downs and text boxes and a Data Grid View which displays data from Access Table. When I hit add button on the form, I can see the data being added to the Grid View. But when I close the form and open the Access Database File (.mdb), the respective table is empty. The Access Table is not being updated. Second time if I open the form, the Grid View is also empty.I am pasting my code here.

Public Class Home
Shared OleDbConnection As System.Data.OleDb.OleDbConnection
Shared ExpensesDataAdapter As System.Data.OleDb.OleDbDataAdapter [code]....

View 4 Replies

Forms Data Controls :: Enter Key Will Not Click The Form's Default Button On Mobile Browser, IE Mobile 5.0

Aug 10, 2010

I am developing a web based application for a Motorolla Mc 9090, it is a wireless barcode scanner running windows mobile 5.0.

The idea is to centralize the inventory in one database, by scanning items, serials, bins etc.

I have a set of pages each containg forms, where the user will have to scan an item, and automaticall the scanner has a carriege return (ENTER key) the idea was to have the user simply scan, and the page would automatically click the button posting to server for processing and then the server would reply.

For some reason i cannot get the focus() to work as well as the defaultbutton propperty of the form. There is also 1 more problem, the readOnly textboxes look the same as the non readOnly textboxes, even with the backcolor property changed.(guessing this is just MS)

View 3 Replies

DataSource Controls :: Unable To Simultaneously Insert Data Into DB By Two Or More Users

Aug 2, 2010

I wrote an ASP .NET database app, that store data in the database, for some reason, and i've tried all that I know, when two or more users submit info simultaneously, their data gets store wrong, i.e. the data gets mixed up.

View 8 Replies

Forms Data Controls :: Unable To Insert Some Html Code?

Jan 15, 2010

i want to insert some html code like

<html><body>jhguyegjh<?body></html>

but it is not inserting

View 2 Replies

Forms Data Controls :: Unable To Add New Rows Of Data To A Database Using The DataGrid Control?

Nov 7, 2010

check the VB behind code for any syntax errors.Unable to add new rows of data to a database using the DataGrid control.Compilation Error message is located at http://cforedu.com:View snap shot images of each line error at http://cforedu.com/snap.pdfThe VB code behind reads (revision 1.3):

[Code]....

View 6 Replies

Forms Data Controls :: Data Unable To Be Saved In Database When Placed In A Table

Feb 13, 2011

I got a table in a formview where i placed lots of textboxes and dropdownlists inside the table because I need these textboxes and dropdownlists on a background image.

the data on textboxes and dropdownlists that are inside the table is unable to be saved into the database when i pressed the "submit" button. Other textboxes and dropdownlists that are not inside the table work fine. Here are the HTML code for the table:

<asp:Table ID="Table1" runat="server" BackImageUrl="~/images/DRAWING.jpg">

View 9 Replies

Forms Data Controls :: Unable To Enter Data Into Database

Apr 30, 2010

unable to enter data into database

View 4 Replies

Forms Data Controls :: Check If Data Exist In Database BEFORE Insert New Item

Dec 3, 2010

I have a GridView on a page for maintainance of the database (mdf). Under this GridView1 I have a FormView1 where I use the ItemInsertTemplate to Insert new rows in my database (which shows the data in GridView1). The first textbox (BIDTextBox) i have on this template, contains text which identify a person. I would like to have a routine which checks if the same value that is entered in the BIDTextBox allready exists in the database. This routine should be fired upon leaving the control BIDTextBox.

I have tried with some stored procedure in my database, but that dosn't seem to do the trick. The most logical to me seems to do a loop thru my table "Ansatte" in my database using sql, selecting any occurence from the field "BID" in my table "Ansatte" that is simillar to the text entered in the BIDTextBox.

View 6 Replies

Forms Data Controls :: Insert Data Into Dyanamically Created Table From Database?

Aug 20, 2010

how can i insert data into dyanamically created table from database

View 2 Replies

Data Controls :: Insert Data From GridView Bound Using ViewState To Database Table

Jan 7, 2014

how to insert data in DB table from view state gridview ?

protected void Page_Load(object sender, EventArgs e)
       {
           if (!this.IsPostBack)
           {
               this.GetMaxId();
               this.GetPersons();
        
[code]...

View 1 Replies

Data Controls :: Loop And Insert Data Of All Sheets In Excel File To Database

Apr 23, 2014

I want to insert data in sql server from sheet within excelsheet ,there are three sheets in the file which i want to upload in three different tables,currently i am doing by selecting an individual sheet and the table to upload thus doing it three times for three sheets can i do it in one go,like passing all the sheets to a function or something like that or how can i do it in a better way and also i cannot directly upload sheet into table as i have to map one column of excel to different table of database to get its value like i need statecode but statename is provided in the sheet so i map statecode to statename in a staging table and then i upload the data...

View 1 Replies

Forms Data Controls :: Access Data That Is Outside A DataList And Insert It Into A Database?

Feb 2, 2010

I can't seem to access a label that is outside the DataList. I wish to add the data in the label into a database, aswell as data that is inside the datalist (this is already working though). My SQL-query with only the specific label looks like this at the moment:

[Code]....

The data is added to the database when pressing a button inside the datalist (using onItemCommand). If I write UserIDLabel.Text the regular way it doesn't work either. The label is in the MasterPage, while the datalist is in a .aspx-page. If it is possible to somehow access the data that is in this label and add it to the database I would be ever grateful. Or is it somehow possible to add data that is in a Session and add it to the database?

View 3 Replies

Forms Data Controls :: Insert Data On Click Event Into The Database

Oct 26, 2010

I want to insert data in to the database by click on button and input box appears.The data entered in input box must insert into the database site that can quickly descirbe me asp.net controls and advance properties , actuallly i had created lots sites in php. Now time for asp.net

View 4 Replies

Forms Data Controls :: Extracting Data From Gridview And Insert Into Database?

Nov 16, 2010

i'm currently doing a shopping website. The customer will have to selected the item they want to buy and it will appear in the detail view when they click add in the grid view. I need the info inside the detail view to be insert into a database call Orderlist.

i've try using INSERT INTO OrderList (ProductName, Price,) VALUES (@ProductName, @Price) but it don't seems to work.

Was it because i can't insert it like this as it is detailview? This method can work if is Textbox instead of detailview.

View 5 Replies

Forms Data Controls :: FormView Insert - Data Not Being Inserted In Database

Feb 9, 2010

I'm trying make FormView insert a new row into a database table via a stored procedure.My code runs without error but nothing appears in the database table.

View 14 Replies

Forms Data Controls :: Extracting Data From Gridview And Insert Into Sql Database?

Mar 30, 2011

i have a gridview of 8 columns.I need to extract the data row by row from the the first(Message) and the last(phone_no) column and to be inserted into my sql table named massMessage.I have the codes here. Apparently im able to only extract the phone_no. My message wasnt inserted.

protected void btnSave_Click(object sender, EventArgs e)
{
foreach (GridViewRow gvr in GridView2.Rows) //loop through GridView

[code]...

View 2 Replies

Data Controls :: Bulk Insert Data From GridView Rows Into Database?

Nov 14, 2013

i insert some data in textboxes and i click add button so data will go to gridview and click submit button then data will goto database.

View 1 Replies

Data Controls :: Insert Data From GridView To Database When Button In Particular Row Clicked

Jun 13, 2013

I am having one friend request form.In that,I have used grid view control to show all registered members,So one who want to send request he/she can send request.My form design code is:

 <asp:GridView ID="grdviewFriendRequest" runat="server" AllowPaging="true" AutoGenerateColumns="false"
EmptyDataText="No members found" Width="100%" Font-Size="16px" ForeColor="#FF9F00"
GridLines="None" PagerSettings-Mode="NumericFirstLast"
onselectedindexchanged="grdviewFriendRequest_SelectedIndexChanged">

[Code]....

it still gives me error, saying Input string not in a correct form.then I try to give commandArgument property,but still it gives me value 0;

<asp:TemplateField HeaderText="Send Friend Request">
<ItemTemplate>
<asp:Button ID="btnSendFrndReq" CssClass="btnImage" Text="Send Friend Request" runat="server" CommandName="SendFriendReq" CommandArgument="<%# Container.DataItemIndex %>" /></ItemTemplate>
</asp:TemplateField>

So,what I can do now?

View 1 Replies







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