Jump to content
Xtreme .Net Talk

Vetrijar

Avatar/Signature
  • Posts

    56
  • Joined

  • Last visited

Everything posted by Vetrijar

  1. Is there any simple examples that shows this? I did some programming of assembly compilers, linkers, and stuff years ago. Only did DOS style compiling. That was with C++. With VB.NET I'm wanting to do a visual form. There was a short sample on microsoft's website that showed the compiler from VB.NET but it only did a dos style window. how do you do a visual style window that shows (like a normal xp window) ?? any samples please if you know of any or helpful sites thx
  2. Is there a way to put a powerpoint presentation PPT or PPS file inside of a visual basic.net program and when you deploy it to not have the powerpoint attached through the directory? I was thinking through resources, but don't know if that is the right way, or if there's a better option. Trying to send a PPT to a company and not worry about them editing my presentation and saying it's theirs. (i already looked into password and other protections)
  3. Ok, I KNOW it can be done because you can download programs made through visual basic that already do this. What I need to know is how to do it myself. How do you make an executable program through a program? I want to be able to (for example) create a program that lets the user design maybe a game, or add a PPT for for presentations in a plug in, and then have the program compile the information and create an exe from it that the user can click on. Is there a plugin that already allows this? Like an OCX for or .NET file that can be used with visual basic.net ? Or is this some long coding that has to be done? If so, does anyone have any website that show the steps? I can't find ANYTHING, nor find any keywords in a search engine that even bring up the subject about this. Please help!
  4. Found Answer Think I finally found a fix! Found information on this site here's what my code looks like now. and it stores the date FINALLY. it was the date format. http://authors.aspalliance.com/aspxtreme/aspnet/types/datetimeformatstrings.aspx Dim mydate As Date mydate = CDate(data) ' 0000-00-00 00:00:00 <--- database format needed DataTestSystem.InsertCommand.CommandText = "INSERT DataTest SET mydate = '" & mydate.ToString("u") & "'" ' Update Info DataTestSystem.InsertCommand.Connection.Open() DataTestSystem.InsertCommand.ExecuteNonQuery() DataTestSystem.InsertCommand.Connection.Close() Now just need to make sure it will sort correctly..
  5. Anybody out there know how to store the date ? I know I can't be the only one that wants to store a date in a database..
  6. Help again ! Tried some more with it. still didn't work but I was able to get rid of that error message. Now it still stores the 0/00/0000 datetime stamp. I forgot the qoute 'getdate()' I've heard about some people getting 1/1/1900 as a number, mine is 0/0/0000 instead. Not sure what's going on here! Didn't think it would be this complex to store the current date! --- forgot to add --- It's a MySQL database. not sure if that's different.
  7. Didn't work with the Getdate :-( Here's the error I get System.Data.Odbc.OdbcException: ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.13-max-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1 at System.Data.Odbc.OdbcConnection.HandleError(HandleRef hrHandle, SQL_HANDLE hType, RETCODE retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method) at System.Data.Odbc.OdbcCommand.ExecuteNonQuery() at SecureXML.Service1.LeafofTheDay_Set(String name) at SecureXML.Service1.LeafofTheDay() Here's the code I put in there. Private Function LeafofTheDay_Set(ByVal name As String) As String InfoSystem.InsertCommand.CommandText = "UPDATE Info SET LeafoftheDay='" & name & "', LeafDayTime = getdate()" ' Update Info InfoSystem.InsertCommand.Connection.Open() InfoSystem.InsertCommand.ExecuteNonQuery() InfoSystem.InsertCommand.Connection.Close() End Function
  8. I'm having a really hard time trying to update my database with a date/time stamp. Using a 'string' storage, I can store date/time but then I can't sort the date's because it's in string format rather than datetime format in the database. Right now I'm using NaviCat to manage the database. The database is for the date field called 'LeafDayTime' is set to store a 'datetime' value. In visual basic.net, I created an asmx project that accesses the database. The Dataset's name is 'InfoSet' in which one of the values in the schema is called 'LeafDayTime'. This also is a 'DateTime' value. The subroutine I created shows the following to update the database. Private Function LeafofTheDay_Set(ByVal name As String) As String InfoSystem.InsertCommand.CommandText = "UPDATE Info SET LeafoftheDay = '" & name & "', LeafDayTime = '" & Now & "' " ' Update Info InfoSystem.InsertCommand.Connection.Open() InfoSystem.InsertCommand.ExecuteNonQuery() InfoSystem.InsertCommand.Connection.Close() End Function What happens is that the database stores the name correctly and the date as 0/0/0000. I've tried storing as Now.ToOaDate as another site suggested. doesn't work. Only way around this is changing everything to a string for the date storing, but then I'm back to square one in which I cannot sort the database by datetime Please any help on this would be appreciated!
  9. I'm having a problem with the regular expression validator or any other validator working correctly when the website is LIVE. everything works great when I'm debugging or testing the site on my home computer. The validator shows when I havent' typed enough characters when I exit the box, and tells me if there are any errors otherwise. When I have the site live and test it from a different computer. the validator doesn't even activate. there is no message that shows for anything. Is there some type of compatibility thing with the validator?? Shouldn't it work on all computers if it works on the .net testing on mine??? everything is TRUE mainly with the validator, and the display is set to dynamic. I need help. Not sure on code with this, as it's the graphic view of the validator.
  10. forgot to add in, I have tried to load a control in the listbox, thinking it would let me set the window size and scroll through the controls loaded, but that didn't seem to work (nothing showed on the screen)
  11. Is there anyway to create (or even find on the Internet premade) a message control that users can view messages from? I wanted to create a usercontrol that had a textbox and a delete button in it. the textbox would show a message, the delete key would delete that message from the list of messages being shown. In the main asp file, I want to have an area that holds each usercontrol message that is available. Ex. if there are 5 messages, then there will be 5 message usercontrols loaded on the aspx. The only catch with this is that I need the messages to fit in a preformatted window on the aspx page, so if there are a lot of messages, then that small window would allow the user to scroll through them. I don't know where to start on this. seeing if someone out there has any suggestions. there is no coding either since i can't figure how to start on this. at the moment, the only example I can think of that relates to this are the message 'alert' boxes from the SimCity 4 game
  12. yes, I changed that now for it to work some. BUT THEN found something else that works good enough for me on teh server-side. I'm using the validator tools and applying them to the boxes. this works about the same "dynamic displaying" except it doesn't show the number of keys pressed. but that's ok for now. At least my site is done. I'm hoping it's done.. still have to see what happens when live people touch it.
  13. Hmm.. Still see to have a slight problem now The javascript works when it's a textarea box that's not set with runat="server" Is there anyway to make that javascript run when the textarea is set to run at server mode? What I have is a list of textboxes, listboxes, etc that the user fills out. they click a save button that will run a vb.net function in aspx. this stores the stuff in a database. I also need to have the person know how many characters they have left (or using) for an essay question that requires 200 characters min, and 500 characters max. I really dont' want them having to manually count the characters or wait till they hit save just to find out they are short 103 characters or whatever.
  14. Thanks. Is there a sample that you could show me? or a website that has a sample of something similar to that? could it be vbscript also?
  15. testing my site right now on the Internet *crossing fingers* Need to fix one thing though if someone has an answer on this. I have a box that requires the member to type at least 200 characters. is there a way to show the number of characters currently being typed ? That way the member doesn't have to count them or click a button to find how many are left? All I have is a textbox multiline and a label that will show the characters typed after the member clicks a button to refresh.
  16. no, I don't think it's accessing that way. Here's some coding Private Sub rb_Country_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_Country.SelectedIndexChanged ' Update country connections If rb_Country.SelectedItem.Value = "Select Country" Or Trim$(rb_Country.SelectedItem.Value) = "" Then lblLocation.Visible = False rb_location1.Visible = False rb_location1.Text = "" ' Clear rb_Location2.Visible = False Session("Country") = "00" ElseIf rb_Country.SelectedItem.Value = "US" Then ' United States lblLocation.Visible = True rb_location1.Visible = True rb_Location2.Visible = False rb_location1.Text = "" ' Clear lblLocation.Text = "Zipcode" Session("Country") = "US" Else ' Some other country FillParts(rb_Country.SelectedValue) Session("Country") = rb_Country.SelectedValue rb_Location2.Visible = True rb_Location2.SelectedIndex = 0 ' Reset lblLocation.Visible = True rb_location1.Visible = False rb_location1.Text = "" ' Clear lblLocation.Text = "Location" End If lblError.Visible = False End Sub The above code is what SHOULD run after the selection box is used. the autopostback is on also. I load the usercontrol through an aspx like this Private Sub btnAccountProfile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAccountProfile.Click lblWait.Visible = True Dim Ctrl As UserControl ServiceHolder.Controls.Clear() If Session("AccountType") = "Couple" Then Ctrl = LoadControl("Controls/cprofileeditor.ascx") CType(Ctrl, cprofileeditor).SetControl(User.Identity.Name) Else Ctrl = LoadControl("Controls/profileeditor.ascx") CType(Ctrl, profileeditor).SetControl(User.Identity.Name) End If ServiceHolder.Controls.Add(Ctrl) ' load from memory When I try to access the Session("Country") in the usercontrol. the session is always the first setting it had (mainly empty) whether it's displaying the session on the screen, or using it otherwise.
  17. Anybody know? Please help me
  18. I'm a little lost on sessions right now. I can use a session in my aspx project and access the session through other aspx pages in the project. With a user control, I cannot change or access sessions made WITHIN the control. just ones outside of the control itself. Along with this, ones outside of the control that are in an aspx page I can only access, not change its value. Is this the way sessions work??
  19. Found how to format.. :D Private Sub ProfileBanner_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ProfileBanner.Click Session("SearchFilter") = "" ' Reset If Session("ViewWho") = "Single" Then ' Single change to Couple Session("SetView") = "Couple" Response.Redirect("personals.aspx") ' Reload Else ' Couple Change to Single Session("SetView") = "Single" Response.Redirect("personals.aspx") ' Reload End If End Sub ===== Below the page load of that personals.aspx ===== Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim Pg As Integer = 1, temp As String Dim name As String = Page.Request.Item("usr") If Session("SearchFlag") = "ON" Then Session("SearchFlag") = "" Else If Not Page.IsPostBack Then ' First time page is clicked on Session("SearchFilter") = "" ' Reset Session("ViewWho") = "Single" ' Reset View back to Singles End If End If If Session("SetView") = "Couple" Then ' Couple Search Session("ViewWho") = "Couple" Else ' Single Search Visible Session("ViewWho") = "Single" End If Session("SetView") = "" If Session("ViewWho") = "Couple" Then ' Currently viewing couple section ProfileBanner.ImageUrl = "images/prof_Lbanner_s.jpg" ' show singles banner ProfileBanner.ToolTip = "View the Singles" Else ' Currently viewing singles section ProfileBanner.ImageUrl = "images/prof_Lbanner_c.jpg" ' show couples banner ProfileBanner.ToolTip = "View the Couples" End If The picture changes once. Then it stops changing. If I click the picture several times (10 times or such) it will finally change again.
  20. thanks ! it did !!!
  21. thanks !!! here's the same one you had setup to be a robust (is that the right word) procedure Private Function CreateThumbnail(ByVal MyFile As HtmlInputFile, ByVal file_and_location As String, Optional ByVal Width As Integer = 100, Optional ByVal Height As Integer = 100) As Boolean Dim strFileName As String strFileName = MyFile.PostedFile.FileName Dim c As String = System.IO.Path.GetFileName(strFileName) ' only the attched file name not its path Try Dim b As Bitmap b = b.FromStream(MyFile.PostedFile.InputStream) Dim s As Bitmap 'create a new bitmap and make a thumbnail of 100 X 100 pixels s = b.GetThumbnailImage(Width, Height, New System.Drawing.Image.GetThumbnailImageAbort(AddressOf tb), IntPtr.Zero) s.Save(file_and_location) Return True Catch Exp As Exception Return False End Try End Function Private Function tb() As Boolean Return False End Function
  22. Please help... I'm like basically all done with the website but this part is really getting to me. I have a page that has a imagebutton linked to a category change function. When the user clicks the picture, it will change the picture and switch the display to show different data. when the user clicks the picture again, it will change the picture back to what it was, and the data will be switched to. Basically it's for switching between a couples and singles data list for a personals web site. What happens is after the first switch, I cannot switch back!! After maybe 10 clicks, the program switches back. Is there a problem with buffer or something? or postback to the same webpage ?? It's like the button works once and then stops executing again.
  23. My code for updating or even adding a record to the database seems to be really long for me. For some reason I'm thinking there's an easier way to update/add a record with lots of fields. Right now it's like the following Dim data As String With PData.profile(0) data = "INSERT INTO PROFILE VALUES (''," & _ "'" & CA(.username) & "'" & _ ",'" & CA(.realname) & "'" & _ ",'0'" & _ ",'" & CA(.Q1) & "'" & _ ",'" & CA(.Q2) & "'" & _ ",'" & CA(.Q3) & "'" & _ ",'" & CA(.Q4) & "'" & _ ",'" & CA(.Q5) & "'" & _ ",'" & CA(.Q6) & "'" & _ ",'" & CA(.Q7) & "'" & _ ",'" & CA(.Q8) & "'" & _ ",'" & CA(.Q9) & "'" & _ ",'" & CA(.Q10) & "'" & _ ",'" & CA(.E1) & "'" & _ ",'" & CA(.E2) & "'" & _ ",'" & CA(.E3) & "'" & _ ",'" & CA(.E4) & "'" & _ ")" End With ProfileSystem.InsertCommand.CommandText = data ProfileSystem.InsertCommand.Connection.Open() ProfileSystem.InsertCommand.ExecuteNonQuery() ProfileSystem.InsertCommand.Connection.Close() Isn't there a way to just do something like ProfileSystem.Update(PData) ??? and it finds the right fields to update?
  24. Hopefully some others answer you with this. I'm getting to like the placeholder for controls. Nice to have one control that does all the work and can be used on multiple pages. Hard part for me was with refresh in the browser and using the Page.IsPostBack to check if the control was refreshed. If you want your webpages to look alike in design. You can create them (may choose FrontPage or something) copy the code from html, and paste it into each aspx file That's how I did mine. about 90% done now with the site! :-) hope that gives you some info!
  25. I'm trying to find a way to resize an image uploaded through the WebPostedFile object. The ones on the web I'm finding are PHP, or script based. Are there any that are plain vb.net programming ? The one I found which didn't work yet was System.Drawing.Image using that I tried. dim uploadimage as system.drawing.image dim resizeimage as system.drawing.image UploadImage.FromStream(file1.PostedFile.InputStream) Resizemage = UploadImage.GetThumbnailImage(100, 200, Nothing, Nothing) ResizeImage.Save("mypicture1.jpg") I get the error. Object reference not set to an instance of an object The NEW command doesn't work for this dim statement either :-(
×
×
  • Create New...