|
Is this a statement, command or question? If the latter then typing it into Google will yield many interesting links.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Hi,
Why I am getting the above error for the following code:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_upload_resume", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.AddWithValue("param_full_name", txtFullName.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_email_address", txtEmail.Text.Trim()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_gender", cboGender.Value.ToString()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_nationality", cboNationality.Value.ToString()).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_date_of_birth", cboDateOfbirth.Date).MySqlDbType = MySqlDbType.Date;
sql_command.Parameters.AddWithValue("param_designation", Convert.ToInt32(cboDesignation.Value)).MySqlDbType = MySqlDbType.Int32;
sql_command.Parameters.AddWithValue("param_resume_ext", file_extension).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.AddWithValue("param_resume_format", document_type).MySqlDbType = MySqlDbType.VarChar;
sql_command.Parameters.Add("param_resume_data", MySqlDbType.LongBlob, file_size).Value = document_binary;
if (Request.ServerVariables["REMOTE_ADDR"] != null) sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = HttpContext.Current.Request.UserHostAddress;
else sql_command.Parameters.Add("param_ip_address", MySqlDbType.VarChar).Value = DBNull.Value;
sql_command.Parameters.Add("param_browser_platform", MySqlDbType.VarChar).Value = Request.Browser.Platform;
sql_command.Parameters.Add("param_browser_version", MySqlDbType.VarChar).Value = String.Format("{0} {1}", Request.Browser.Browser, Request.Browser.Version);
sql_command.Parameters.Add("param_gateway_version", MySqlDbType.VarChar).Value = Request.Browser.GatewayVersion;
sql_command.Parameters.Add("param_is_mobile", MySqlDbType.Bit).Value = Request.Browser.IsMobileDevice;
sql_command.Parameters.Add("param_mobile_manufacturer", MySqlDbType.VarChar).Value = Request.Browser.MobileDeviceManufacturer;
sql_command.Parameters.Add("param_mobile_model", MySqlDbType.VarChar).Value = Request.Browser.MobileDeviceModel;
sql_command.Parameters.Add("param_screen_width", MySqlDbType.Int32).Value = Request.Browser.ScreenPixelsWidth;
sql_command.Parameters.Add("param_screen_height", MySqlDbType.Int32).Value = Request.Browser.ScreenPixelsHeight;
sql_command.Parameters.Add("param_browser_type", MySqlDbType.VarChar).Value = Request.Browser.Type;
sql_command.Parameters.Add("param_machine_name", MySqlDbType.VarChar).Value = Environment.MachineName;
sql_command.Parameters.Add("param_os_version", MySqlDbType.VarChar).Value = Environment.OSVersion.VersionString;
sql_command.Parameters.Add("param_user_name", MySqlDbType.VarChar).Value = Environment.UserName;
sql_command.Parameters.AddWithValue("param_record_identity", MySqlDbType.Int32).Direction = ParameterDirection.Output;
sql_command.Parameters.AddWithValue("param_is_exist", MySqlDbType.Bit).Direction = ParameterDirection.Output;
int result_rows = sql_command.ExecuteNonQuery();
|
|
|
|
|
Might be related to connection string. Try increasing/setting the connection timeout in your connection string and see.
Setting connection timeout worked for him here facing same issue.[^]
|
|
|
|
|
Sandeep Mewara wrote: Try increasing/setting the connection timeout
Yes Sandeep.
In most of the cases we can see this error if the connection timeout is less. Nice answer.
|
|
|
|
|
In a C# 2010 web form application, I would like to know how to setup server side validators to check the format of a date in mm/dd/yyy format. Basically this would be like a regular expression, custom validator, compare validator. I basically need to validate the mm/dd/yyyy format includes for month, date, year. I also am required to make certain the user enters the date with the '/'. enter.
Can you tell me how to accomplish this goal?
|
|
|
|
|
Following regex can be used for it for format MM/dd/yyyy:
^(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d$
On server side, you can use Regex.Match to check the string and validate it.
Refer: C# Regex.Match[^]
I would prefer Masked Textbox for input itself: Enhanced Textbox Control[^]
|
|
|
|
|
I use the calendar, it easier on me and the user.
|
|
|
|
|
I have sign in panel and sign up panel in the same default.aspx page.
i have kept a validation setting with required rule in all textbox in both panels.
now the problem, when user try to sign up and click submit button it will ask him to enter data in the sign in textbox, i guess because all are in one but asp.net won't allow multipe forms in the same page.
what can i do?
|
|
|
|
|
Read this[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I think, you have to set ValidationGroup for Signin and Signup to check for respective submit.
Parwej Ahamad
|
|
|
|
|
I am getting this error with urlrewriter.net:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized configuration section rewriter.
Source Error:
Line 70: <errors callbackErrorRedirectUrl=""/>
Line 71: </devExpress>
Line 72: <rewriter>
Line 73: <rewrite url="/tags/(.+)" to="/tagcloud.aspx?tag=$1" />
Line 74: </rewriter>
Source File: C:\Users\Jassim\documents\visual studio 2010\Projects\rmconline\rmconline\web.config Line: 72
here is my web.config:
="1.0"
<configuration>
<configSections>
<sectionGroup name="devExpress">
<section name="settings" type="DevExpress.Web.ASPxClasses.SettingsConfigurationSection, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="compression" type="DevExpress.Web.ASPxClasses.CompressionConfigurationSection, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="themes" type="DevExpress.Web.ASPxClasses.ThemesConfigurationSection, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="errors" type="DevExpress.Web.ASPxClasses.ErrorsConfigurationSection, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirePermission="false"/>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="SQLdb" connectionString="Server=999.999.999.999;Port=3306;Database=rmc;Uid=root;Pwd=xxxxxx;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="DevExpress.Data.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.ASPxScheduler.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.XtraScheduler.v11.1.Core, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/>
<add assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A"/></assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers>
</roleManager>
<httpModules runAllManagedModulesForAllRequests="true">
<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" name="UrlRewriter" />
</httpModules>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.1, Version=11.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
</modules>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
<devExpress>
<settings rightToLeft="false"/>
<compression enableHtmlCompression="false" enableCallbackCompression="true" enableResourceCompression="true" enableResourceMerging="false"/>
<themes enableThemesAssembly="true"/>
<errors callbackErrorRedirectUrl=""/>
</devExpress>
<rewriter>
<rewrite url="/tags/(.+)" to="/tagcloud.aspx?tag=$1" />
</rewriter>
</configuration>
|
|
|
|
|
Although i have never used URL rewriting but it seems like your Config file have incorrect elements.
your last section
<rewriter>
<rewrite url="/tags/(.+)" to="/tagcloud.aspx?tag=$1" />
</rewriter>
should be like,
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>pattern to look for</LookFor>
<SendTo>string to replace pattern with</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>pattern to look for</LookFor>
<SendTo>string to replace pattern with</SendTo>
</RewriterRule>
...
</Rules>
</RewriterConfig>
Please Refer MSDN Article[^]
Hope above like will resolve your issue.
Thanks
-Amit Gajjar
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
Hi,
Try checking here[^].
|
|
|
|
|
Hi There.
I am having a problem in populating html table from database dynamically. What i mean is that i
have a table in database that have let say 10 enteries, I want to display those 10 entries in a
html table using loop. I am new to ASP.NET, I've previously woked in php. I can present the
scenario in php and please help me do the same thing in ASP.NET. In php what i normally do is
search the database, grab the table in fetch array and in html table i create one row and use
while loop so that all of the 10 entries are populated at runtime. Here is a demonstration
code in head:
<pre lang="PHP">= mysql_query(
in body code:
<table>
<tr>
<td>Username</td>
<td>Email</td>
<td>Position</td>
<td>Status</td>
</td>
//start of the loop
<?php while($fetch = mysql_fetch_array($query) { ?>
<tr>
<td><?php echo $fetch["username"]; ?> </td>
<td><?php echo $fetch["email"]; ?> </td>
<td><?php echo $fetch["position"]; ?> </td>
<td><?php echo $fetch["status"]; ?> </td>
</tr><?php } ?>//End of loop
</table>
When i use foreach loop in asp.net to do the same thing the it displays only the last row in the
database table...I am using three tier architecture...
projectsLoad_BLL bo = new projectsLoad_BLL();
DataSet ds = new DataSet();
DataTable dt = ds.Tables[0];
int num = 1;
foreach (DataRow dr in dt.Rows)
{
lblno.Text = num.ToString();
lblusername.Text = dr["username"].ToString();
lblemail.Text = dr["email"].ToString();
lblposition.Text = dr["position"].ToString();
lblstatus.Text = dr["status"].ToString();
dt.NewRow();
num++;
}
In HTML Table:
<table>
<thead>
<tr>
<th>No.</th>
<th>Username</th>
<th>Email</th>
<th>Position</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td><asp:Label ID="lblno" runat="server"
Text="Label"></asp:Label> </td>
<td><asp:Label ID="lblusername" runat="server"
Text="Label"></asp:Label></td>
<td><asp:Label ID="lblemail" runat="server"
Text="Label"></asp:Label></td>
<td><asp:Label ID="lblposition" runat="server"
Text="Label"></asp:Label></td>
<td><asp:Label ID="lblstatus" runat="server"
Text="Label"></asp:Label></td>
</tr>
</tbody>
</table>
I know that this method is wrong...if anyone can point to the right direction...thanks in
advance
|
|
|
|
|
You can use ASP.NET Repeater control for the purpose. It will be sufficient for your need. For more details on Repeater Control check out here[^]. It also has a sample code at the end. Try it and post if you face any problem. I will be happy to help you.
Always Keep Smiling.
Yours Pankaj Nikam
|
|
|
|
|
Thank You very much for your help. I've managed to use asp repeater with datatables efficiently. What i did is added a repeater in asp markup and bind it to dataset. And in i've placed <%# Eval("columnName") %> and viola. All operations are working fine. Thanks again!
|
|
|
|
|
Using Repeater is certainly a very good choice. I am happy that it worked for you I have one more suggestion - if you are having only read-only records i.e. you only view them, then consider using SqlDataReader object instead of the DataSet as it is fast - read-only - forward only.
Happy to help you
Always Keep Smiling.
Yours Pankaj Nikam
|
|
|
|
|
You should create a container, it can be a table called table_Container, and then loop threw the dataset, and create your tableRow and cells in code.
You can use the repeater control, but I think you should learn the basics first. Do not use Response.write(""), because response write is reserved for higher level responses like a page error code, or a data set or something.
PHP doesn't have html objects, so echo("tr" is quite common, but is poor practice in general.
foreach (DataRow dr in dt.Rows) {
TableRow tr = new TableRow;
table_Container.controls.add(tr);
TableCell td = new TableCell;
tr.controls.add(td);
Label lbl_UserName = new Label;
lbl_UserName.text = dr["username"];
td.controls.add(lbl_UserName);
}
|
|
|
|
|
I totally agree with him that you should learn basic thing how to create response.write(".
|
|
|
|
|
Hi! I don't know how to use the site mappath control in ASP.net 3.5 under visual studio 2008 .So please any buddy can help me?
safi belim
|
|
|
|
|
Start here[^].
You could always have tried Google for yourself.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
thanks but I can't what u say?
Please provide some tutorial and sample for site map path control.
Thank You
|
|
|
|
|
Did you not click on the link. It is what you asked for. If that doesn't help then try using Google to search for what you want or, better, go read the documentation until you understand how to do it.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
What is ref and out and how to use in asp.net ?
Please explain with an example .
|
|
|
|
|