.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to show 0 as first number in column

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Hi guys. I have two little problem.

I have database with one table and it has 4 rows.

1. I want to show a zero in front of all number. Actually i added but it doesn't show.

2. If i don't put any value in column is it possible to have minus for example instead of 0?




I post it like that because i can't see how to post pics directly.

P.S. The columns with numbers have checked "allow nulls".

I draw in paint so it's not so good but i think it's understandable.

10x in advance.

View Complete Post

More Related Resource Links

SQLCE table column DefaultValues don't show up in XSD Dataset designer

Using Visual Studio 2008 with SQL CE 3.5, I notice that default values in the creation scripts for the database tables are not reflected in the dataset designer XSD file.  For example, the following SQL script creates the non-nullable table column names "Content" with a default value of 'Image':    "Content" nchar(20) NOT NULL DEFAULT 'Image',But in the column properties of the dataset designer (XSD) panel, this column correctly shows up as non-nullable, but with a DBnull default value as follows:     Name: Content    Allow DBnull: False    DefaultValue: <DBnull>Am I missing something somewhere, or is this a VS bug?  Also, how do I get the XSD file to regenerate after schema changes in the database?  Sqlmetal doesn't do it.Thanks,    -BGood

proper format for number column

Hi  In a column i have number datatype but after filling some no it's giving like that 23,786,23 (mostly like a currency format ) but i need like that 2378623 so give me suggestion how i can implement this in sharepoint 2010 , is there need to bound some column level validation for that ............... 

How to tell repeater to wrap text after certain number of characters for a particular column ?

I have a column in my repeater which allows as many as 255 characters and causes the page contents pushed away to the right if any of the record has all 255 characters in that column. How can I tell it to wrap the text after 50 characters ?Thanks,

Wierd case of: Msg 213, Column name or number of supplied values does not match table definition

