How do you release/renew in Win Vista??
Ty
How do you release/renew in Win Vista??
Ty
The Formview option allows you to edit a row in a table, add a new row in a table, and delete a row in a table. How do you set up a formview where only the edit and new functions are enable but a user cannot delete a record?
Ty
How do you work with the gridview and formview in ASP.NET so that a table updates when a user selects to update??
Ty
How do you submit to another form using the submit button??
Ty
I have a database that a user can search for using the begins with, exact match, or contains option. I did a request.querystring to pull in that information from the previous page where the user selects one of those options and types is what he is searching for. The problem is that I cannot figure out how to display the users result when they select to search by exact match, begins with, or contains. The following is the code that I used. Can anyone tell me what is wrong with it and give me some leads on how to get it fixed. Table Display <%Dim FieldHead, SearchMethod, TextBox, Table, DB, RS, strSql%> <%'Request the information from the previous page'%> <%FieldHead = Request.QueryString("fieldhead") SearchMethod = Request.QueryString("SrchMthd") TextBox = Request.QueryString("textbox") Table = Request.QueryString("Table") %> <%'search method if the user selects begins with%> <%If SearchMethod = "begin" Then%> <%Set DB = Server.CreateObject("ADODB.Connection") DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb") Set RS = Server.CreateObject("ADODB.Recordset") strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & " LIKE '" & TextBox & "%'" RS.Open (strSql), DB End IF %> <%'search method if the user selects contains%> <%If SearchMethod = "contain" Then%> <%Set DB = Server.CreateObject("ADODB.Connection") DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb") Set RS = Server.CreateObject("ADODB.Recordset") strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & " LIKE '%" & TextBox & "%'" RS.Open (strSql), DB End IF%> <%'search method if the user selects exact match%> <%If SearchMethod = "exact" Then%> <%Set DB = Server.CreateObject("ADODB.Connection") DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb") Set RS = Server.CreateObject("ADODB.Recordset") strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & = TextBox RS.Open (strSql), DB End IF%>
Ty
I am trying to split a change amount into two parts, Bill Amt and Change Amt. Ex. (12.45) Here is the code that is not working even though it seems correct: my ($ChngeAmt, $Paper, $Cent, @money) @money = split(/./, $ChngeAmt); $Paper = $money[0]; $Cent = $money[1]; Why is this code not splitting??
Ty
This is my second week using ASP and I've run into some problems with array and split. Please look at the following: <%Dim x, y, t, z(3) z = split(t, ".") x = z(0) y = z(1) %> t = 9.95 I keep getting the following error message: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch What am i doing wrong??? -- modified at 12:27 Tuesday 16th January, 2007
Ty
What does CSng mean and what does it do? Ty
Okay this looks nasty. Real Nasty. So here's the code. Its supposed to be three parallel color polygons but, it doesn't look like that. This is the first time i'm using the gradient brush so, if any of the experienced Vb programmers could help me make it look neater than what it is, that would be appreciated. Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint 'Declares procedure level varaibles. Dim brGradient As System.Drawing.Drawing2D.LinearGradientBrush Dim points() As PointF 'Defines the rectangle. Dim clientRectangle As New System.Drawing.Rectangle(0, 0, _ Me.Width, Me.Height) 'Sets the Gradient Brush color for the red polygon. brGradient = New System.Drawing.Drawing2D.LinearGradientBrush(clientRectangle, _ Color.Black, Color.Red, _ System.Drawing.Drawing2D.LinearGradientMode.Horizontal) 'Draws the points for the red polygon. points = New PointF() {New PointF(0, 0), _ New PointF(0, 30), _ New PointF(ToSingle(Me.Width / 2.3), 320), _ New PointF(ToSingle(Me.Width / 2), 320), _ New PointF(ToSingle(Me.Width / 2), 295), _ New PointF(35, 0), _ New PointF(0, 0)} 'Fills the red polygon using the points and gradient brush. e.Graphics.FillPolygon(brGradient, points) 'Closes the Gradient brush. brGradient.Dispose() 'Sets the Gradient Brush color for the green polygon. brGradient = New System.Drawing.Drawing2D.LinearGradientBrush(clientRectangle, _ Color.Black, Color.Green, _ System.Drawing.Drawing2D.LinearGradientMode.Horizontal) 'Draws the points for the green polygon. points = New PointF() {New PointF(125, 0), _ New PointF(125, 30), _ New PointF(400, 320), _ New PointF(435, 320), _ New PointF(435, 295), _ New PointF(160, 0), _ New PointF(125, 0)} 'Fills the green polygon using the points and gradient b
That seems right. Are you trying to perhaps close one form and open another?? Ty
Thank You for helping me. And a last request if you don't mind. Here is the final code to the splash screen. Just look over it and see if i got the general idea right. Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim graCurrent As Graphics = e.Graphics Dim colCurrent As Color, colCurrent1 As Color Dim penCurrent As Pen, penCurrent1 As Pen Dim LineLoop As Integer, LineLoop1 As Integer 'Sets the first coordiante for the green triangle. Dim Greenx1 As Integer = 0 Dim Greenx2 As Integer = 0 Dim Greeny1 As Integer = 0 Dim Greeny2 As Integer = Me.Height 'Sets the first coordiante for the blue triangle. Dim Bluex1 As Integer = Me.Width Dim Bluex2 As Integer = 0 Dim Bluey1 As Integer = Me.Height Dim Bluey2 As Integer = 0 ' Sets the "step value" or how far up and over for each line created. Dim StepX As Integer = ToInt32(Me.Width / 255) Dim StepY As Integer = ToInt32(Me.Height / 255) ' Darwing of the Green Triangle For LineLoop = 0 To 255 colCurrent = Color.FromArgb(0, LineLoop, 0) penCurrent = New Pen(colCurrent, 4) graCurrent.DrawLine(penCurrent, Greenx1, Greeny1, Greenx2, Greeny2) Greenx1 = Greenx1 + ToInt32(StepX) Greeny1 = Greeny1 + ToInt32(StepY) Greenx1 += 1 Greeny1 += 1 Greeny2 += 1 Next LineLoop ' Drawing of the Blue Triangle For LineLoop1 = 255 To 0 Step -1 colCurrent1 = Color.FromArgb(0, 0, LineLoop1) penCurrent1 = New Pen(colCurrent1, 4) graCurrent.DrawLine(penCurrent1, Bluex1, Bluey1, Bluex2, Bluey2) Bluex1 = Bluex1 + ToInt32(StepX) Bluey1 = Bluey1 + ToInt32(StepY) Bluey1 -= 1 Bluey2 -= 1 Bluex2 += 1 Next LineLoop1 End Sub :) Ty
Okay so I sort of understand. But the way I was trying to do it was create a line that draws the color in a loop repeatedly until it changes to the other color. Like creating three different varaibles and incremeting the green variable from 0 to 255. Is that a good way of doing it?? Here's some of the code(I haven't quite yet created the loop)... Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As _ System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim graCurrent As Graphics = e.Graphics Dim recCurrent As Rectangle, colCurrent As Color Dim sbCurrent As SolidBrush, penCurrent As Pen Dim intHeight As Integer, intWidth As Integer recCurrent = New Rectangle(0, 0, Me.Width, Me.Height) sbCurrent = New SolidBrush(Color.Green) graCurrent.FillRectangle(sbCurrent, recCurrent) Dim CounterLoop As Integer = 1 intHeight = 0 For intwidth = 0 To Me.Width Step _ ToInt32(Me.Width / 255) penCurrent = New Pen(Color.FromArgb(0, 0, 0, 0)) Select Case CounterLoop Case 1 colCurrent = Color.FromArgb(0, 0, 0, 0) CounterLoop += 1 Case 2 colCurrent = Color.FromArgb(0, 0, 1, 0) CounterLoop += 1 Case 3 colCurrent = Color.FromArgb(0, 0, 2, 0) CounterLoop += 1 Case 4 colCurrent = Color.FromArgb(0, 0, 3, 0) CounterLoop += 1 Case 5 colCurrent = Color.FromArgb(0, 0, 4, 0) CounterLoop += 1 Case 6 colCurrent = Color.FromArgb(0, 0, 5, 0) CounterLoop += 1 Case 7 colCurrent = Color.FromArgb(0, 0, 6, 0) CounterLoop += 1 Case 8 colCurrent = Color.FromArgb(0, 0, 7, 0) CounterLoop += 1 Case 9 colCurrent = Color.FromArgb(0, 0, 8, 0) CounterLoop += 1 Case 10 colCurrent = Color.FromArgb(0, 0, 10, 0) CounterLoop += 1 End Select graCurrent.DrawLine(penCurrent, 0, ToInt32(Me.Height / 180), _ ToInt32(Me.Width / 255), 0) Next End Sub End Class Ty -- modified at 10:04
The form is 510 by 360. One half of it has to go from black to green. The other Half from blue to black. I think you're supposed to create a loop of some sort to change each line using the pen. But How?? Remember I am only a beginner so, i know only the basics of VB.net. E-mail me at tate_thomasster@gmail.com and i can give you the source code to see if you can point out my mistakes. If you are familar with the Thomson Course Technology book, Visual Basic.Net: An object-oriented approach, then it is Chapter 6, Exercise 2. This is my first time working with Vb.Net. Ty
[Message Deleted]