Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Saturday, March 31, 2012

the best pratice to save lot of data

hi there people...
im developing an application where i need 190 input text, in 8
diferent forms..
anyone can tell me the best pratice to save the the data while edit
the others forms?
viewstate?
sessions?
or database in each "next" click?
Tobias Ramos
Belo Horizonte MG
Brasil"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.
4ax.com:

> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?
I would probably use a database... so users can come back in the future to
finish off the survey.
You can tag each user with a Cookie to look up their saved results.
Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/spot18/[/url]
Hi,
Viewstate: - Not possible as you have user specific data for each instances
of the form.
Database: - very expensive operation as you have to save & retrieve for each
form you have filled in.
Session: - Appropriate for this scenario.
Regards
Joyjit
"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in message
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.
4ax.com...
> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?
> Tobias Ramos
> Belo Horizonte MG
> Brasil
First, I would probably store the data in a HashTable to make it easy to
access and use the field ID names as the index field.
I would probably use session state to store this hash table if I did not
expect much heavy traffic. If traffic is a concern, then you can push it to
the database serializing the hashtable to a blob. You could even use a MS
Access database for that as long as you are in a "one" web server as opposed
to a server farm.
Rocky Moore
www.HintsAndTips.com / Now with GMail Queue - Share your tips - Earn rewards
www.MyQuickPoll.com / 2004 Election poll ID #33
www.RJSoft.com/Products/RJContentPanel/ - Free web user template content
control!
"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in message
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.
4ax.com...
> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?
> Tobias Ramos
> Belo Horizonte MG
> Brasil

the best pratice to save lot of data

hi there people...

im developing an application where i need 190 input text, in 8
diferent forms..
anyone can tell me the best pratice to save the the data while edit
the others forms?
viewstate?
sessions?
or database in each "next" click?

Tobias Ramos
Belo Horizonte MG
Brasil"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.4ax.com:

> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?

I would probably use a database... so users can come back in the future to
finish off the survey.

You can tag each user with a Cookie to look up their saved results.

