|
That will result in name being a string of space characters.
|
|
|
|
|
so now i can add the remaining space to the string, but while displaying the data into text file, it also cannot show the data like:
xxxxx xxxxxxx xxx
xxxxxx xxxx xxx
because teh width of the space character is smaller than character, then how to slove it ?
-- modified at 21:41 Sunday 19th November, 2006
Best regards,
Chee ken
|
|
|
|
|
String.PadLeft() also works.
<br />
stream.WriteLine("{0}\t{1}\t{2}",EmployeeNumber.PadLeft(20),FName.PadLeft(20),LName.PadLeft(20));<br />
Assuming that you want tabs delimiting the columns, and each column to be 20 characters wide. A gotcha is that if any of these strings are more than 20 characters (or whatever length you specify) your value will be that length. PadLeft does not truncate, you'll have to do that yourself.
J-man
|
|
|
|
|
Hi all,
We are migrating our web application from VS.NET 2003 to VS.NET 2005.
after migrating to 2005, it is giving two major errors for the following:
1> In HTML, withing code and at page directive: strict implisit on not allow conversion from object to string.(I tried for both on and off option)
2> for declaring Text attribute for label and other controls in HTML, its giving error: text property can not assign declarative. (I have code like: Text="Jim")
I am very much new for vs.net 2005.
i really appreciate any help on this.
Thanks,
Thampi
|
|
|
|
|
1. That's true, it's best to convert parameters to object type and cast them inside your method.
2. The label can be converted to <Label>Text</Label>.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I want to change my ListBox DataSource by a button event,but Where page reload ,The listbox is empty,How to do?
|
|
|
|
|
Can u explain more?
Best Regards
3ala2
|
|
|
|
|
you should change property "AutoPostBack=Ture" in the listbox properties.
try it i think it helpful.
|
|
|
|
|
 I test your tips, it still does not work,my code is here.
