|
Hi All,
I need to delete rows of girdview depending upon the checkbox checked unchecked.I mean if Checkbox is checked then delete only those rows but its should only delete from gridview not from Database.
Can anyone suggest me with some code.
Thanks in advance...
|
|
|
|
|
I think one way could be that you store the complete table in viewstate and delete it and rebind it from there (viewstate) only.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurva,I will try this method if any problem I will again post message.Thanks again...
|
|
|
|
|
sure...
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi all
i am trying to search specific text and replace it with new data in a text file through C#...
|
|
|
|
|
The easiest way is to open the file, read the contents, do your processing, and save it again.
http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
For this, you need to know 3 things.
1. How to read a text file.
2. How to replace a string with a new string
3. How to write a text file.
Steps: 1. Read text file and get all the content in a string variable let's say str.
2. Replace the specific text from the string's value, so that the string should represent the new data that you want in the textfile. You can use str = String.Replace("Old String","New String");
3. Write the string variable's value into the text file.
The following link explains how to read data from a text file and how to write data into a text file:
http://www.freedotnetapps.com/asp-net/how-to-read-data-from-and-write-data-to-text-file-in-asp-net
|
|
|
|
|
Dear Gurus
How to send /recieve mails in INtranet without using exchange server.
We are using SMTP server for sending mails. and how to recieve mail without POP3 account. Please note that this is just for local domain. Not for external (yahoo etc).
Please advice.
thanks
Lee
Leya
|
|
|
|
|
You cannot send or receive emails without a SMTP and POP3 server (well you can, but then you need to replace them with another protocol/server, such as IMAP).
You could get around not using your networks' exchange server by using other SMTP and POP3 servers, but you will need some servers somewhere where you can access from within your network.
|
|
|
|
|
Hi to All,
I want to check Null Values in DropDownList Using Javascript.
Or
How to Get values of Html server controls values in Javascript
Mohan Balal
|
|
|
|
|
function getVal()
{
//ddl1 is asp:DropDownList
var a = document.getElementById('<%=ddl1.ClientID%>');
alert(a[0].text);//Text shown to user
// alert(a[0].value);//Index
}
"If our Mind can, the Program can !!"
|
|
|
|
|
var a = document.getElementById('<%=ddl1.ClientID%>');
in the above code ClientID Means ?????????????????
Mohan Balal
|
|
|
|
|
Hi,
I have written a javascript function and this function is being called in the
In the function iam checking out few things like finding the length of the listbox i.e. form1.listbox1.length, this particualr list box is in a panel and the panel initial setting is visible false.
Now when the page is being loaded if the form does not contain the list box the javascript function is throwing an error. like - object null or undefined
How to avoid this errror???
Gautham
|
|
|
|
|
Write a javascript code for checking the list box is present or not
ie Frist check the object is not null then do the things
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Sandeep,
I tried something like this form1.listbox1.length!=null)
but same error!!!
how to check whether a particular control exists on the form using javascript
Gautham
|
|
|
|
|
Gautham ,
As listBox is null how can you call lenght property
try this
var control = document.getElementById("SomeID");
if(control==null)
{
alert(control);
alert("Not exist");
}
only check the control not its any property
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
|
I've had trouble like this before. I think it has to do with where you are putting the javascript. If your javascript is at the end of the html, than when the <body> tag is rendered it hasn't rendered the function yet so it doesn't know where it is. Try putting the javascript in a <script> block that is above the <body> tag. Since this is in the removed property I think that is all you should have to do. If it were in the onload property then you might have trouble getting it to work because when it runs the javascript and tries to find the length of the listbox you could get an error because it hasn't rendered the listbox yet.
The only other thing I noticed is that you don't have a ; after the fun1() But that isn't a big problem.
I hope this helps.
|
|
|
|
|
i need the name of the montt like march not 3
wat code i need to use in c#
Suresh.R
|
|
|
|
|
|
Never worked for it but one idea is if dateTIme object method does not return any string then
declare string array like
string[] str ={ "January", "February", "March", "April" };
now
you can get month by simply
str[DateTime.Now.Month-1];
-1 is important
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Today.Month)
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hi,
I don't have much experience with script languages, but since i have this problem for long time and i still didn't solve it, i think that script language can be solution. I am using JavaScript language.
My problem is next: I have data in mssql 2005 database, one field is picture, one field is description (some text) and one field is some text that contain some links. My goal is to present data to asp.net page in next manner: first from left is picture and right from picture goes description and right from description goes text with links. And next row goes bellow and that is goal.
Problem arise when i have a lot of data in database and i should present that data to asp.net page, because it is not normal to present 500 rows of data on one asp.net page.
So my question is: How do i break data from sql database to be presented on multiple asp.net pages ? For example at the bottom of page there are numbers that are links to pages that contain data from database that didn't fit one previous pages.
Please help, i have this problem for very long time,
best regards
Dragoslav Zaric
MCAD, M. Sc. of Astrophysics
|
|
|
|
|
You can use GridView Control to show those records.
and use allowpaging=true of Gridcontrol .
also you can use mode property in page to definie page settings numbers or first next last etc
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
hi guys below is the code i have in a button that i am trying to make it create a new record in the targeted table
so far it keep givin me this error
Incorrect syntax near 'Name'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'Name'.
string cs = WebConfigurationManager.ConnectionStrings["HASDBConnectionString1"].ConnectionString;<br />
string insertbidder = "INSERT Bidder " + "(NRIC, First Name, Last Name, "<br />
+ "Company, Address, ContactNumber, Comments)"<br />
+ "VALUES(@NRIC, @First_Name, @Last_Name, @Company, @Address, @ContactNumber, @Comment)";<br />
<br />
SqlConnection con = new SqlConnection(cs);<br />
SqlCommand cmd = new SqlCommand(insertbidder, con);<br />
<br />
<br />
cmd.Parameters.AddWithValue("NRIC",txtnric.Text);<br />
cmd.Parameters.AddWithValue("First_Name",txtFirstname.Text);<br />
cmd.Parameters.AddWithValue("Last_Name", txtlastname.Text);<br />
cmd.Parameters.AddWithValue("Company",txtcompany.Text);<br />
cmd.Parameters.AddWithValue("Address",txtaddress.Text);<br />
cmd.Parameters.AddWithValue("ContactNumber", txtcontactnumber.Text);<br />
cmd.Parameters.AddWithValue("Comment", txtcomment.Text);<br />
con.Open();<br />
cmd.ExecuteNonQuery();
|
|
|
|