--
Lucas Tam (REMOVEnntp@dotnet.itags.org.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Hi,

Viewstate: - Not possible as you have user specific data for each instances
of the form.

Database: - very expensive operation as you have to save & retrieve for each
form you have filled in.

Session: - Appropriate for this scenario.

Regards
Joyjit

"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in message
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.4ax.com...
> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?
> Tobias Ramos
> Belo Horizonte MG
> Brasil
First, I would probably store the data in a HashTable to make it easy to
access and use the field ID names as the index field.

I would probably use session state to store this hash table if I did not
expect much heavy traffic. If traffic is a concern, then you can push it to
the database serializing the hashtable to a blob. You could even use a MS
Access database for that as long as you are in a "one" web server as opposed
to a server farm.

--
Rocky Moore
www.HintsAndTips.com / Now with GMail Queue - Share your tips - Earn rewards
www.MyQuickPoll.com / 2004 Election poll ID #33
www.RJSoft.com/Products/RJContentPanel/ - Free web user template content
control!

"Tobias[br]" <l_tobias@dotnet.itags.org.terra.com.br> wrote in message
news:987dj0do51v3gv5hlojv7tpg7aoqb0fkce@dotnet.itags.org.4ax.com...
> hi there people...
> im developing an application where i need 190 input text, in 8
> diferent forms..
> anyone can tell me the best pratice to save the the data while edit
> the others forms?
> viewstate?
> sessions?
> or database in each "next" click?
> Tobias Ramos
> Belo Horizonte MG
> Brasil

Wednesday, March 28, 2012

The best way to validate UserControls

Hi,
I have a user control that has a property named "Text"
Is there any way that I use a RequiredFieldValidator or CompareValidator to
validate my user control's value?
I tried it and I received this error:
Control 'cboCountry' referenced by the ControlToValidate property of
'valCountry' cannot be validated.
Thank you,
MaxOn Jul 13, 10:05 pm, "Max2006" <alanal...@dotnet.itags.org.newsgroup.nospam> wrote:
> Hi,
> I have a user control that has a property named "Text"
> Is there any way that I use a RequiredFieldValidator or CompareValidator t
o
> validate my user control's value?
> I tried it and I received this error:
> Control 'cboCountry' referenced by the ControlToValidate property of
> 'valCountry' cannot be validated.
> Thank you,
> Max
Hi...
i assume you have a control inside the usercontrol that receive input
from user and you do want to validate the input ...
here are the options you have...
1. add the requited field validator for the input in the usercontrol
rather that in the page...
2. validate the text using server side validation... (for this you
need to write a server side validation method...)
Thanks
Md. Masudur Rahman (Munna)
kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
Hi Max,
Yes, I agree with Masudur's opinion. Also, if you do want to make Validator
controls directly function against your ascx usercontrol, you can use the
"ValidationPropertyAttribute" class to define a property to be validatable
in your ascx control's code behind.
#ValidationPropertyAttribute Class
http://msdn2.microsoft.com/en-us/li...tionpropertyatt
ribute(VS.80).aspx
Based on my test, through the intellisense not work, you can manually put
usercontrol's ID to validateor's "ControlToValidate" property and so far it
seems only server-side validation is working in this case.
Anyway, I think Masudur's suggested approaches are still the preferred ones
here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Max,
Have you got any further idea on this or does the information helps you
some? Please feel free to post here if there is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

The best way to validate UserControls

Hi,

I have a user control that has a property named "Text"

Is there any way that I use a RequiredFieldValidator or CompareValidator to
validate my user control's value?

I tried it and I received this error:

Control 'cboCountry' referenced by the ControlToValidate property of
'valCountry' cannot be validated.

Thank you,
MaxOn Jul 13, 10:05 pm, "Max2006" <alanal...@dotnet.itags.org.newsgroup.nospamwrote:

Quote:

Originally Posted by

Hi,
>
I have a user control that has a property named "Text"
>
Is there any way that I use a RequiredFieldValidator or CompareValidator to
validate my user control's value?
>
I tried it and I received this error:
>
Control 'cboCountry' referenced by the ControlToValidate property of
'valCountry' cannot be validated.
>
Thank you,
Max


Hi...

i assume you have a control inside the usercontrol that receive input
from user and you do want to validate the input ...
here are the options you have...
1. add the requited field validator for the input in the usercontrol
rather that in the page...
2. validate the text using server side validation... (for this you
need to write a server side validation method...)

Thanks
Md. Masudur Rahman (Munna)
kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
Hi Max,

Yes, I agree with Masudur's opinion. Also, if you do want to make Validator
controls directly function against your ascx usercontrol, you can use the
"ValidationPropertyAttribute" class to define a property to be validatable
in your ascx control's code behind.

#ValidationPropertyAttribute Class
http://msdn2.microsoft.com/en-us/li...tionpropertyatt
ribute(VS.80).aspx

Based on my test, through the intellisense not work, you can manually put
usercontrol's ID to validateor's "ControlToValidate" property and so far it
seems only server-side validation is working in this case.

Anyway, I think Masudur's suggested approaches are still the preferred ones
here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Max,

Have you got any further idea on this or does the information helps you
some? Please feel free to post here if there is anything else we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Monday, March 26, 2012

The conversion of a char data type to a datetime data type resulted in an out-of-range ...

Hi,
I couldn't understand why I can′t convert the date. I use dd/mm/yyyy, and I put the correct sintax in my code:

CType(tbVencimento.Text,Date)
but it conti nues recording inside of my database like mm/dd/yyyy, why?
and every moment I receive this error message:

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.

Please, help!
Thanks a lot!
Raphael Amador

You should use DateTime.ParseExact to get the format changed.
Dim s As String
s = "25/12/2005"
Dim d As DateTime
d = DateTime.ParseExact(s, "dd/MM/yyyy", Nothing)
Then when it is inserted into the Sql, since it is coming from a DateTime object, the format will be correct and you won't get the out-of-range value error. And it will show as mm/dd/yyyy format as 12/25/2005.
bill
Hi, I tried:

<%@dotnet.itags.org.PageLanguage="VB" %>

<%@dotnet.itags.org.ImportNamespace="System.Data" %>

<%@dotnet.itags.org.ImportNamespace="System.Data.SQLClient" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<scriptrunat="server">

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)

tbLiquido.Text =CType(tbTotNF.Text,Decimal) -CType(tbDesconto.Text,Decimal)

lblIData.Text =CDate(Today)

EndSub


ProtectedSub ddlClientes_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim SQLAsString ="Select CODCLI, RAZAO, ENDERECO, ESTADO FROM CLIENTES WHERE CODCLI = '" & ddlClientes.SelectedItem.Value &"'"

Dim Conex?oAs SqlConnection =New SqlConnection("Data Source=SERV-IPE2;Initial Catalog=IpeSys;Persist Security Info=True;User ID=ASPNET;Password=IpeSys")

Dim ComandoSQLAsNew SqlCommand(SQL, Conex?o)

Conex?o.Open()

Dim drAs SqlDataReader

dr = ComandoSQL.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

dr.Read()

tbENDERECO.Text = dr("ENDERECO")

tbESTADO.Text = dr("ESTADO")

Conex?o.Close()

EndSub