<br />
<br />
using System;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Data.OleDb;<br />
using System.Drawing;<br />
using System.Web;<br />
using System.Web.SessionState;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.HtmlControls;<br />
using WinPbMove;<br />
namespace WebPbMove<br />
{<br />
public class WebProdSelect : MetaBuilders.WebControls.DialogPage<br />
{<br />
protected System.Web.UI.WebControls.TextBox TextBox1;<br />
protected System.Web.UI.WebControls.Label Label1;<br />
protected System.Web.UI.WebControls.ListBox ListBox1;<br />
protected System.Web.UI.WebControls.Button cmdFilter;<br />
protected System.Web.UI.WebControls.Button cmdReturn;<br />
private PbMove dl = null;<br />
const string MYSTRING = "-------";<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
string strSQL = "";<br />
if (!Page.IsPostBack)<br />
{<br />
if (dl == null)<br />
dl = new PbMove();<br />
if (dl.OpenConnection() == false)<br />
throw(new SystemException("Connect Oracle Failed!"));<br />
OleDbConnection cn = dl.Connection;<br />
<br />
if (TextBox1.Text == "")<br />
{<br />
strSQL = "Select t.prdct_name || '" + MYSTRING + "' || t.dscr From ip_prdct t";<br />
}<br />
else<br />
{<br />
strSQL = "Select t.prdct_name || '" + MYSTRING + "' || t.dscr From ip_prdct t"<br />
+ " Where t.dscr like '%" + TextBox1.Text + "%'";<br />
}<br />
OleDbDataAdapter adpter = new OleDbDataAdapter(strSQL,cn);<br />
DataSet ds = new DataSet();<br />
adpter.Fill(ds,"IP_PRDCT");<br />
DataTable dtProdct = ds.Tables["IP_PRDCT"];<br />
ListBox1.DataSource = dtProdct;<br />
ListBox1.DataTextField = dtProdct.Columns[0].ColumnName;<br />
ListBox1.DataValueField = dtProdct.Columns[0].ColumnName;<br />
ListBox1.DataBind();<br />
}<br />
}<br />
<br />
#region Web <br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{ <br />
this.cmdFilter.Click += new System.EventHandler(this.cmdFilter_Click);<br />
this.cmdReturn.Click += new System.EventHandler(this.cmdReturn_Click);<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
#endregion<br />
<br />
private void cmdFilter_Click(object sender, System.EventArgs e)<br />
{ <br />
if (dl == null)<br />
dl = new PbMove();<br />
if (dl.OpenConnection() == false)<br />
throw(new SystemException("Connect Oracle Failed!"));<br />
OleDbConnection cn = dl.Connection;<br />
<br />
string strSQL = "Select t.prdct_name || '" + MYSTRING + "' || t.dscr From ip_prdct t"<br />
+ " Where t.dscr like '%" + TextBox1.Text + "%'";<br />
OleDbDataAdapter adpter = new OleDbDataAdapter(strSQL,cn);<br />
DataSet ds = new DataSet();<br />
adpter.Fill(ds,"IP_PRDCT");<br />
DataTable dtProdct = ds.Tables["IP_PRDCT"];<br />
ListBox1.DataSource = dtProdct;<br />
ListBox1.DataTextField = dtProdct.Columns[0].ColumnName;<br />
ListBox1.DataValueField = dtProdct.Columns[0].ColumnName;<br />
ListBox1.DataBind();<br />
}<br />
<br />
private void cmdReturn_Click(object sender, System.EventArgs e)<br />
{<br />
string sRet = "";<br />
string str = ListBox1.SelectedItem.Text;<br />
int i = str.IndexOf(MYSTRING);<br />
if (i != -1)<br />
sRet = str.Substring(0,i).Trim();<br />
this.Close(sRet); <br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
how can i call out values from .aspc after registering it to default.aspx
Kindly show with example
enjoy life like i do..
|
|
|
|
|
What is aspc?
Best Regards
3ala2
|
|
|
|
|
Hi! i want to create images from a pdf file using asp.net. can any one help me in this regards? if any one know any open source library please tell me.
SAMir Nigam
|
|
|
|
|
hello all!
i do binded data from the database onto the datagrid.Datagrid contains a templated column which displays some image.i want to navigate(some anotehr page)to the respected resource while clickig on the image present in the grid. Plz send me apprapreate code or articles related to meet this scenario.
any information will be appritiated..yuvaraj
yuva.charan@gmail.com
|
|
|
|
|
I got an ASP.NET page where I got a table with a button menu.I need to show a HTML page by clicking any button but the tricky part is to show this HTML page in the same page inside a tablecell from the same table.Any ideas?
Best regards
|
|
|
|
|
Use an iframe.
---
b { font-weight: normal; }
|
|
|
|
|
use an iframe in the table's cell where u want to display the page and when button is clicked set the source of iframe to that page e.g. page is abc.aspx then use:
<iframe>
</td>on button click event:
pageFrame.Attributes("Src") = "abc.aspx";
Reagrds,
<div class="ForumSig">Rashida Jabeen
<a href="http://www.akaas.net">http://www.akaas.net</a>[<a href="http://www.akaas.net" target="_blank" title="New Window">^</a>]</div>
|
|
|
|
|
i was using the below code to send the mail.
Dim mm As New MailMessage
With mm
.To = ToId
.From = FromId
.Body = Content
End With
SmtpMail.SmtpServer = "192.168.0.222"
SmtpMail.Send(mm)
for the first half hour it was working properly. After this an error message is coming,
" Could not access 'CDO.Message' object. "
Please help me to solve this
hello
|
|
|
|
|
Hi,
Please check that the CDO is properly registered on your system. For that you will have to re-install cdosys.dll and cdonts.dll. First uninstall cdosys.dll and cdonts.dll from you system using these commands.-
RegSvr32 "path to cdosys.dll" /u
RegSvr32 "path to cdonts.dll" /u
Then install them back by.
Run the
RegSvr32 "path to cdosys.dll" and
RegSvr32 "path to cdonts.dll" . These files usually reside in your System32 directory under the windows root directory.
You can use the command prompt to issue these commands.
hope this solves your problem.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
hi,
i want stuff for client side validation in asp.net using javascript....
|
|
|
|
|
|
Hi dears,
I want to use Ajax Accordion in my asp.net website . my accordion has two accordion pane ,each contains a GridView bound to database! Now I write codes to bind GridView to DataBase but when I place my GridView in accordin pane an error occures with message "The Name GridView1 does not exist..."! How can I fix problem???
the code is :
< atlas:ScriptManager ID="ScriptManager1" runat="server"></atlas:ScriptManager>
< atlasToolkit:Accordion ID="Accordion1" runat="server" SelectedIndex="0" HeaderCssClass="AccordinHeader" ContentCssClass="AccordionControl" FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" AutoSize="None" Height="514px">
< atlasToolkit:AccordionPane ID="Pane1" runat="server">
< Header>< a href="" onclick="return false;" class="AccordionLink" style="font-family:Tahoma;color:black" >pane 1</a></Header>
< Content>< p style="color:Blue">
< asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
< Columns>
< asp:TemplateField>
< ItemTemplate>
*****
< /ItemTemplate>
< /asp:TemplateField>
< /Columns>
< /asp:GridView>
< /Content>
< /atlasToolkit:AccordionPane>
< /atlasToolkit:Accordion>
www.behzadi.net
|
|
|
|
|
Maybe it will help you
http://asp.net/learn/videos/default.aspx?tabid=63
and then locate: #13 > Use the “Atlas” Accordion Control? Video
Eric H.
|
|
|
|
|
Hi,
While deploying a web application i have to set the new connection string in the web.config file.
The code i used is given below
------
try
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
AppSettingsSection section = (AppSettingsSection)config.GetSection ("appSettings");
section.Settings["conString"].Value = str; // connection string
WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath);
config.Save(ConfigurationSaveMode.Modified);
}
catch (Exception ex)
{
}
--------------------------
When i'm executing the code in the visual studio framework , it works fine. When the web.config is changed, save confirmation message appears there.
But when deploying, the web.config file is not get updated permanently.
As there is no error in the code no exception arises there.
Any help w'l be appreciated.
Thanks in advance.
Regards
Nicejith
|
|
|
|
|
Hi Friends
I want to put the control , on which when we click , color dialogbox
will open and we can select one of the color from it.And that selected color will be displayed on the page.
please , guide me regarding this.
Thanking you,
Param
param
|
|
|
|
|
I want to upload multiple Directories on server . How can i do this ??
Please give me some sourse code or Demo Project
|
|
|
|