|
This[^] is the best your going to get. We're in the business of supplying finished code to do things.
|
|
|
|
|
Thanks God I shouldn't pay Google for that.
Listen, I don't say I want it for free!
Are you just in a bad mood?!
|
|
|
|
|
No. It's just you're about the 5 millionth person to show up saying "I want code for ____!".
I believe in writing your own code so you can learn. You're also asking for something that is very rarely ever used. You're not likely to find prewritten code for this.
|
|
|
|
|
what's the vb.Net counterpart of the following blocks in Csharp?
public class NullableDateTimePicker : System.Windows.Forms.DateTimePicker
{
public NullableDateTimePicker() : base()
{
base.Format = DateTimePickerFormat.Custom;
NullValue = " ";
Format = DateTimePickerFormat.Custom;
CustomFormat = "dd MMM yyyy";
this.DataBindings.CollectionChanged += new CollectionChangeEventHandler(DataBindings_CollectionChanged);
}
}
class DateTimePickerEditingControl : NullableDateTimePicker, IDataGridViewEditingControl
{
public DateTimePickerEditingControl()
{
this.Format = DateTimePickerFormat.Custom;
this.CustomFormat = "dd MMM yyyy";
}
}
|
|
|
|
|
You know, that there are tools for conversing code from C# to VB.Net, do you? Just google for them.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Never mind. I was making a small mistake.
In block 1 it should be:
MyBase.New
In block 2 it should be:
class DateTimePickerEditingControl<br />
Inherits NullableDateTimePicker<br />
Implements IDataGridViewEditingControl<br />
End Class
I was writing this in the first place:
class DateTimePickerEditingControl<br />
Inherits NullableDateTimePicker, Implements IDataGridViewEditingControl<br />
End Class
|
|
|
|
|
|
Greetings everyone,
I'm going through Stephen Toub's book "Patterns of Parallel programming" to try and figure out the different tips and tricks of parallel programming.
Besides having found few minor errors in the book already, I'm stuck on the example described on page 71:
Public Const NUM_STEPS As Integer = 1000000
Shared Function ParallelLinqPi() As Double
Dim [step] = 1.0 / CDbl(NUM_STEPS)
Return ParallelEnumerable.Range(0, NUM_STEPS).Select(
Function(i)
Dim x = (i + 0.5) * [step]
Return 4.0 / (1.0 + x * x)
End Function).Sum() * [step]
End Function
The VS underlines this whole chunk of code and explains the following:
"Overload resolution failed because no accessible 'Sum' accepts this number of arguments."
Apparently, the Sum() function at the end needs to have a selector (selector As System.Func(of Object,Double)). There is no mention of this in the book =(
What should I write inside the Sum, to make this example work, any ideas?
Thanks...
Agarwaen
|
|
|
|
|
The code you posted works perfectly in VS 2010. Are you using 2005 or 2008?
|
|
|
|
|
I use VS 2010 and get the error described in my message above. That is why I'm stumped, because according to the book it should work, but it doesn't =(
Perhaps I need to import some specific namespace ? If so plz tell me which one...
|
|
|
|
|
Are you using one of the 2010 Betas? I tried it on the VS2010 RC1 release, just created a new standard Console app, typed the code in and it worked.
The only namespace required is System.Linq .
|
|
|
|
|
Darn it, I've figured it out...
Here's how the code should look like:
Public Const NUM_STEPS As Integer = 1000000
Shared Function ParallelLinqPi() As Double
Dim [step] = 1.0 / CDbl(NUM_STEPS)
Return ParallelEnumerable.Range(0, NUM_STEPS).Select(
Function(i)
Dim x As Double
x = (i + 0.5) * [step]
Return 4.0 / (1.0 + x * x)
End Function).Sum() * [step]
End Function
Small errors as this one in the book are beginning to drive me nuts =(
Thank you for your effort Dave Kreskowiak.
*Back to reading the book /*
Agarwaen
|
|
|
|
|
Odd. I used the code EXACTLY (verified 3 times by 2 people) as you originally posted it and it worked fine.
|
|
|
|
|
Dear,
since iam new to vb.net,please help me to pass parameter to for my VB.net project,
here is my code for passing parameter to stored procedure
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim combo As String
Dim SQLEV As SqlClient.SqlConnection = New SqlClient.SqlConnection
SQLEV.ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=db_chart;server=nrppc-mis1\sqlexpress"
combo = ComboBox1.SelectedValue.ToString
Dim command As New SqlCommand("usp_Procedure", SQLEV)
Dim adapter As New SqlDataAdapter(command)
command.CommandType = CommandType.StoredProcedure
With command.Parameters
.Add(New SqlParameter("@Ridfrom", SqlDbType.NVarChar))
.Add(New SqlParameter("@PidTo", SqlDbType.Money)).Direction = ParameterDirection.Output
.Add(New SqlParameter("Returnvalue", SqlDbType.Int)).Direction = ParameterDirection.ReturnValue
End With
End Sub
this is my stored procedure
ALTER PROCEDURE usp_Procedure
@Ridfrom nVarChar(50),
@PidTo nVarchar(20) output
AS
SELECT @PidTo = ProcDetails.Procedure_ID
FROM ReportMaster INNER JOIN
ProcDetails ON ReportMaster.Procedure_ID = ProcDetails.Procedure_ID
WHERE ReportMaster.Report_ID = @Ridfrom
RETURN
|
|
|
|
|
What is the problem apart from the fact that you never execute the command?
You should open an SQLDataReader using
myDataReader = command.ExecuteReader
to get the result of the stored procedure
|
|
|
|
|
Hello ,
I wanna create an VB6 Appln, in which each number between 0-9 has different forecolor .And when the number is pressed specified forecolor for that number should set in cell.Eg: If 0 = Red, 1=Green, 2 =Blue. When 0 is pressed its forecolor should be red and when 1 is pressed its forecolor should be Green and so on. And When 12 is pressed 1=Green and 2=Blue. Can anybody help me to achieve this.Any suggestion Appreciated.What should i start with?
Regards
Rizwan
|
|
|
|
|
mdrizwan_1 wrote: I wanna create an VB6 Appln,
A what? Are you saying that you want to create an Excel AddIn in VB6?
|
|
|
|
|
Hello Dave Kreskowiak,
Thanks for your response. You may assume it as an AddIn. Its a mini project where i can enter number with different colors and save it in Excel or any supportable format. and it should be editable. Any suggestion appreciated?
Regards
Rizwan
|
|
|
|
|
I've never written an Excel AddIn in VB6 and I recommend you don't either. I'd use something far more up-to-date, like VB.NET. You can find examples with a little application of Google. Here...[^]
|
|
|
|
|
Hello Dave,
Thanks for the link .Can you help me for a start ???
Regards
Rizwan
|
|
|
|
|
I already did with the links. I've never written an Excel AddIn, nor have I touched VB6 in about 8 years.
|
|
|
|
|
Thanks for it Dave.
Regards
Rizwan
|
|
|
|
|
Hi All
I Want To Sort The DataGridView by Design And Code
pls Send Me a Code As Sample
Thanks
Thaer
|
|
|
|
|
In what way is the build-in DataGridView sort function not adequate?
|
|
|
|
|
See here.
My signature "sucks" today
|
|
|
|