ProtectedSub Gravar_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim SQLAsString ="Insert into RECEBER(NFNUMERO_receber, EMPRESA_receber, TIPOFAT_receber, EMISSAO_receber, CODCLI_receber, CLIENTE_receber, ENDERECO_receber, ESTADO_receber, TOTALNOTA_receber, VENCIMENTO_receber, BANCO_receber, CCdoBANCO_receber, DESCONTO_receber, LIQUIDO_receber, SALDOREC_receber,IUSER_receber, IDATE_receber) values (" &CType(tbNOTAFISCAL.Text,Decimal) &",'" & ddlEmpresa.SelectedValue &"','" & rblTipoFat.SelectedValue &"','" &CType(tbDataEmissao.Text, DateTime) &"','" & ddlClientes.SelectedItem.Value &"','" & ddlClientes.SelectedItem.Text &"','" & tbENDERECO.Text &"','" & tbESTADO.Text &"','" &CType(tbTotNF.Text,Decimal) &"','" &CType(tbVencimento.Text, DateTime) &"','" & ddlBancoCob.SelectedItem.Text &"','" & ddlBancoCCorrente.SelectedItem.Text &"','" &CType(tbDesconto.Text,Decimal) &"','" &CType(tbLiquido.Text,Decimal) &"','" &CType(tbLiquido.Text,Decimal) &"','" & lblIUSER.Text &"','" &CType(lblIData.Text,Date) &"')"

Dim Conex?oAs SqlConnection =New SqlConnection("Data Source=SERV-IPE2;Initial Catalog=IpeSys;Persist Security Info=True;User ID=ASPNET;Password=IpeSys")

Dim ComandoSqlAsNew SqlCommand(SQL, Conex?o)

Conex?o.Open()

Dim sAsString

s ="25/12/2005"

Dim dAs DateTime

d = DateTime.ParseExact(s,"dd/MM/yyyy",Nothing)

ComandoSql.ExecuteNonQuery()

Conex?o.Close()

Response.Redirect("Lista.aspx")

EndSub


ProtectedSub CancelButton_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Response.Redirect("Lista.aspx")

EndSub


But I have the same problem with the out-of-range error. Can you explain me more about your code??
Thanks a lot.
Raphael


Hi, I tried:

<%@dotnet.itags.org.PageLanguage="VB" %>

<%@dotnet.itags.org.ImportNamespace="System.Data" %>

<%@dotnet.itags.org.ImportNamespace="System.Data.SQLClient" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<scriptrunat="server">

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)

tbLiquido.Text =CType(tbTotNF.Text,Decimal) -CType(tbDesconto.Text,Decimal)

lblIData.Text =CDate(Today)

EndSub


