|
I have enabled deleting with a DetailsView. In the view I am displaying all the fields in a table except the primary key (a GUID). I am having a hard time writing the DeleteCommand. Using the primary key in my WHERE clause would be easiest, but where can I get it?
Is there a way to select the key, but not display it, and retrieve it as a parameter for my DeleteCommand? Is there a better/preferred way to determine the row to delete?
Thanks
|
|
|
|
|
What about adding one column in DetailsView? you can hide that column..
|
|
|
|
|
Hi all, I'm using CrystalReport 10 in asp.net 2.0.
I need to develop an application where the final user can modify the the crystal designer at runtime. Can anyone tell me how can i do this?
|
|
|
|
|
Following is the expression , that represents the trimming of the string , which has the white space.
function LTrim( value )
{
var re = /\s*((\S+\s*)*)/;
return value.replace(re, "$1");
}
function RTrim( value )
{
var re = /((\s*\S+)*)\s*/;
return value.replace(re, "$1");
}
function trim( value )
{
return LTrim(RTrim(value));
}
and am unable to understand the meaning of the expression
/\s*((\S+\s*)*)/
Will somebody please make me understand
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
modified on Tuesday, January 01, 2008 6:38:17 AM
|
|
|
|
|
the first \s* leaves any number of blank spaces
the inner one (\S+\s) matches one more non space characters and a space.. for example.. "asm " or "a " etc.
And the outer ((\S+\s)*) matches any number of these words..
in short, this regex breaks a sentence into words..
for ex. " My Name Is ABC XYZ"
can be extracted as "My_", "Name_", "Is_", "ABC_"
XYZ isn't captured because it does not have a trailing space and so doesn't match (\S+\s)
Regards,
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
i was trying to figure out the solution of trimming.
i reached the following expression
function ltrim(s)<br />
{<br />
var temp = s;<br />
alert('hi');<br />
var obj = /^(\s*)([\W\w]*)/;<br />
if (obj.test(temp)) <br />
{<br />
temp = temp.replace(obj, '$2'); <br />
}<br />
return temp<br />
}<br />
<br />
function rtrim()<br />
{<br />
var temp = s;<br />
alert('hi');<br />
var obj = /^([\W\w]*)(\s*)$/;<br />
if (obj.test(temp)) <br />
{<br />
temp = temp.replace(obj, '$2'); <br />
}<br />
return temp<br />
}<br />
<br />
function trim(s)<br />
{<br />
return rtrim(ltrim(s));<br />
}
I think there is missing something.
One more thing , What is the difference between $1 and $2.
Please help
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
modified on Tuesday, January 01, 2008 8:07:19 AM
|
|
|
|
|
i have a better solution which i have verified as well on my many application try this.
i hope this will solve your problem
function TrimWhiteSpaces(s)
{
s=s.replace(/^\s+|\s+$/g, "");
var myArray=s.split(" ");
var outPut="";
for (var i=0;i&lt;myArray.length;i++)
{
if(myArray[i]!="")
{
outPut=outPut +" "+ myArray[i];
}
}
s=outPut;
return s;
}
wish you all the best
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
What's the problem in the following chunk of code (i don;t have any problem regarding Left Trim )
function rtrim(s)<br />
{<br />
var temp = s;<br />
var obj = /([\W\w]*)(\s*)$/;<br />
if (obj.test(temp)) <br />
{<br />
temp = temp.replace(obj, '$2'); <br />
}<br />
return temp<br />
}
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
modified on Wednesday, January 02, 2008 12:14:43 AM
|
|
|
|
|
Hi,
In my application I am using a function that is currently written in the app_code directory.
This function called GetRole() gets the role of the logged-in user from the database table.
The function is called from almost all of the pages and user controls in my application
both on Page Load as well as on the PostBack events such as the click of a button etc.
Now is it possible that I get the Users Role only once when the user launches the
application and store it across all pages in my application.
We are not allowed to use sessions. Any ideas would be appreciated.
Thanks in advance,
Aakar
|
|
|
|
|
You can store it in Cookies or Cache.
aakar wrote: We are not allowed to use sessions.
Why are you not allowed to use Sessions?
|
|
|
|
|
you can also use Profiling if you dont want to use session
Regards,
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
i m devloping web application. i want to encode to url. that means user cannot access any page directly by url.how to encode the url.
modified on Tuesday, January 01, 2008 5:39:28 AM
|
|
|
|
|
<%@ Page Language="C#" %>
<html>
<head>
<title>Encoding URL Strings</title>
<script runat="server">
void UrlPathEncode()
{
string StrToEncode;
string StrToReturn;
StrToEncode = "UrlPathEncode.aspx? Arg = foo";
StrToReturn = Server.UrlPathEncode(StrToEncode);
Response.Write("<a href=\"" + StrToReturn + "\">" + StrToReturn + "</a>");
}
</script>
</head>
<body>
<% UrlPathEncode(); %>
</body>
</html>
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
Encoding the URL and making the page not accessible by the user directly are different things. Do you want to do URL encryption? or How do you want the user to access indirectly?
|
|
|
|
|
hi,
i am new to javascript i want to know how to change the caption of alert or confirm message box
if any one knows then plz do let me know
regards
sindhu tiwari
its me sid
|
|
|
|
|
hi Sid,
there isn't any way to change dialog box captions for alert, prompt or confirm
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
hi usman
Happy new year ..Is there any way in which we can design our own message box in java script....? as per my RnD VB script has this option
regards
sindhu tiwari
its me sid
|
|
|
|
|
thanx for the new year wish same to you
sindhu i have not worked with VB Script so often i used to play with java script so i dont know its possible or not but in java scripts you can make your own alert look a like controls.
Regards,
Usman Munier
Xavor Corporation Pakistan
|
|
|
|
|
Hi,
i am creating one organizational chart control in whch i wann a add external link like hyperlink or any related to tht.plz suggest me how to add tht link in Rectangle.
|
|
|
|
|
You can overlay the hyperlink on the rectangle.... just use the absolute position and specify the left and top explicitly..
|
|
|
|
|
in hyperlink ther is no top or left property.and we can add hyperlink to some container bt here i wann a add in rectangle.if u have few line of code thn cn u plz send it to me.
|
|
|
|
|
Krupa wrote: in hyperlink ther is no top or left property
You have to use CSS for that.. For example : position:absolute; top:10px; left:10px
|
|
|
|
|
iam having a grid view iam filling the gridview with the text entered in the serverside textbox now i want the text entered in the textbox should convert into a sentence case that is first letter captial.
|
|
|
|
|
I think you need to the javascript to convert the first letter to captial letter on keypress event of textbox..
OR You may also try to use CSS (capitalize or first-letter) http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2370304[^] but I'm not so sure whether you can use it or not for your case. so, it's better if you can write the js function to covert the first letter..
|
|
|
|
|
Hi,
Here's what's going on:
*) User clicks on a location of the website, firing off a .NET function (in a .cs file)
*) This routine comes up with a particular database key that is used to link a related table to another one.
*) Next, take that key and re-populate a GridView with the information it found in the related table.
Problem is, the GridView doesn't post-back or refresh or whatever they call it (I'm traditionally straight Win32 C so this is rather frustrating!).
Here's the code that I'm using thus far. Any help would be appreciated. Thanks!
GridView rd = relPanel.FindControl("GridView1") as GridView;
if (rd != null)
{
SqlDataSource relatedDataSource = Page.FindControl("SqlDataSource1") as SqlDataSource;
if (relatedDataSource != null)
{
// This gives us the Site_ID that we need for our query.
// dtr["SITE_ID"].ToString()
// Our command
string myquery = String.Format("SELECT SITE_ID, PLANTTYPE, BARCODE, TIMESTAMP FROM Samples WHERE (SITE_ID = '{0}')", dtr["SITE_ID"].ToString());
SqlConnection myConnection = new SqlConnection(relatedDataSource.ConnectionString);
SqlDataAdapter ad = new SqlDataAdapter(myquery, myConnection);
DataSet myds = new DataSet();
ad.Fill(myds, "Samples");
rd.DataSourceID = null;
rd.DataSource = myds;
rd.DataBind();
|
|
|
|