|
Can u please forward me the coding please....
Preethi
preethishivbaba
|
|
|
|
|
Is that anyway to write to csv file start from specific line of record? Let say start from the third line of the csv file.
|
|
|
|
|
CSV file is just normal textfile with coma. u can use streamreader to get all the lines in the file!
I am Entry level person
|
|
|
|
|
I know csv is a comma-separated file and i would like to write data into it start from certain line and not read from it. Anyway, thanx for help!Could anyone pls give better suggestion?
|
|
|
|
|
Thanks Guffa,
I am trying what you said, but it doesn't work yet.
I set the datatype of the session.sessionID as nvarchar(MAX), but i am not sure whether i am right or wrong. I can input the sessionID into my database on the design page, but when i go to the shopping cart page, there is a big problem, says "Input string was not in a correct format", and "Source error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below".
So what can i do now? change the sessionID datatype to the uniqueidentifier?? but i think i did try, but failed as well.
Please help, thanks
Happy New Zealand Labour's day!!;)
Jackie Ding
|
|
|
|
|
Hi,
I think i have already fixed this problem, i just forgot to change the parameters in the dataset.
Anyway, thank you for your help, Kumar and Guffa. Your suggestions were really helpful!!!
Cheers,
Jackie Ding
|
|
|
|
|
Hi there,
I am borned with .NET era (I meant that I started coding when .NET came out). I have a need to catch the windows property such as position, layer, side, handle ... I have done some research and see most solution is dealt with WIN API 32 which is a very strange animal to me.
Question: do I realy need to learn Windows API in order to deal with my needs above? or does .NET has any class that I can use instead Win API? I am so sick when I see those API books. they are terribly THICK!!!!!
Any advise is greatly appreciated
If you think that I need to deal with damn API, and you also know where are good sites of API such as API for dummies please give me those links.
Hope yo all have a happy coding.
Paula john
|
|
|
|
|
No, it can't. Not yet anyway. The .NET Framework is, amoung other things, a wrapper for the Win32 API.
For what you're asking about, the Win32 API is the only way to go. If you want examples, look at http://www.pinvoke.net[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the advise. Bill is not really doing quite a good job huh? don't you think?
have a good d
|
|
|
|
|
|
Hi there,
If you add the calendar control into the form, and from there, you can tell if that is a leap year or not.
I may be wrong but I think the calendar control class will return some boolean that states wherether select year is a leap year such as
Messagebox.show(ctrCalendar.selectedate.Isleapyear)
Good luck
|
|
|
|
|
that will work fine, I forgot to specify that I need to do that with my own codes, only using if, else if in the code and textbox for input and another textbox for output and a button.
Thanks for your help though
|
|
|
|
|
You can use the modulo operator to find out if a number is divisible by another. The expression x mod y returns zero if x is divisible by y.
That should be enough to get you started.
---
b { font-weight: normal; }
|
|
|
|
|
I have something but it's not quite right, because years ending with 00 before de decimal are not leap years (example 1700 1800 1900 or even 2000000 as long as it has 00) I don't know how to do that. Also thanks for your help Guffa.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim y As Integer
y = TextBox1.Text
If y Mod 4 = 0 Then
TextBox2.Text = "is leap"
ElseIf y Mod 400 = 0 Then
TextBox2.Text = "is leap"
Else
TextBox2.Text = "isn't leap"
End If
End Sub
|
|
|
|
|
Nevermind I got it
|
|
|
|
|
Hi,
I have a generic class to persist any kind of object to a SQL table using PropertyInfo.GetValue to read the values - but it doesn't work if the property is a Nullable(Of ...) type and the value is not set - I get a "Nullable value must have a value" error.
Any ideas how I can modify
Dim val As Object = PropertyInfo.GetValue(ClassInstance, Nothing)
so it can cope with empty nullable types?
Thanks in advance
|
|
|
|
|
I need help in MYSQL and VB.NET.
How can i insert the datetime of my computer into Sql database?No mater how i convert the date, it does'nt work.
Here is the code:
Dim PurDate As Date
PurDate = Date.Now()
Dim strInsSales As String
strInsSales = "Insert into Testing Values(" & PDate & ")"
And the value store into SQL is "1900-01-01 00:00:00.000"
Anyone can help me in this problem?
|
|
|
|
|
There are two errors in the code. You have forgotten the apostrophes around the value, and you are not using the same variable as the one that you put the value in. Also, you should specify a format when converting the date to a string, not just using the default format, as that can be juat about anything.
strInsSales = "Insert into Testing Values('" & PurDate.ToString("yyyy-MM-dd HH:mm:ss") & "')"
Better yet, you should use a parameterized query.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa, i hv solve d the problem right now.
However, another problem is occured.
After i insert the date into Sql database, then i need to retrieve the date and compare with the user input's date.
Dim SDate as string
SDate = year & "-" & month & "-" & day
Eg: user input is : 2006-10-22
Also, SqlDate is : 2006-10-22 23:59:52.000
SDate = Convert.ToDateTime(SDate).ToShortDateString
SqlDate = Convert.ToDateTime(SqlDate).ToShortDateString
If (SDate = SqlDate) Then
valid = True
End If
However, it give me a false value, even the date are equal.
How should i solve this problem?
Thanks again...
|
|
|
|
|
Hi there,
On the SDate Variable, you can use the format method from VB6 class to truncate the time such as
Vb6.format(SDate,"yyyy-mm-dd")
Have a happy coding
|
|
|
|
|
Thanks paulajohn, i have solved the problem!
|
|
|
|
|
any one know how to make an application that can run without .net framework?
|
|
|
|
|
xmen_xwk wrote: any one know how to make an application that can run without .net framework?
You can't while you are using VB.NET or C# out of the box. (There are some very expensive solutions that will "static" link .NET)
If you want to write an app that doesn't use the .NET framework, then you'll need to use VB6 or unmanaged C++.
|
|
|
|
|
ok
|
|
|
|
|
Hello,
I have a program that when a user logs in they will only be able to do certain things based on there user privilege. Example, low, medium, and full access.
If the user has low then they can only view, if the use has medium they can edit and add, if they have full then they can do everything.
The buttons will be disabled for actions that they cannot do.
In the database, i have entered their privileges as low, med, or full.
I am not sure if this is the best way to do this, but before each form is loaded, i check there privileges by quering the database. Then disabling button based on their user privilege.
As this is my first time i have done this, I would like to know how this is done in the real world. Is there is a more efficient method of doing this.
Many thanks in advance,
Steve
|
|
|
|