ProtectedSub ddlClientes_SelectedIndexChanged(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim SQLAsString ="Select CODCLI, RAZAO, ENDERECO, ESTADO FROM CLIENTES WHERE CODCLI = '" & ddlClientes.SelectedItem.Value &"'"

Dim Conex?oAs SqlConnection =New SqlConnection("Data Source=SERV-IPE2;Initial Catalog=IpeSys;Persist Security Info=True;User ID=ASPNET;Password=IpeSys")

Dim ComandoSQLAsNew SqlCommand(SQL, Conex?o)

Conex?o.Open()

Dim drAs SqlDataReader

dr = ComandoSQL.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

dr.Read()

tbENDERECO.Text = dr("ENDERECO")

tbESTADO.Text = dr("ESTADO")

Conex?o.Close()

EndSub


ProtectedSub Gravar_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Dim SQLAsString ="Insert into RECEBER(NFNUMERO_receber, EMPRESA_receber, TIPOFAT_receber, EMISSAO_receber, CODCLI_receber, CLIENTE_receber, ENDERECO_receber, ESTADO_receber, TOTALNOTA_receber, VENCIMENTO_receber, BANCO_receber, CCdoBANCO_receber, DESCONTO_receber, LIQUIDO_receber, SALDOREC_receber,IUSER_receber, IDATE_receber) values (" &CType(tbNOTAFISCAL.Text,Decimal) &",'" & ddlEmpresa.SelectedValue &"','" & rblTipoFat.SelectedValue &"','" &CType(tbDataEmissao.Text, DateTime) &"','" & ddlClientes.SelectedItem.Value &"','" & ddlClientes.SelectedItem.Text &"','" & tbENDERECO.Text &"','" & tbESTADO.Text &"','" &CType(tbTotNF.Text,Decimal) &"','" &CType(tbVencimento.Text, DateTime) &"','" & ddlBancoCob.SelectedItem.Text &"','" & ddlBancoCCorrente.SelectedItem.Text &"','" &CType(tbDesconto.Text,Decimal) &"','" &CType(tbLiquido.Text,Decimal) &"','" &CType(tbLiquido.Text,Decimal) &"','" & lblIUSER.Text &"','" &CType(lblIData.Text,Date) &"')"

Dim Conex?oAs SqlConnection =New SqlConnection("Data Source=SERV-IPE2;Initial Catalog=IpeSys;Persist Security Info=True;User ID=ASPNET;Password=IpeSys")

Dim ComandoSqlAsNew SqlCommand(SQL, Conex?o)

Conex?o.Open()

Dim sAsString

s ="25/12/2005"

Dim dAs DateTime

d = DateTime.ParseExact(s,"dd/MM/yyyy",Nothing)

ComandoSql.ExecuteNonQuery()

Conex?o.Close()

Response.Redirect("Lista.aspx")

EndSub


ProtectedSub CancelButton_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Response.Redirect("Lista.aspx")

EndSub


But I have the same problem with the out-of-range error. Can you explain me more about your code??
Thanks a lot.
Raphael

Saturday, March 24, 2012

The easiest way to save data into a text file on server side - Help me please

Embarrassed

Hi guys, I'm new at ASP and all I wanna know is, what is the simplest code for gathering info from my website visitors (using the FORM object) and saving it to a text file (*.TXT) on the web server? The whole procedure. I know it's lame, but is there anyone out there, that could help me with this one? Thanks guys.

Andrew

You could do something like the following. Here txtName and txtAddress are textboxes. Similarly you can add all the controls that you want to save.

The collected data is saved in the current directory on the webserver in a file called Test.txt. All subsequent saves will be appended to the same file (change the last parameter
to false to overwrite on every save)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim s As String
s += txtName.Text + vbCrLf
s += txtAddress.Text + vbCrLf
My.Computer.FileSystem.WriteAllText(Server.MapPath("Test.txt"), s, True)

end sub

The Ellipsis (.) Character Is Not Showing Up When Read From A Text File

I have a page which reads the the first line of every *.txt file in a
certain directory of mine to use as the Text property of a HyperLink
Control. However, in one of my recently added text files in the directory it
is using all but the ellipsis character (this is the last character in the
line, but it does the same thing when I place the character in other
places). For example, here is what the line looks like in the *.txt file and
the generated HTML code:
*.txt File:
Whate.ver you say.
HTML Code:
Whatever you say
When I create the text files, which I do in Windows Notepad on Windows XP
Pro SP2, I enter the character using the ALT+0133 key combination. Even if
ASP.NET did not recognize this character, I would at least expect it to put
some character in it's place, even if it was not the one I wanted. When
reading the *.txt file I use the System.IO.StreamReader.ReadLine() method. I
am assuming the fix has something to do with the character sets I am using
when creating and/or reading the *.txt files, but I was unable to find the
character set that Notepad saves the file as. Can somebody help me here?
Thanks.
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/
>but I was unable to find the
>character set that Notepad saves the file as. Can somebody help me here?
The Encoding field in Notepad's File -> Save As... dialog.
Mattias
Mattias Sjgren [C# MVP] mattias @. mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Tuesday, March 13, 2012

The issue with web.config?

When I implement .Net application in design period then web.config file is text file and is editable. If I use VS.Net package tool to package application and distribute to client's machine. The end user can edit the web.config file?
I doubt it can't be edited and also hide in the exe file.
Thanks in advance!what?
I'm not quite following the question, but if you mean what I think you mean,of course the end user can edit it if they want to. you can't stop them. explain yourself.

I set the security level in the web.config and distribute the client machine the installation package. It the end user can edit the web.config in his/her machine, then what I set for security not meaningful - I can't set secrity from web.config.
still not quite making sense.
I think I know what you're on about, and yes, if you want to use a textfile to control your security, then your security will be quite trivialto bypass...
perhaps you should actually explain what you're trying to do with web.configexactly

The Joys of Data Binding

I have a dataview containing 6 records. I have bound the dataview to
myDataList.
I also have 3 text fields that I want to bind to the "FIRST" record
in the dataview. Is this possible in .net Web?actually, I just got that to work. I there a way to access database column names from the Dataview?

the label control in asp.net 2.0

how do i autosize the width of a label to the width of the text field?Put them in the same column of a table and set their width to 100%.
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"darren" <darren@.discussions.microsoft.com> wrote in message
news:AC0FE30E-B5BC-4900-87B0-5725CDC61BB6@.microsoft.com...
> how do i autosize the width of a label to the width of the text field?
>

the label control in asp.net 2.0

how do i autosize the width of a label to the width of the text field?Put them in the same column of a table and set their width to 100%.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"darren" <darren@.discussions.microsoft.comwrote in message
news:AC0FE30E-B5BC-4900-87B0-5725CDC61BB6@.microsoft.com...

Quote:

Originally Posted by

how do i autosize the width of a label to the width of the text field?
>
>