|
I think there may be some mistake in your query. Please refer Trigger concept to implement your desired results.
|
|
|
|
|
If there's mistake in query then how come it runs when i remove the GridView1.SelectedValue from it. I just need to get the value of the first column in the grid view. For that I need help. Thanks.
|
|
|
|
|
protected void grid_category_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
clsclass comfun = new clsclass(); // your main class or
sqlcommand cmd;
Label val = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_id"));
comfun.ExecuteNonQuery("delete from evaluation_category where
evaluation_category_id=" + val.Text);
Label val1 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_1"));
Label val2 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_2"));
Label val2 = (Label)(your_grid.Rows[e.RowIndex].FindControl("lbl_3"));
cmd.executeNonQuery("insert into table values('"+ val1.text +','' + val2.text
+'',''+ val3.text+'")
// or done this query in storedprocedure
// or both query can be done in same procedure
// first remove value from first table then send thia to next one simple
FillGrid(); // bind your grid
}
Try this.
|
|
|
|
|
I tried your code and it's giving the following error
Object reference not set to an instance of an object.
It's coming in the line where I am using "val.text" in the insert statement.
|
|
|
|
|
Guys please help with putting GridView Value to a Label Text and my problem will be resolved.
Thanks
|
|
|
|
|
i m working with C#.net and at the back end access database
i have four tables in my database
category
Images
employee
&
empinfo
the first three tables above have the primary keys made foriegn keys in the table of empinfo
now i need a code in C#.net
how to store all the information in the tables of "category", "Images" and "employee" and finally in the table of "empinfo"
new to C#.net programming
plzzzzz can anyone help????
|
|
|
|
|
I would like to say one thing, make sure to put all insert statement in signle transaction.
It is mean firt do the Bigin Transaction
Update/Insert first table
......
Commit transaction
If anywhere exception occured then do the Rollback transaction.
Note: Insert or Update query you can find on google.
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
I want to create a website about live video chat so how can i get video of webcam and audio in webpage..
Please show me any idea any 1 have...
Thanks in advance....
|
|
|
|
|
ASP.Net does not provide any way to do this.
And I am sure that this is not that easy to implement on your own untill and unless you have a ready component available which youn can directly use.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
ya i knw dat no direct control avilable but den how cn i do it else way ??
Wat abt activeX control ??
i dont knw hw to embedd activeX control in webpage ???
|
|
|
|
|
Check this[^]
and also
this.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Hello,
I'm looking for a web picture lupe (for a detailed view), but I can not find.
Is there someone an idea??
Benny
|
|
|
|
|
Try these[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi everyone! I have a sitemap.xml that contains my links to the various sub pages. What I would like to do is have the system change the color of some of the titles so they stick out when new content is released. I've tried simply adding <code><span style="font-color:red">(new!)</span></code> in the xml file but that always bombs out. Can this be done? The only other way I could think of pulling it off would be dynamically checking all of the sitemap nodes for "(new!)" somewhere in the title and then adding the span block while the page is loading.
Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
If anyone runs into this, I figured out how to pull it off using the ItemDataBound event.
protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
{
if (e.Item.Text.Contains("(NEW!)"))
{
e.Item.Text = e.Item.Text.Replace("(NEW!)","<span style=\"color:red\">(NEW!)</span>");
}
}
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
Hi guys,
I have a small problem, hope u could help me !
I'm tryin to use a custom validator on a Textbox !
Look :
<asp:textbox id="TextBox2" runat="server" visible="True" validationgroup="Test_Custom">
<asp:customvalidator id="first_CV" runat="server" onservervalidate="first_CV_ServerValidate" controltovalidate="TextBox2" errormessage="Complete this field" validationgroup="Test_Custom">*
The code behind now
protected void first_CV_ServerValidate(object source, ServerValidateEventArgs args)
{
if (TextBox2.Text == "")
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
Nothing changes if I set the ValidateEmptyText property of the CustomValidator CustomValidator to true.
Basically, I hoped to see a message when the Textbox is empty!
But nothin happen when Click on my submit button
Please help me
|
|
|
|
|
Why not use the RequiredFieldValidator [^]instead.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
REquiredFieldValidator is not appropriated cuze I try use the control on a TextBox with a visible mode is False in this case the RequiredFieldValidator doesn't work.
Help me about the custom validator, I think it's the only solution.
|
|
|
|
|
Why do you want a custom validator even?
You can just check the value of textbox before your processing begins and if its empty just display error message (whatever you want).
For example on button click event you can check the value of textbox and avoid further action if its empty.
HTH
|
|
|
|
|
I've run into this issue before as well where I had a textbox hidden and the requiredfield validator would mess the form up. I'm not sure what it is exactly you are attempting to pull off, but I've found it easier in some cases to just build the controls instead of hiding. For example, if you are hiding a textbox until someone clicks a button and then showing it, try this instead and then attach the required field validator to it....
TextBox tb1 = new TextBox();
RequiredFieldValidator re1 = new RequiredFieldValidator();
re1.ControltoValidate = tb1.ID;
divControl.Controls.add(tb1);
The above code needs some tweaking..but should give you the idea. The validator won't screw up the form because the textbox doesn't even exist until you place it as a new control.
That, or I've personally become quite fond of using javascript to validate forms...
var namebox = document.getElementById('<%= Name_textbox.ClientID %>');
if (namebox.value == ''){
var message = "We seem to be missing some information. Please correct the following items before submitting:\n\n";
if (namebox.value == '') {
message += "Name box cannot be blank.\n";
namebox.style.backgroundColor = 'yellow';
}
hopefully this helps! good luck
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
Thanks compninja25 for helping,
Can u even tell me which language U R using here, is dat ...?
|
|
|
|
|
Oh sorry. The top part is c#, and the bottom code block is javascript.
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
I have a listview that works fine but I would like to improve the appearance. Using codebehind, I insert textboxes into each listview cell. The cells are different colors. The space between the cells has gaps in the colors. Although the cells are grey, the space between two cells is white. I have tried tweaking borderstyle and bordercolor of the textbox but nothing changes.
I believe that my problem is caused by css. I took my html and browsed without the css file and things look different, so I will try to figure out what puts the gaps in.
But I would still like an answer for my amount fields.
I would also like a way to right align the currency fields within these textboxes. I can't get this to work well either.
Here is a portion of my code. I have bitmap image of the app but I can't insert this into my post.
Dim txtBox As New System.Web.UI.WebControls.TextBox
With txtBox
.BorderStyle = BorderStyle.None
.ReadOnly = True
.Text = " "
.BackColor = Drawing.Color.LightGray
.BorderColor = Drawing.Color.LightGray
End With
oRow.Cells(iCol).Control = txtBox
oRow.Cells(iCol).Control.Width = Unit.Percentage(100)
oRow.Cells(0).Control.BorderStyle = BorderStyle.None
The answer was found in this site.
.Style("TEXT-ALIGN") = TextAlign.Right.ToString()
I am not sure why there is a need for TEXT-ALIGN as well as ALIGN but my pages look much better now. The thing that I forgot is that webform controls are merely an aid to creating HTML. I need to understand the underlying HTML to make my site pleasing to the eye.
I appreciate any help on these issues.
modified on Monday, August 31, 2009 11:35 AM
|
|
|
|
|
i've set the property of edit in data gridview control..but why it is not working???The fields in my data gridview are databound....Any particular property i am missing?????????
|
|
|
|
|
How it is possible to find what you have missed without your coding
|
|
|
|