|
NEVER EVER do this. The Char.IsDigit, etc methods are there for a reason.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ravenet wrote: very easy man
when you press key , just check ur keypressEventArhs e value.
e.keycode==47----->57
same like other character ascii value also.
Please don't do this as this is really bad practice - you're limiting yourself to targeting ASCII here, plus you have to take care of both Upper and Lower case characters. .NET provides things like Char.IsLetter for a reason.
|
|
|
|
|
OK thanks Pete O'Hanlon
but bascially i gave idea to that guy.
|
|
|
|
|
Yup, it was an idea - the wrong idea, and taught him bad practice to boot.
kudos.
|
|
|
|
|
hey man
that not wrong idea ok, but Peter said better than my idea.
DONT SAY WRONG.
thanks
|
|
|
|
|
<asp:imagebutton id="ImageButton1" runat="server" imageurl="<%# Eval(" filename=")">' PostBackUrl='<%# Eval("no" , "~/Tracts.aspx?no={0}") %>' />
how to get no.if u know code replay to me..
|
|
|
|
|
Hard to make sense of what you're after here. Do you mean how do you format the string ? string.Format(" "~/Tracts.aspx?no={0}", Eval("no")) seems like a likely candidate.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
i do ur code in pageload event but above error is occure.any code..
|
|
|
|
|
Correct. So, if he's not using a databound control, and placing an image inside it, then the question would be kind of pointless, I expect.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
<columns> <asp:templatefield>
<itemtemplate>
<asp:imagebutton id="Image1" runat="server" imageurl="">]]>' CommandArgument='<%# Eval("no")%>' PostBackUrl='<%# Eval("no" , "~/Default2.aspx?no={0}=") %>' Width="150px"/>
]]>
<itemtemplate>
i set Databinder inside imageButton but how to get no in Default2.aspx page.
h = string.Format("~/Default2.aspx?no={0}", Eval("no"));
where it is write Default.aspx or Default2.aspx.
|
|
|
|
|
putting it on the URL is going to do it. Perhaps if you could explain exactly what the issue is here, are you not getting the right URL ?
sugunavathy wrote: where it is write Default.aspx or Default2.aspx.
Well, default2.aspx would be a bit late, wouldn't it ? I am saying that if what you're saying is that your Eval statement does not work, doing a string.Format in it's place should work, IMO. But, again, I am guessing, because you're not really telling us what is going wrong.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi very thanks to replay to me.
<asp:imagebutton id="ImageButton1" runat="server" imageurl="<%# Eval(" filename=")">' PostBackUrl='<%# Eval("no" , "~/Tracts.aspx?no={0}") %>' />
this code is default.aspx page coding.
this page is transfer to Tracts.aspx page.but how to get no in Tracts.aspx page.
|
|
|
|
|
Does somebody know how to block the execting of sql server .Problem is if somebody authenticates window password , then it becomes very easy for someone to make ammendments in the database .
Or somebody may be having any registry tips to edit the registry for sql server 2000 exe to block it's executing.
I meant when i click the sql server 2000 tab in the program files , i should get the message , the administrator has blocked the program to execute.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
I seriously doubt this has anything to do with C#. In the first place, my mind boggles as to why somebody would want to do this.
Sonia Gupta wrote: Problem is if somebody authenticates window password , then it becomes very easy for someone to make ammendments in the database .
That's what the password is there for.
You could try restricting folder rights, I suppose....
Cheers,
Vikram.
"The weak can never forgive. Forgiveness is the attribute of the strong." - Mahatma Gandhi.
|
|
|
|
|
So, set up your database on a machine that general users do not have access to, and don't used mixed mode authentication.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sql dont have securities, anyone, who have knowledge about sql can do changes in databases.
i have already tried to set password on my database, but there wasnt anything like this, we can just make users then assign passwords but if someone uses Windows Authentcation then that person can do whatever wants
Becoming Programmer...
|
|
|
|
|
SQL Server databases are secure, if they are set up correctly. If she has a critical database running off her bosses work PC, then she has an issue, but the issue is not SQL Server, but the design of the deployment.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what, secure....!!! there isnt anything about security in sql.
e.g. i developed an application that uses the sql server, and if i installed it on another pc with sql server(Management Studio) then i can do changes in databases even i have already using an user account on developing pc
so how can you say that its secure, and what type of setup you are talking about?
Becoming Programmer...
|
|
|
|
|
xmen wrote: and if i installed it on another pc with sql server(Management Studio) then i can do changes in databases even i have already using an user account on developing pc
I think no one is getting what you are talking about. You need to look into the BOL for getting an idea about SQL server security. Saying "there is not anything about security in SQL server" is stupidity. Check this[^] MSDN article which explains security features present in SQL server.
|
|
|
|
|
xmen wrote: so how can you say that its secure, and what type of setup you are talking about?
It's obvious that you haven't got the first clue how SQL Server works so I suggest that you read a book or two on securing and deploying SQL Server. I would also recommend that it's of a level beyond the Idiots Guide to Sql Server.
|
|
|
|
|
oh wow, but where were you people when i asked that same question before, that time everyone said that make an user account n secure your database, i tried but found nothing to be secure, read on sites, searched on google but everywhere same answer
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
seems to be helpful
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Monday, February 18, 2008 5:12 AM
|
|
|
|
|
SQL server runs as Windows services. Make sure that the services run manually rather than automatically. To prevent users from starting the SQL server services, deny them Windows Administrative rights; that way, they can start or stop services.
NB. From your question, it would seem that SQL server is installed on a user machine ; my solution only makes sense in that context.
|
|
|
|
|
Hi all,
Iam doing nested data grid operations iam facing a problem in that please help me on this
I have a gridview controls in asp.net page which is fetching data from data base then
RowDataBound of that data grid iam creating gridview dynamically i.e
means if there is 3 records in main gridview its creating 3 child gridview which has few data
i want to access the data of the child grid views but i can access only the last child grid views
data not all the child grid view data.i have attached my code here plase have a look on it.
protected void GridView_RowDataBound1(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.EmptyDataRow)
{
id++;
Int64 catId =Convert.ToInt64(e.Row.Cells[1].Text.ToString());
ds = new DataSet();
ds = objExitInterviewBLL.getQuestions(0, 'S', "", catId);
int count = 0;
if (ds.Tables[0].Rows.Count > 0)
{
NewDg = new GridView();
//NewDg= new GridView();
NewDg.ID = "NewDg" + id ;
txtHidden.Text = txtHidden.Text + "," + NewDg.ID;
NewDg.Attributes.Add("runat", "server");
NewDg.AutoGenerateColumns = false;
BoundField bc1 = new BoundField();
bc1.DataField = "Sno";
bc1.HeaderText = "Sno";
BoundField bc2 = new BoundField();
bc2.DataField = "Question";
bc2.HeaderText = "Question";
BoundField bc3 = new BoundField();
bc3.DataField = "Responsetp";
bc3.Visible = false;
TemplateField tc1 = new TemplateField();
tc1.ItemTemplate = new DataGridTemplate(ListItemType.Item, "Column1");
tc1.HeaderText = "Answers";
NewDg.Columns.Add(bc1);
NewDg.Columns.Add(bc2);
NewDg.Columns.Add(bc3);
NewDg.Columns.Add(tc1);
NewDg.DataSource = ds.Tables[0];
NewDg.DataBind();
while (ds.Tables[0].Rows.Count > count)
{
string question = ds.Tables[0].Rows[count]["Responsetp"].ToString();
if (string.Equals(question, "1"))
{
TextBox tx = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txt"));
tx.Visible = false;
DropDownList ddlList = (DropDownList)(NewDg.Rows[count].Cells[3].FindControl("ddl"));
ddlList.Visible = false;
TextBox txMultiline = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txtMultiline"));
txMultiline.Visible = false;
ListBox lst = (ListBox)(NewDg.Rows[count].Cells[3].FindControl("lst"));
Int64 tb032_id = Convert.ToInt64(NewDg.Rows[count].Cells[0].Text.ToString());
DataSet ds1 = objExitInterviewBLL.getListAnswers(0, 'S', "", tb032_id, 0);
if (ds1.Tables[0].Rows.Count > 0)
{
lst.DataSource = ds1;
lst.DataTextField = "Data_Text";
lst.DataBind();
}
else
{
lst.Visible = false;
}
}
else if (string.Equals(question, "0"))
{
DropDownList ddlList = (DropDownList)(NewDg.Rows[count].Cells[3].FindControl("ddl"));
ddlList.Visible = false;
TextBox tx = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txt"));
tx.Visible = true;
ListBox lst = (ListBox)(NewDg.Rows[count].Cells[3].FindControl("lst"));
lst.Visible = false;
TextBox txMultiline = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txtMultiline"));
txMultiline.Visible = false;
}
else if (string.Equals(question, "2"))
{
TextBox txMultiline = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txtMultiline"));
txMultiline.Visible = true;
TextBox tx = (TextBox)(NewDg.Rows[count].Cells[3].FindControl("txt"));
tx.Visible = false;
DropDownList ddlList = (DropDownList)(NewDg.Rows[count].Cells[3].FindControl("ddl"));
ddlList.Visible = false;
ListBox lst = (ListBox)(NewDg.Rows[count].Cells[3].FindControl("lst"));
lst.Visible = false;
}
count++;
}
NewDg.Height = Unit.Percentage(100.00);
SetProps(NewDg);
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
NewDg.RenderControl(htw);
string DivStart = "<DIV id='uniquename" + e.Row.RowIndex.ToString() + "' style='DISPLAY: none; HEIGHT: 100%;'>";
string DivBody = sw.ToString();
string DivEnd = "</DIV>";
string FullDIV = DivStart + DivBody + DivEnd;
int LastCellPosition = e.Row.Cells.Count - 1;
int NewCellPosition = e.Row.Cells.Count - 2;
e.Row.Cells[0].ID = "CellInfo" + e.Row.RowIndex.ToString();
if (ViewState["Mode"] != null && ViewState["Mode"].ToString() == "ShowDetails")
{
if (this.txtExpandedFields.Text.IndexOf(e.Row.Cells[0].ClientID) != -1)
{
//make it expand.
FullDIV = FullDIV.Replace("DISPLAY: none", "DISPLAY: block");
e.Row.Cells[0].Text = "<A>-</A>";
}
}
//match color
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[LastCellPosition].Text = e.Row.Cells[LastCellPosition].Text + "</td><tr><td bgcolor='f5f5f5'></td><td colspan='" + NewCellPosition + "'>" + FullDIV;
}
else
{
e.Row.Cells[LastCellPosition].Text = e.Row.Cells[LastCellPosition].Text + "</td><tr><td bgcolor='d3d3d3'></td><td colspan='" + NewCellPosition + "'>" + FullDIV;
}
e.Row.Cells[0].Attributes["onclick"] = "HideShowPanel('uniquename" + e.Row.RowIndex.ToString() + "'); ChangeHLText('" + e.Row.Cells[0].ClientID + "'); SetExpanded('" + e.Row.Cells[0].ClientID + "','" + txtExpandedFields.ClientID + "');";
e.Row.Cells[0].Attributes["onmouseover"] = "this.style.cursor='hand'";
e.Row.Cells[0].Attributes["onmouseout"] = "this.style.cursor='hand'";
}
}
}
catch (Exception ex)
{
}
finally
{
ds = null;
}
}
public class DataGridTemplate : ITemplate
{
ListItemType templateType;
string columnName;
public DataGridTemplate(ListItemType type, string colname)
{
templateType = type;
columnName = colname;
}
int id = 0;
public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
switch (templateType)
{
case ListItemType.Item:
DropDownList ddl = new DropDownList();
ddl.ID = "ddl";
ddl.Width = 100;
container.Controls.Add(ddl);
TextBox txt1 = new TextBox();
txt1.Width = 150;
txt1.ID = "txt";
container.Controls.Add(txt1);
ListBox lst1 = new ListBox();
lst1.Width = 100;
lst1.Height = 110;
lst1.ID = "lst";
container.Controls.Add(lst1);
TextBox txtMultiline = new TextBox();
txtMultiline.ID = "txtMultiline";
txtMultiline.Width = 200;
txtMultiline.Height = 60;
txtMultiline.Attributes.Add("textmode", "multiline");
container.Controls.Add(txtMultiline);
break;
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
BindData();
string childGdIdList = txtHidden.Text.ToString();
string[] childGdId = childGdIdList.Split(new Char[] { ',' });
for (int i = 0; i < childGdId.Length; i++)
{
if (childGdId[i].ToString() != "")
{
string id = childGdId[i].ToString();
NewDg.ID = "NewDg" + i;
//NewDg.ID = "NewDg" + i;
for (int j = 0; j < NewDg.Rows.Count; j++)
{
string u = NewDg.Rows[j].Cells[0].Text.ToString();
}
}
}
}
private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
//clean up expanded records.
txtExpandedFields.Text = "";
//DataGrid1.CurrentPageIndex = e.NewPageIndex;
BindData();
}
public void BindData()
{
try
{
ds = new DataSet();
ds = objExitInterviewBLL.getCategory(0, 'A', "");
if (ds.Tables[0].Rows.Count > 0)
{
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
}
}
catch (Exception ex)
{
}
finally
{
ds = null;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindData();
}
}
i want to join this group
|
|
|
|