|
Hi friend please can you tell me how to solve this problem.When i try to create new role is appear this exception?
"
Cannot insert the value NULL into column 'RoleId', table 'C:\WEB-PROJECT\02.12.2007\APP_DATA\IVOIRENETPUB.MDF.dbo.aspnet_Roles'; column does not allow nulls. INSERT fails.
"
Even if i use asp.net configuration!!!
Good bye
-- modified at 2:46 Thursday 15th February, 2007
when i want to read something good just seat and type it
|
|
|
|
|
Then.. RoleID might be primary key or identity which is not allowed to add NULL value.
if you wanna add it then you may change your database design.
if I'm in wrong direction then you can show me your current table design.
|
|
|
|
|
hi again
the table is create automaticly by visual studio when you use asp.net configuration that is way i don't change nothing but has you see is appear some exception!Did you have idea how to solve the problem.
GO
/****** Object: Table [dbo].[aspnet_Roles] Script Date: 02/15/2007 21:55:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[aspnet_Roles](
[ApplicationId] [uniqueidentifier] NOT NULL,
[RoleId] [uniqueidentifier] NOT NULL,
[RoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LoweredRoleName] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
when i want to read something good just seat and type it
|
|
|
|
|
Check it out here.. >> [RoleId] [uniqueidentifier] NOT NULL,
that means this column doesn't accept any NULL value.
Why do you want to add NULL value?
it will work if you don;t add any NULL value to this column..
However, in case you have to add NULL value then... you can remove "NOT NULL" from this statement..
|
|
|
|
|
Thank's i will try it but i am not sure that is correct because if i made change after that is possible other function to don't work.((
when i want to read something good just seat and type it
|
|
|
|
|
It can't be null because is connected with user
when i want to read something good just seat and type it
|
|
|
|
|
>>Thank's i will try it
Your welcome. my friend.
>>but i am not sure that is correct because if i made change after that is possible other function to don't work.((
ya. it might be possible.. I'd suggest you that better if you add a values for that column instead of adding NULL value.
|
|
|
|
|
The problem is that ms create all this table for you automaticly with lot of code and i want to use that code.If i change db after i must change code in all application and believe that is lot of work i think something is not right with my db but what ?Even that thank you for your answare
when i want to read something good just seat and type it
|
|
|
|
|
I need to find the HTML comment using regular expression. I tried this expression (? . but this is not suitable to find multiline comment (that is newline).
Please help anyone to find this HTML comment using regex.
Thanks in Advance.
Regards
R.Arockiapathinathan
|
|
|
|
|
try this:
it will find all HTML comments within the source.
greetings
walter
|
|
|
|
|
Fantastic and million thanks to you.
It works fine.
Regards
R.Arockiapathinathan
|
|
|
|
|
Hi All,
Can anyone tell me how do I create tab control in ASP.NET 2.0.I cant see tab control directly in toolbox.I am using VB as code behind language.
Please help me at the earliest.
Thanks in advance...
|
|
|
|
|
|
Thanks for the reply.
I got this link but I need the text instead of Image and also I cant see the tab control as show in that page.
Finally on click event the text fields changes to another field.I mean when I click any of the field name then it changes.
Please help me...
|
|
|
|
|
|
|
I have a gridview in which in every row i have a button .When i click that
button i want to perform some task.This button is in third column the second column has the name of the file . i want that name of that file which is there in that row. Actually i want to know what is the event and how to capture it .
thanks
|
|
|
|
|
U can capture Row Command event for the same.
|
|
|
|
|
can you help me out with the code.
thanks
|
|
|
|
|
Tyr this:
Protected Sub grdCommunicationDetailsView_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles grdCommunicationDetailsView.RowCommand
Try
gridROW = CType(CType(e.CommandSource, Control).NamingContainer, GridViewRow)
ml_lngCommunicationID = CInt(grdCommunicationDetailsView.DataKeys(gridROW.RowIndex).Value)
htxtCommunicationID.Value = ml_lngCommunicationID
Select Case e.CommandName
Case "DeleteTrans"
objTAXCommunicationDetails = New CTAXCommunicationDetails
With objTAXCommunicationDetails
.FormId = msForm_TYPE.msForm_TAXCOMMUNICATIONDETAILS
.CommunicationID = ml_lngCommunicationID
.UserId = Session("UserId")
.Delete()
End With
strMessage = "Record Deleted Successfully...!"
RefreshGridView()
End Select
Catch ex As Exception
End Try
End Sub
<asp:GridView>
<Columns>
<asp:TemplateField HeaderStyle-CssClass="heading" HeaderText="Delete">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
<ItemTemplate>
<asp:ImageButton ID="Delete" runat="server" CommandName="DeleteTrans" ImageUrl="../Images/delete.gif" CssClass="cursor"
ToolTip="Delete" />
</ItemTemplate>
<HeaderStyle Width="60px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
Any problem let me know.
|
|
|
|
|
hi ritu
try this code:-
Set commandname and CommandArgument property of Button
<asp:Button ID="BT" runat="server" Text="Button" CommandName="Botton" CommandArgument='<%# Eval("fileid") %>'/>
protected void GV_items_RowCommand(object sender, GridViewCommandEventArgs e)
{
string fileid = Convert.ToString(e.CommandArgument);
//By this code u will get ur fileid
}
pathan
|
|
|
|
|
we cannot take button in gridview in this way. IT gives error .
Error 1 System.Web.UI.WebControls.DataControlFieldCollection must have items of type 'System.Web.UI.WebControls.DataControlField'.'asp:Button' is of type 'System.Web.UI.WebControls.Button'.
|
|
|
|
|
Try the code which I gave as I am doing this only and its working in my Project. The only difference is that I am using image button and u r using button.
|
|
|
|
|
Hi ritu
u can take server bottun between <ItemTemplate> tag.
i give u whole code how to take a button
now try this code
<asp:GridView ID="GV_cart" runat="server" AutoGenerateColumns="False"
OnRowCommand="GV_cart_RowCommand" CellPadding="4" ForeColor="#333333">
<Columns>
<asp:BoundField DataField="fileid" HeaderText="File Id" />
<asp:BoundField DataField="Filename" HeaderText="File Name" />
<asp:TemplateField>
<HeaderTemplate>File id</HeaderTemplate>
<ItemTemplate>
<asp:Button ID="BT" runat="server" CommandName="button" CommandArgument='<%#Eval("fileid") %>' Text="Button" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
After this write code on Row_command event
if (e.CommandName == "button")
{
string fileid= e.CommandArgument.ToString();
}
if u use more than one button than this code may be useful for checking which button evet fires by commandname condition.
Pathan
|
|
|
|
|
thanks . had worked .thanks to varsha mane too.
|
|
|
|