|
|
Hi every one
I 'm using SQL DMO to connect database in my computer
But i can't connect to my database
Here my code:
Dim sever As New SQLDMO.SQLServer
sever.LoginSecure = True
sever.Connect("local")
how to connect to my local sever
I'm using SQLEXPRESS
thanks
|
|
|
|
|
this[^] contains the magic line you need to connect.
|
|
|
|
|
There's a walkthrough here; http://www.sqldbatips.com/showarticle.asp?ID=34.
Your server-instance is probably named "(local)\SQLEXPRESS"
I are Troll
|
|
|
|
|
Please help me to answer the following question! Thanks!
1.In VB.NET, when datasource of datagridview = datatable(Datatable contains data).On the datagridview display a grid of data ,the end row is empty.
What type of value of the cells on this row in VB.NET?How to check ?
2.Can I make the end row disappear?
|
|
|
|
|
2. Set:
DataGridView1.AllowUSerToAddRows = False
and
DataGridView1.AllowUserToDeleteRows = False
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hi,
I'm currently having a big problem with freehand drawing.
I want to do the following thing: I want to draw 2 freehand lines both with different colors and I need the final line to be on the top of the other lines created before. To store the lines I use 2 GraphicsPath objects, one GraphicsPath per color.
I tried to solve this problem by using two arrays like this:
Public MousePath0() As System.Drawing.Drawing2D.GraphicsPath
Public MousePath1() As System.Drawing.Drawing2D.GraphicsPath
My idea was to make a system which will remember the order of all lines and draw them correctly, but when I add an graphics path to the array and when I try to add line to this graphics path VB 2008 gives me an error "Object reference not set to an instance of an object."
Please help, I don't want to use exactly a GraphicsPath for the lines, it can be something different.
Thank you!
|
|
|
|
|
Hello All,
I am hoping someone could steer me in the right direction with a problem I am having.
I created a small app that sucessfully consumes a Web Service and traps the response. I am able to read individual pieces of the document but when it comes to arrays, I am having the most difficult time.
Below I have posted the XML response and what I am looking to store is the values in ref1 and ref2. But I don't know how to get at them. I see a reference to these 2 elements in the SearchServiceNames and ServiceLastModificationDates tags but I am totally lost on how to read and hook the two up.
Any help would be most appreciated. I thank you for your time and comments.
<?xml version="1.0"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:GetSearchServicesResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.dwdev.com/Webservices/Freezerworks/">
<SearchServicesCount>3</SearchServicesCount>
<SearchServiceNames href="#ref-1"/>
<SearchServiceLastModificationDates href="#ref-2"/>
</ns1:GetSearchServicesResponse>
<SOAP-ENC:Array SOAP-ENC:arrayType="xsd:string[3]" id="ref-1">
<item>GetIDs</item>
<item>russtest</item>
<item>russtestservice</item>
</SOAP-ENC:Array>
<SOAP-ENC:Array SOAP-ENC:arrayType="xsd:date[3]" id="ref-2">
<item>2009-11-17</item>
<item>2009-11-16</item>
<item>2009-11-16</item>
</SOAP-ENC:Array></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
|
|
|
|
Hello To All,
In My application i have provide the facility to Use directoly when Computer is log in. So i add the application to Startup in Registry. So my application is blocked by antivirus.
But Other application which are in Startup are not Blocked By Antivirus.
so please help me for How to Secure my application to Antivirus. And Give me the reason for that why antivirus not detecting those applications which are Add in Startup.
If you can think then I Can.
modified on Thursday, December 10, 2009 11:18 PM
|
|
|
|
|
Add an exception to your antivirus for your application.
See how generic of an answer that was? See how it's frustrating?
It's the same thing for me with your generic question.
|
|
|
|
|
Excellent.
|
|
|
|
|
Ok, here is the question
I have an array with let's say, the following values :
17
18
0
0
24
23
0
20
0
0
0
16
I need to approximate(average) the ZERO values to the non zero values.For example i would expect the 0 between the 23 and the 20, to become 21.5.
Or the first 2 zeros to be 20 and 22.
Can you help ?
It should be easy but i am completely stuck in here.
|
|
|
|
|
Johnkokk wrote: It should be easy but i am completely stuck in here.
This is simple mathematics. Add up the numbers surrounding the zeros and calculate the average (by division). Replace the zeros with the average values. Try doing it with pencil and paper to see how it can be achieved.
|
|
|
|
|
It's not really the average, though, if I've understood the question.
The sequence 23, 0, 20 becomes 23, 21.5, 20.
18, 0, 0, 24 becomes 18, 20, 22, 24
20, 0, 0, 0, 16 becomes 20, 19, 18, 17, 16.
Not sure what the technical term for that is. Interpolation? Even so, it is still simple maths. The only tricky bit is handling the end conditions if a 0 occurs at the first or last position in the array.
|
|
|
|
|
David Skelly wrote: It's not really the average, though, if I've understood the question.
You're right of course, I was confused (quite easy thing to do) by the questioner using the expression "approximate(average)".
|
|
|
|
|
David Skelly wrote: Interpolation
Ding ding ding! Winner winner chicken dinner!
|
|
|
|
|
Ok, we established that what i need, is some sort of linear interpolation.
Any ideas ?
|
|
|
|
|
Dim arr() As Single = {17, 18, 0, 0, 24, 23, 0, 20, 0, 0, 0, 16}
Dim idx1 As Int16 = -1, idx2 As Int16 = -1
Dim FoundAZero As Boolean = False
For i As Int16 = 0 To arr.GetUpperBound(0)
If Not FoundAZero Then
If arr(i) = 0 Then
FoundAZero = True 'once we find an zero the else will be used below until we find the next non zero
Else
idx1 = i 'hold on to the index every non zero
End If
Else
If arr(i) <> 0 Then '
idx2 = i 'hold on to the index of the non zero
'--------------------------------------
'get the value that's held in both indexes
Dim val1 As Int16 = arr(idx1), val2 As Int16 = arr(idx2)
Dim IncVal As Single
'increment value is non zero 1 minus non zero 2 / the number of zeros between
'the * -1 is whether or not we need to increment up or down depending on values of the array
If val1 < val2 Then
IncVal = (val2 - val1) / (idx2 - idx1)
Else
IncVal = ((val1 - val2) / (idx2 - idx1)) * -1
End If
For x As Int16 = idx1 + 1 To idx2 - 1
arr(x) = arr(x - 1) + IncVal 'replace the 0 inbetween both indexes with the incremented value
Next
'--------------------------------------
idx1 = idx2 'take the last none zero and set it to the first hold as we continue down the array
FoundAZero = False 'reset finding a zero flag
End If
End If
Next
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Ok, the code above works almost perfectly.
THe only problem is that if the first position of the array is populated with 0, it crashes at " Dim val1 As Int16 = arr(idx1)", because idx1 remains -1
Thanks.
|
|
|
|
|
I understood that when I wrote but I figured it wouldn't be possible to have the array start with a zero or end with one because how can you figure out what those should be. I guess you could take the number to the right of the 0 and divide by 2 but wasn't sure if that's what should happen.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Then add some error checking. Assuming you put this code in a method, you can do the check at the right at the top of the method to make sure that the parameter a) is not nothing, b) does not start with a zero, and c) does not end with a zero and throw the appropriate exception. Like so:
Private Sub Interpolate(ByVal values() As Single)
If values Is Nothing Then Throw New ArgumentNullException("values")
If values.Length = 0 Then Exit Sub
If values(0) = 0 Then
Throw New ArgumentException("Value array cannot start with a 0.", "values")
End If
If values(values.Length - 1) = 0 Then
Throw New ArgumentException("Value array cannot end with a 0.", "values")
End If
End Sub
|
|
|
|
|
You may want to turn on Option Strict. When you use val1 and val2 as integers, you will produce incorrect results if one of the non-zero values has a decimal component. Also, I would recommend using Integer instead of Int16 for the index variables as turning on Option Strict will cause errors for both of your loop declarations.
|
|
|
|
|
Hmmmmm... chicken!
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel] | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server
|
|
|
|
|
How to get Hexadecimal code of unicode character
|
|
|
|
|
Hi,
I would cast or convert to integer, then use ToString("X4")
|
|
|
|