Hi, I'm working on several triggers (that happen after insert or update) in order to log the changes in a different table. They all follow a similar syntax and are working fine, except for this one... I've reduced the next code to the minimum that gives an error, so we can safely assume the other parts of the trigger are working fine. INSERT INTO [Adt].[WardUnitStayLog] SELECT t.* FROM [Adt].[WardUnitStay] t INNER JOIN inserted i ON i.[Id] = t.[Id]; I've used this same syntax (but on different tables) in other triggers, and these are working perfectly fine. The above query provides the next error: Column name or number of supplied values does not match table definition. I've checked both tables for differences in the columns, but to no avail... (I've checked them manually and by outerjoining the information_schema.columns) (I've also checked the order in wich these columns are defined, they match over the two tables) These are the creation scripts for the tables: CREATE TABLE [Adt].[WardUnitStay] ( [Id] [dbo].[Id] IDENTITY(1,1) NOT NULL, [UnifiedUnitStayId] [dbo].[Id] NOT NULL, [WardCd] [dbo].[Cd] NOT NULL, [_FirstAtTm] [dbo].[Dtm] NOT NULL, [_IsReservation] BIT NOT NULL, [_LastAtTm] [dbo].[Dtm] NOT NULL, [_LastBedCd] [dbo].[Cd] NULL, [_LastPhysicianUid]

How to know the number of columns displayed on the last page for Multi column table

Hi, How will I determine how many columns to be displayed on the last page of the report if I am using a Multiple column table.  I am going to use the number of columns to multiply with the width of the body of the report. I am going to use a Function to get the product. 

How to delete number in primary key column

Hi, BurnbetDataContext nwContext = new BurnbetDataContext(); var db = new BurnbetDataContext(); var personPets = from p in db.tbl_Payments where p.ID == 1 select p.ID; db.tbl_Payments.DeleteAllOnSubmit(personPets); This code does not work because the primary key ID.What should I do so I can delete the ID = 1?

Currency and number column error with office 2007 document formats in SharePoint 2010 library

Hi there,



The following error occurred within a SharePoint 2010 document library:

As I tried to test out the new SharePoint 2010 environment I changed the metadata from a few documents within a document library. I noticed that the data from the currency und number field was incorrect from a few documents. The numbers looked like that the decimal separator were ignored. For an example: 123.456,78 was saved as 12.345.678.

At first I thought it could be a language incompabilty but if that would be the case: Why would there be other documents which show the correct number?


I created another document library to recreate this error. And there I noticed the real reason: Every time I changed these fields from a document which was saved in the office 2007 format the error occurred. The metadata from the documents in the office 2003 format were correct.


Has anyone a similar problem or got an idea how to solve this problem?


System Specs:

Frontend: Windows Server 2008 SP2 ent

Storing IP number in a column in db but which column type to use?


I want to store IP number in a column in db but which column type should I use? Of course I can use string but isn't this a waste of storage space? Can I not store IP nr in another type in db that saves space?

How do I get a new column I created to show-up in the DisplayForm.aspx page?

Here's a little introduction to how I got here:

Downloaded the WSS Help Desk application template and installed it and now my company wants to add a column to the ServiceRequests list called "Service Request Type".  So I created a new column and made it a choice of "Incident" or "Change".  I then customized the EditForm.aspx and NewForm.aspx to provide the new entry.  Other than losing the ability to attach documents the forms are working perfectly and collecting the data.  My problem is that when I open the DisplayForm.aspx and attempt to add a new row and use the <xsl:value-of select="@SRType" /> I don't see any values displayed.  Also, I can browse  the Data Source Library and click on Service Requests > Show Data and see the new list item but when I choose the button for "Insert Selected Fields as...", the Item is greyed-out.  

Tried manually inserting code based-on similiar entries but still no luck.  Here's what I have so far:

      <td width="190px" valign="top" class="ms-formlabel">
         <H3 class="ms-standardheader">
           <nobr>Service Request Type</nobr>
      <td width="400px" valign="top" class="ms-formbody"><

extracting last four characters of a text column and storing it in a number column



is there a way to do the above, for example...I have a text column, Column A containing "172671-08-7892", I need 7892 to be extracted to another column of the type number, from there I need to divide by 2. If the remainder is 0, Column C will be updated as Female, if the remainde is 1, Column C will be updated as Male

Gridview: How to create a column that will autogenerate the serial number of each row


Hi all,

I have a gridview and I want to autopopulate the serial number columns. For eg, the gridview has 10 rows. The user deleted the first row. I want the gridview serial number to automatically shift down by one. Ie., 10-->9, 9-->8 and so on.

Can this be done? Any help is much appreciated!

How programmatically change Additional Column Settings - Show field?


Hello. I use the SPFieldUser in my list. I can change Additional Column Settings - Show field: "Name with Presense" on the "Name (with Picture and details)" using the WSS Web interface. How do it programmatically, using Object Model WSS?

Default Column Values in a Document Library (SP2010) do not show up in word 2010 until you save and


when you create a document in a SP 2010 document library (of a particular content type, by clicking new, letter (content type name) in sharepoint for example) which has default values set on in in the library (set by using library settings -> change default column values), the default values do not show up until you create the document , save it and reopen it again.  Is this a bug or by design.  If it is by design, it is horrible since if some of the column default values are mandatory in the content type then you actually have to type them in before you could possibly save the file which defeats the whole point of having default column values.  Also it is tremendously clunky for a user to have to create file, save it , close it, and reopen it just to view the default metadata in the document information panel that is supposed to be there.

Anyone have any thoughts/solutions to this problem?


Column to show count of attachments uploaded for each List item in MOSS 2007


We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

Column name in table starting with number



I'm facing a problem due to a column in table, which has name starting with number '30DDefProb'

so, when I try select query with some condition with that column, it gives me an error,

select top 5 * from Margin.tTrade

New column issue - Error number: MSSQL_REPL-2147199478



In merge replication we have following issue which appears from time to time in few subscriptions.

When I added new column to table by using following procedure:


sp_repladdcolumn @source_object = N'TABLE_NAME'

,@column = N'NEW_COLUMN_NAME'

, @typetext =N'tinyint null'  

, @publication_to_add = N'PUBLICATION_NAME'

, @from_agent = 0

, @schema_change_script = null

, @force_invalidate_snapshot = 0 

, @force_reinit_subscription = 0


replication for few subscriptions gets following error:

The schema definition of the destination table 'dbo'.'TABLE_NAME' in the subscription database does not match the schema definition of the source table in the publication database. Reinitialize the subscription without a snapshot

How to add a row number column base on duplicated records that currently been ordered.



I want to insert a page_number in a record that continuously count base on duplicate in a column. example output:

1     7    1 
2     7    1 
3     7    1 
4     7    1 
5  7    1 
6  10    2 
7  10    2 
8  10    2 
9  10    2 
10  10    2 
11  13    3 
12  13    3 
13  13    3 
14  13    3 
15  13    3 
16  9    4 
17  9    4 
18  9    4 
19  9    4 
20  9    4 
21  16    5 
22  16    5 
23  16    5 
24  16    5 
25  16    5 
26  11    6 
27  11    6 
28  11    6 
29  11    6 
30  11    6 
31  12    7 
32  12    7 
33  12    7 
34  12    7 
35  12    7 
36  4    8 
37  4    8 
38  4    8 
39  4    8 
40  4    8 
41  5    9 
42  5    9 
43  5    9 
44  5    9 
45  5    9 
46  14    10 
47  14    10 
48  14    10
49  14    10
50  14    10
51  15    11 
52  15    11 
53  15    11 
54  15    11 
55  15    11 
56  6    12 
57  6    12 
58  6    12 
59  6    12 
60  6    12 
61  1    13 
62  1    13 
63  1    13 
64  1    13 
65  1    13 
66  2    14 
67  2    14 
68  2    14 
69  2    14 
70  2    14 
71  8    15 
72  8    15 
73  8    15 
74  8    15 
75  8    15 
76  3    16 
77  3    16 
78  3    16 
79  3    16 
80  3    16

How can I add the page_number column just like

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend