Jump to content
Xtreme .Net Talk

shlvy

Avatar/Signature
  • Posts

    69
  • Joined

  • Last visited

Everything posted by shlvy

  1. shlvy

    Attachment

    Hi In the top of the page i wrote: <%@ Import NameSpace="System.Web.Mail" %> . Thank's.
  2. shlvy

    Attachment

    Hi I want to attach html file to my email page. The problem is that i got an error: 'Attachments' is not a member of 'Mail' The error is in the line: mail.Attachments.Add(attachment) Why is that? Thank's.
  3. shlvy

    HTML Attach

    Hi I got the next error: 'Attachments' is not a member of 'Mail' The error is in the line: mail.Attachments.Add(attachment) Thank's.
  4. shlvy

    HTML Attach

    Hi I want to attach html file to my email page. How can i do that? For example, i want to send html page to all users in my site, i have already wrote the code of sending email. Thank you very much for your assistance.
  5. Hi Is there any way to store pages in the database(access). I have let's say page.aspx and it include images and other stuff, i want to insert him to my database and get to him with link from other page, how can i do that? Thank's.
  6. Hi I try to send email from a emailform, it's works fine but when i write in the MailfromTextBox only a name(no email) the mail is not sent. How can i solve this problem? Or there is any way to insert another textbox of *.from, and the goal of that willnot be an email but just a name. Thant's my code: Dim objMailMessage As New MailMessage() objMailMessage.From = mailfrom.Text objMailMessage.To = "shlomi@forfera.co.il" objMailMessage.Subject = mailsubject.Text objMailMessage.Body = mailbody.Text objMailMessage.Priority = MailPriority.High Thank's.
  7. shlvy

    TextColor

    Hi I maen that instead of the text will be a button. Thank's.
  8. shlvy

    Email

    Hi I have an Email Sending page but the problem is the language, i see some question marks. Is there any possible that the Text like mailsubject.Text or mailbody.Text will be shown as they are, something like image, when i got the Emails from my site to my AutlookExpress i will see them correct. Thank you very much for your assistance.
  9. shlvy

    TextColor

    Hi Thank's for your reply, another lasr queastion. Can i input a button instead of theText. Thank's.
  10. shlvy

    TextColor

    Hi I want to change the color of the Text. I mean to the text ' Click to edit ' How can i do it? <asp:LinkButton Text="Click to edit" CommandName="edit" Runat="Server" /> Thank's.
  11. Hi Thank you very very very much, all i have to do is to remove the ' . Thank you, Nerseus, Kejpa and everyone.
  12. Access To SQL Hi I want to convert my code from access to sql, i need to know how to write the next words in SQL: OleDbParameter OleDbType - I got an error when i wrote SqlType.BSTR. Thank's.
  13. Hi I changed the DataType in the database to integer and nothing change. I am sorry, if there is no solutions i will give up, it is so exhausted, we changed so much in the origin code that works fine in SQL, all we have to do is to change the Parameters's names. Thank's.
  14. Hi I don't understand where excactly to change and what? In the code or in the table? Thank's.
  15. Hi All DataTypes are Text except UserID that it's AutoNumber. Thank's.
  16. Hi The error line 93: Line 93: cmdUpdate.ExecuteNonQuery() The error: Data type mismatch in criteria expression. Thank's.
  17. Hi I wrote what you told me and it shows the next sentence: Update [tblUsers] Set [userName]='admin', [Password]='admin', [RetypePassword]='admin', ='admin@admin.com', [Comments]='Hi to ' Where [userID]='515' Here the rest of the code, the code of the body: <body> <center> <form Runat="Server"> <asp:DataList ID="dlstAuthors" DataKeyField="UserID" OnEditCommand="dlstAuthors_EditCommand" OnCancelCommand="dlstAuthors_CancelCommand" OnDeleteCommand="dlstAuthors_DeleteCommand" OnUpdateCommand="dlstAuthors_UpdateCommand" RepeatColumns="4" GridLines="Both" CellPadding="10" EditItemStyle-BackColor="lightgrey" Runat="Server"> <ItemTemplate> <b>UserName: </b> <%# Container.DataItem( "UserName" )%><br><br> <b>Password: </b> <%# Container.DataItem( "Password" )%><br><br> <b>RetypePassword: </b> <%# Container.DataItem( "RetypePassword" )%><br><br> <b>Email: </b> <%# Container.DataItem( "Email" )%><br><br> <b>Comments: </b> <%# Container.DataItem( "Comments" )%> <br><br> <asp:LinkButton Text="Edit!" CommandName="edit" Runat="Server" /> </ItemTemplate> <EditItemTemplate> <b>UserName:</b> <asp:TextBox ID="txtUserName" Text='<%# Container.DataItem( "UserName" )%>' Runat="Server" /> <p> <b>Password:</b> <asp:TextBox ID="txtPassword" Text='<%# Container.DataItem( "Password" )%>' Runat="Server" /> <p> <b>RetypePassword:</b> <asp:TextBox ID="txtRetypePassword" Text='<%# Container.DataItem( "RetypePassword" )%>' Runat="Server" /> <p> <b>Email:</b> <asp:TextBox ID="txtEmail" Text='<%# Container.DataItem( "Email" )%>' Runat="Server" /> <p> <b>Comments:</b> <asp:TextBox ID="txtComments" Text='<%# Container.DataItem( "Comments" )%>' Runat="Server" /> <p> <asp:LinkButton Text="Update!" CommandName="update" Runat="Server" /> <asp:LinkButton Text="Delete!" CommandName="delete" Runat="Server" /> <asp:LinkButton Text="Cancel!" CommandName="cancel" Runat="Server" /> </EditItemTemplate> </asp:DataList> </form> </center> </body> </html> Thank's again.
  18. Hi First at all thank you for your answers. The problem is that i have a new error: Object reference not set to an instance of an object. Here what i wrote: Sub dlstAuthors_UpdateCommand( s As Object, e As DataListCommandEventArgs ) Dim conPubs As OleDbConnection Dim strUpdate As String Dim cmdUpdate As OleDbCommand Dim strUserID As String Dim txtUserName As TextBox Dim txtPassword As TextBox Dim txtRetypePassword As TextBox Dim txtEmail As TextBox Dim txtComments As TextBox strUserID = dlstAuthors.DataKeys( e.Item.ItemIndex ) txtUserName = e.Item.FindControl( "txtUserName" ) txtPassword = e.Item.FindControl( "txtPassword" ) txtRetypePassword = e.Item.FindControl( "txtRetypePassword" ) txtEmail = e.Item.FindControl( "txtEmail" ) txtComments = e.Item.FindControl( "txtComments" ) conPubs = New OleDbConnection( "Provider=" & "Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =C:\inetpub\wwwroot\R.mdb" ) strUpdate = "Update [tblUsers] Set " strUpdate = strUpdate & "[userName]='" & txtUserName.Text.Replace("'", "''") & "', " strUpdate = strUpdate & "[Password]='" & txtPassword.Text.Replace("'", "''") & "', " strUpdate = strUpdate & "[RetypePassword]='" & txtRetypePassword.Text.Replace("'", "''") & "', " strUpdate = strUpdate & "='" & txtEmail.Text.Replace("'", "''") & "', " strUpdate = strUpdate & "[Comments]='" & txtComments.Text.Replace("'", "''") & "' " strUpdate = strUpdate & "Where [userID]='" & strUserID.Replace("'", "''") & "'" cmdUpdate = New OleDbCommand( strUpdate, conPubs ) conPubs.Open() cmdUpdate.ExecuteNonQuery() conPubs.Close() dlstAuthors.EditItemIndex = -1 BindDataList End Sub Thank you very much for your assistance.
  19. Hi I tried what you tell me but it's not work. I have a simple question, i took a ready code and just change it to my values. For example, the delete sub works fine after i changed the values: Sub dlstAuthors_DeleteCommand( s As Object, e As DataListCommandEventArgs ) Dim conPubs As OleDbConnection Dim strDelete As String Dim cmdDelete As OleDbCommand Dim strUserID As String strUserID = dlstAuthors.DataKeys( e.Item.ItemIndex ) conPubs = New OleDbConnection( "Provider=" & "Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =C:\inetpub\wwwroot\R.mdb") strDelete = "Delete from tblUsers Where UserID=@UserID" cmdDelete = New OleDbCommand( strDelete, conPubs ) cmdDelete.Parameters.Add( "@UserID", strUserID ) conPubs.Open() cmdDelete.ExecuteNonQuery() conPubs.Close() dlstAuthors.EditItemIndex = -1 BindDataList End Sub Why is that so complicated with the update sub, i just changed the values and the database(SQL to Access)? Thank's.
  20. Hi Thank's but the erroris still shows, here the code of the sub, maybe you will see something wrong: Sub dlstAuthors_UpdateCommand( s As Object, e As DataListCommandEventArgs ) Dim conPubs As OleDbConnection Dim strUpdate As String Dim cmdUpdate As OleDbCommand Dim strUserID As String Dim txtUserName As TextBox Dim txtPassword As TextBox Dim txtRetypePassword As TextBox Dim txtEmail As TextBox Dim txtComments As TextBox Dim sUserName As string Dim sPassword As string Dim sRetypePassword As string Dim sEmail As string Dim sComments As string Dim iUserID As Integer strUserID = dlstAuthors.DataKeys( e.Item.ItemIndex ) txtUserName = e.Item.FindControl( "txtUserName" ) txtPassword = e.Item.FindControl( "txtPassword" ) txtRetypePassword = e.Item.FindControl( "txtRetypePassword" ) txtEmail = e.Item.FindControl( "txtEmail" ) txtComments = e.Item.FindControl( "txtComments" ) conPubs = New OleDbConnection( "Provider=" & "Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =C:\inetpub\wwwroot\R.mdb" ) strUpdate = "Update tblUsers Set UserName='"& sUserName &"', Password='"& sPassword &"', RetypePassword='"& sRetypePassword &"', Email='"& sEmail &"', Comments='"& sComments &"' Where UserID="& iUserID cmdUpdate = New OleDbCommand( strUpdate, conPubs ) cmdUpdate.Parameters.Add( "& iUserID ", strUserID ) cmdUpdate.Parameters.Add( "& sUserName ", txtUserName.Text ) cmdUpdate.Parameters.Add( "& sPassword ", txtPassword.Text ) cmdUpdate.Parameters.Add( "& sRetypePassword ", txtRetypePassword.Text ) cmdUpdate.Parameters.Add( "& sEmail ", txtEmail.Text ) cmdUpdate.Parameters.Add( "& sComments ", txtComments.Text ) conPubs.Open() cmdUpdate.ExecuteNonQuery() conPubs.Close() dlstAuthors.EditItemIndex = -1 BindDataList End Sub Thank you very much for you assistance.
  21. Hi I use a update sub, the problem is that i got an error, the error is: Syntax error in UPDATE statement. I guess the UPDATE statement is: strUpdate = "Update tblUsers Set UserName=@UserName, Password=@Password, RetypePassword=@RetypePassword, Email=@Email, Comments=@Comments Where UserID=@UserID" Remark:exactly the same code in SQL DataBase works fine. Is the problem can be in other place? Thank you very much for your assistance.
  22. Hi Thank's for your answer, i have another error: Syntax error in UPDATE statement. I have update sub, i will not give you the whole sub only the main sentence: strUpdate = "Update tblUsers set UserName=@UserName, Password=@Password, RetypePassword=@RetypePassword, Email=@Email, Comments=@Comments Where UserID=@UserID" I guess the problem is here. Thank's.
  23. Hi I wrote the next code: strDelete = "Delete tblUsers Where UserID=@UserID" I got the next error: Syntax error (missing operator) in query expression 'tblUsers Where UserID=@UserID' tblUsers is the DataBase Table. I tried many things without success. Maybe someone know why is that? Thank's.
  24. Hi I have the next code: cmdSelect = New SqlCommand( "Select au_id, au_lname, phone From Authors Order by au_lname", conPubs ). I want to select and view a specific au_lname, let's say 'Green'. What do i have to write? I tried the next sentence: cmdSelect = New SqlCommand( "Select au_id, au_lname, phone From Authors Order by au_lname WHERE au_lname ="'Green', conPubs ) There is an error:')' expected. Someone can help me? Thank's.
  25. shlvy

    Hide Column

    Hi I want to hide a column in datagrid, for example, i don't want to show the product id column, i use the next code: <Columns> <asp:BoundColumn HeaderText="Product ID" DataField="ProductID" ReadOnly="True" /> Another thing, can i use validation in columns without using Templates? Thank's and have a good day.
×
×
  • Create New...