If possible try to use the Regex. May be it helps solving your problem.
Kaushal Arora
Posts
-
datatable filter -
Enable asp menu with javascriptHi, You are using it correctly but just one mistake you have made is making the Menu disabled in server side. Use
Rather than `Because when you make a control disable from server side you will not be able to get it from client side. Also try using getElementById only in place of getElementByIdWithReplaceCheck if it does not work out. Hope it Helps. Regards, Kaushal Arora`
-
Hide a rowYes, it is possible. Give the Row a id and make it runat="server" like
<table>
<tr id="rowhide" runat="server">
<td>
<asp:Label id="lbl" runat="server" Text="Test"></asp:Label>
</td>
<td>
<asp:Label id="lbl2" runat="server" Text="Tes2"></asp:Label>
</td>
</tr>
</table>And now at the code behind page you can do like rowhide.Visible = false; //true Hope it helps. Regards, Kaushal Arora
-
DataTable Select QueryHi, I am doing this thing using the method:
for (int CountHoliday = 0; CountHoliday < 3; CountHoliday++) { string sqlFilter = "Holiday Day = '" + Convert.ToDateTime(Al[CountHoliday]).Day + "' and Holiday Month='" + Convert.ToDateTime(Al[CountHoliday]).Month + "' and Holiday Year='" + Convert.ToDateTime(Al[CountHoliday]).Year + "'"; DataRow[] dtRow = dsHoliday.Tables[0].Select(sqlFilter); if (dtRow[0].ItemArray[4].ToString() != "") { iCounter++; } } You have to get the Day, Month and Year in the DataTable as columns and use the filter in that. If you will be using the full datetime value for comparison it would not help you as it throws the error in some cases. Also try to name the columns without space like "Holiday Day" or "Holiday Date" should be "HolidayDay" or "HolidayDate" or you can use Underscore in place of Space.
Regards, Kaushal Arora -
Help Creating Exe File[modified]Hi, I have created an application using VB6. I want to limit my exe to get install only via my installer. When i install my application an exe is placed in system, if some one copy that exe and paste it in other computer, he can also use the same exe to run application and use. So if there is any way so that i can limit my installation to that particular PC where i have installed it using Installer. Regards, Kaushal Arora
modified on Wednesday, July 15, 2009 9:26 AM
-
datatable.select("dintinct columnName");You can try hashtables for doing this. But the best way is to change the display at runtime by merging the cells in gridview. You can have a look at this: http://forums.asp.net/p/1053747/1494505.aspx[^] Regards, Kaushal Arora Mark as Answer if it Solved Your Problem.
-
how to update grid view row on dropdown selectionCould you post your gridview fillimg code. Regards, Kaushal Arora
-
IP restriction Error in SQL Server 2005Hi Aman, Try to read this article. It is full of information. http://technet.microsoft.com/en-us/library/bb326598.aspx[^] Regards, Kaushal Arora Please Mark as Answer if it Solved Your Problem.
-
Grid View Event..Use the "CommandName" property of the Button and set it to What ever name you want to give and the "CommandArgument" property to the unique id of that row to get the same. You can catch the same in the RowCommand Event of the Gridview as
if (e.CommandName == "WhatEverYouNamed")
{
// Your Set of Commands and you can get the Unique Key value using e.CommandArgument.
}Using this you can have multiple buttons doing multiple things in one gridview. Regards, Kaushal Arora Please Mark as Answer if it solved your problem.
-
How to Create a Dynamic Page in VB and Print the same.I have to Build a Dynamic Page. How can i do this?
-
How to Create a Dynamic Page in VB and Print the same.Hi There, I have an Application of Laboratory Management. In this i have created multiple pages to take the results of the tests that has been performed for the patient. Supposidly, there are 2 Blood Tests out of 10 , 3 Urine Tests out of 8, 2 Stool Tests out of 10. All these have different Pages and Different Tables to get store. Now what i want is to print only the tests that have been performed having correct format of print. I do not know how many Labels i have to use for the display and then print the same page. This will be decided at runtime. If possible can you plz tell me how to Create a Scrolling Page in VB and Print the same. Regards, Kaushal Arora
-
What is it called?The thing is called "CAPTCHA" and for the help you can google search or you will find various articles for the same in CodeProject. Regards, Kaushal Arora Please mark as Answer if it solved your problem.
-
validation controls in aspYou can use Custom Validator and in that you can have Javascript code or server side code too. It is upto you. Regards, Kaushal Arora
-
onclickCould you write your full aspx page code here. Regards, Kaushal Arora
-
Restict Number of Connections......Try this
void Application_Start(object sender, EventArgs e)
{
Application["ActiveSessions"] = 0;}
void Session_Start(object sender, EventArgs e)
{
try
{
Application.Lock();int activeSessions = (int) Application\["ActiveSessions"\] + 1; int allowedSessions = 10; // retrieve the threshold here instead Application\["ActiveSessions"\] = activeSessions; if (activeSessions > allowedSessions) System.Web.HttpContext.Current.Response.Redirect("~/UserLimitReached.aspx", false); } finally { Application.UnLock(); }
}
void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["ActiveSessions"] = (int)Application["ActiveSessions"] - 1;Application.UnLock();
}
-
Problem in Date FormatHi, Try using this code, this is a bit lengthy work but is useful in these type of cases.
// First Split the Textbox text on '/' string[] arrdate = textbox1.Text.Split('/'); //Get the Splitted values in variable, You can also use them directly in the followed statement used to create DateTime. int year = Convert.ToInt32(arrdate[2].ToString()); int month = Convert.ToInt32(arrdate[1].ToString()); int day = Convert.ToInt32(arrdate[0].ToString()); // Now create a new Datetime variable DateTime myDt = new DateTime(year, month, day); // Or you can write like this DateTime myDt = new DateTime(Convert.ToInt32(arrdate[2].ToString()), Convert.ToInt32(arrdate[1].ToString()), Convert.ToInt32(arrdate[0].ToString())); // Here is you Datetime variable.
Regards, Kaushal Arora Please mark as Answer if it solved your problem. -
HTML JavascriptJust Right Click on the Website in the Solution Explorer and click the option Browse With. There add the firefox.exe and you can then use the firefox browser instead of IE. Regards, Kaushal Arora
-
HTML JavascriptJust write the word debugger in the starting if your javascript function which you are calling or you can apply it after the script tag starts and try to debug the javascript code like we do with cs of vb file. Regards, Kaushal Arora
-
HTML JavascriptIn Internet Explorer you can enable javascript debugging by unchecking the option "Disable Script Debugging(Internet Explorer)" and for others you can use "Disable Script Debugging(Other)" from Tools -> Internet Options -> Advanced Regards, Kaushal Arora Mark the reply as Answer if it solved your purpose.
-
problem in editing in gridviewHi, What i think the problem is in the place where you refer to your control using Cells[index].Controls[1] and there would have been only one control and that too at position [0] not [1]. So try using the code like this as you do know the name of the control which you want to fetch using the code for updation purpose. protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { //fetch datakey/primarykey for identifyning the row string materialrecipt_no = Convert.ToString(GridView1.DataKeys[e.RowIndex].Value); TextBox materialrecip_date = (TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName"); TextBox pqty = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName")); TextBox enterby = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName")); TextBox ptype = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName")); TextBox remark = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName")); SqlCommand com = new SqlCommand("update material_incoming set materialrecip_date='" + materialrecip_date.Text + "',pqty='" + pqty.Text + "',enterby='" + enterby.Text + "',ptype='" + ptype.Text + "',remark='" + remark.Text + "' where materialrecipt_no=" + materialrecipt_no + "", conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); GridView1.EditIndex = -1; //to go back to the previous position // fetch and rebind the data. BindGrid(); } Please mark as answer if problem gets resolved. Regards, Kaushal Arora