|
I don't like ClickOnce, I am using a Windows Installer Setup project to deploy.
|
|
|
|
|
Then you'r going to have to write the code to check a website yourself. The website should have an XML file for version information and a download package available. This package would have to be unpacked and installed on the client side, but from a seperate executeable, not your main EXE. This is because you can't overwrite an EXE while it's running.
The web information can be had by using the WebRequest class, along with downloading the file. Launching a seperate process is easy with the Process class. XML file processing is also easy with the XmlDocument class and XPath.
|
|
|
|
|
Hi Everyone:
This problem has been plaguing me for three days, and I can’t for the life of me find a logical reason why this problem occurs.
My problem occurs when I try to write data into a dataset that contains nothing more than the table schema.
This subroutine is supposed to write a new record into the dataset.
Private Sub New_Bindings(ByVal intOrdinal As Integer, _
ByVal strCode As String, _
ByVal strName As String)
tblBindings = MyDataSet.Tables("tblBindings")
drCurrent = tblBindings.NewRow()
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
tblBindings.Rows.Add(drCurrent)
End Sub
I write new data into the dataset when this subroutine is activated. It is activated when the Private Sub BindingNavigatorAddNewItem_Click event is triggered: The AddNew Button on the BindingNavigator control on the form.
Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
Call New_Bindings(1, "SDLS", "Saddle-stitch")
Call New_Bindings(2, "SPRL", "Spiral Bound")
Call New_Bindings(3, "STUL", "Staple Upper Left")
Call New_Bindings(4, "STUR", "Staple Upper Right")
Call New_Bindings(5, "ST2L", "Two Staples on left side")
End Sub
The dataset’s data should read like this:
BindingID – 1
Ordinal – 1
Code – SDLS
Name – Saddle-stitch
BindingID – 2
Ordinal – 2
Code – SPRL
Name – Spiral Bound
BindingID – 3
Ordinal – 3
Code – STUL
Name – Staple Upper Left
BindingID – 4
Ordinal – 4
Code – STUP
Name – Staple Upper Right
BindingID – 5
Ordinal – 5
Code – ST2l
Name – Two Staples on Left Side
What I am actually getting is:
BindingID – 0
Ordinal – 1
Code – SDLS
Name – Saddle-stitch
BindingID – 1
Ordinal – 2
Code – SPRL
Name – Spiral Bound
BindingID – 2
Ordinal – 3
Code – STUL
Name – Staple Upper Left
BindingID – 3
Ordinal – 4
Code – STUP
Name – Staple Upper Right
BindingID – 4
Ordinal – 5
Code – ST2l
Name – Two Staples on Left Side
For some reason when the first record is written out to the dataset the auto increment field (BindingID) is not incremented to one when the record is written. It has an ID of “0” which logically can’t happen when the column has been defined to be an auto increment column starting at one and incrementing by one every time a new record is added.
Can anyone tell me why this is happening and what I need to do to correct it?
Thanks,
Quecumber256
|
|
|
|
|
Quecumber256 wrote: tblBindings = MyDataSet.Tables("tblBindings")
drCurrent = tblBindings.NewRow()
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
tblBindings.Rows.Add(drCurrent)
Wow I just saw something here.
You need to do the following instead.
drCurrent = MyDataSet.Tables("tblBindings").NewRow()
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
MyDataSet.Tables("tblBindings").Rows.Add(drCurrent) That is one issue. The other I still cant see based on what you provided.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Cleako:
Just to let you know I appreciate your help.
I tried your fix. I still get the same results. Therefore I'm providing you the entire code for the data entry form. I hope this give you enough information to see what is causing the first record to not be recorded properly.
Option Explicit On
Imports System.Data.SqlClient
Public Class frmBindings
Private Msg As String
Private strSQL As String
'Declare the SQLDataAdapter and DataSet objects
Private daBindings As New SqlDataAdapter()
Private MyDataSet As New DataSet()
Dim tblBindings As DataTable
Dim drCurrent As DataRow
Private Sub Clear_Form()
txtBindingCode.Text = Nothing
txtBindingName.Text = Nothing
txtOrdinal.Text = Nothing
End Sub
Private Sub Load_DataSet()
'Connect to the SQL Server database
Dim cn As SqlConnection = New SqlConnection((My.Settings.PrintsByMe_DevConnectionString))
cn.Open()
'Retrieve the data using a SQL statement
strSQL = "SELECT * FROM [tblBindings];"
Dim cd As New SqlCommand(strSQL, cn)
'Set the database connection for MySqlDataAdapter
daBindings.SelectCommand = cd
'Fill the DataSet and DataSet Schema
daBindings.FillSchema(MyDataSet, SchemaType.Source, "tblBindings")
daBindings.Fill(MyDataSet, "tblBindings")
'Close database connection
cn.Close()
'Set the BindingNavigator's DataSource to the DataSet we created.
bsBindings.DataSource = MyDataSet
'Set the BindingSource Datamember to the table we are using.
bsBindings.DataMember = MyDataSet.Tables(0).TableName()
'Bind form control txtBindingID to the BindingID field
txtBindingID.DataBindings.Add("Text", bsBindings, "BindingID")
'Bind form control txtOrdinal to the Ordinal field
txtOrdinal.DataBindings.Add("Text", bsBindings, "Ordinal")
'Bind form control txtBindingCode to the BindingCode field
txtBindingCode.DataBindings.Add("Text", bsBindings, "BindingCode")
'Bind form control txtBindingName to the BindingName Field
txtBindingName.DataBindings.Add("Text", bsBindings, "BindingName")
End Sub
Private Sub New_Bindings(ByVal intOrdinal As Integer, _
ByVal strCode As String, _
ByVal strName As String)
drCurrent = MyDataSet.Tables("tblBindings").NewRow()
drCurrent("Ordinal") = intOrdinal
drCurrent("BindingCode") = strCode
drCurrent("BindingName") = strName
MyDataSet.Tables("tblBindings").Rows.Add(drCurrent)
'Call Clear_Form()
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnExit.Click
Me.Close()
End Sub
Private Sub frmBindings_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Call Load_DataSet()
naviBindings.BindingSource = bsBindings
End Sub
Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles BindingNavigatorAddNewItem.Click
'Call New_Bindings(CInt(txtOrdinal.Text), txtBindingCode.Text, txtBindingName.Text)
Call New_Bindings(1, "SDLS", "Saddle-stitch")
Call New_Bindings(2, "SPRL", "Spiral Bound")
Call New_Bindings(3, "STUL", "Staple Upper Left")
Call New_Bindings(4, "STUR", "Staple Upper Right")
Call New_Bindings(5, "ST2L", "Two Staples on left side")
End Sub
End Class
Thanks again,
Quecumber256
|
|
|
|
|
I dont think you're doing anything wrong, at least nothing obvious. Just curious, have you actually tried to send the updated dataset to the database to see what happens?
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
No, I haven't. In a prior message I tried to add new records to the end of the dataset. I was afraid to commit the updates because the dataset was hosed up.
Secondly - I need to add another button to the BindingNavigator control for updating purposes. I have to create a new image(Update) for this new button to indicate that when this button is activated it will commit the updates to the SQL Server database. I also need to write the updating code. I have put this off until I'm satisfied that the data in the dataset is represented properly.
Thanks,
Quecumber256
|
|
|
|
|
Im just curious if the database/dataadapter connection will help resolve the ID issue because you have to think of other situations where a company has 15 apps going all with in memory datasets, how does it resolve the ID's when they're updated? It has to let SQL Server or whichever database handle the "REAL" ID's (or at least I would think so).
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
I don't think that will be a problem with this particular application. This application is just a tool to help the administrator with data management.
For-what-its-worth: Here is the T-SQL script for the table I'm having trouble with.
CREATE TABLE Tool_Dev.dbo.tblBindings
([BindingId] INT IDENTITY (1,1) PRIMARY KEY,
[BindingCode] CHAR(4) NOT NULL,
[Ordinal] INT NOT NULL,
[BindingName] VARCHAR(50) NOT NULL)
Thanks,
Quecumber256
|
|
|
|
|
Due to a lack of funds, I have been trying to use the free obfuscators for a .net assembly.
Skater Lite doesn't seem to do anything - I select the assembly to open, click the button and nothing happens. Their support team did however respond to this query with an immensely helpful reply (relevant section below)
Open your .NET assembly (dll or exe) by using "Open" dialog box. On the Info
Tab page you able to browse main assembly properties and the assembly structure as well.
Apsose Obfuscator appears to do something - at least it's busy for a minute or two. It generated something in the output/temp folder and produces a new .exe version of my app.
"Great" I thought. I then got out Reflector to have a look at this file and it produced very readable "source" code with all my original variable/method names.
Does anyone have similar experiences or any suggestions?
At the moment it's a chicken and egg situation - if I could obfuscate my code I could maybe sell a few copies, make some money and buy a decent obfuscator!!!
Cheers,
Rich
|
|
|
|
|
Didnt you try Dotfuscator..???
Cheers,
Suresh
|
|
|
|
|
Not included in VS Express and I don't have the cash for the standard edition.
Using the trial version of Dotfuscator, I believe the licence prohibits use for commercial purposes.
Rich
|
|
|
|
|
My program is patterned after the excellent article by Sujith C. Jose entitled "How to use Stored Procedures in VB6." My stored procedure follows:
CREATE PROCEDURE empdetails (@empid varchar(9), @lastname varchar(18),
@firstname varchar(18), @deptno varchar(30), @deptname varchar(30))
AS
UPDATE sysadm.table001
SET I0013=@firstname
WHERE I0010 = @empid
GO
My VB6 code(edited) is:
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As ADODB.Command
Dim str_empid As String, strconnect As String
Dim lastname As String, firstname As String, deptno As String, deptname As String
Dim str_lastname As String, str_firstname As String, str_deptno As String, str_deptname As String
Private Sub Form_Load()
strconnect = "Provider=SQLOLEDB; Data Source=esp; Initial Catalog=DMTESTDB"
con.Open strconnect, "sysadm", "sysadm"
str_empid = Field0
str_lastname = Field1
str_firstname = Field2
str_deptno = Field3
str_deptname = Field4
Set cmd = New ADODB.Command
cmd.ActiveConnection = con
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "empdetails"
cmd.Parameters.Append cmd.CreateParameter("empid", adVarChar, adParamInput, 9, str_empid)
cmd.Parameters.Append cmd.CreateParameter("lastname", adVarChar, adParamInput, 18, str_lastname)
cmd.Parameters.Append cmd.CreateParameter("firstname", adVarChar, adParamInput, 18, str_firstname)
cmd.Parameters.Append cmd.CreateParameter("deptno", adVarChar, adParamInput, 30, str_deptno)
cmd.Parameters.Append cmd.CreateParameter("deptname", adVarChar, adParamInput, 30, str_deptname)
Set rs = cmd.Execute
Set cmd.ActiveConnection = Nothing
con.Close
End Sub
My stored procedure works fine in SQL Query Analyzer; I believe my database DMTESTDB opens correctly w/o error (because if I change the password, I generate an error message); and in the cmd.Parameters.Append section, the str_ variables are correctly filled from a part of the program not shown. The cmd.Execute statement runs, but does not result in a successful Update of the database table. (I did "grant" the EXEC permission in my SP for that password).
What am I missing here? I'm stumped.
|
|
|
|
|
Since it runs without errors my first thought is to check the value being passed for str_empid for the @empid paramiter.
You are updating WHERE I0010 = @empid, if the value for @empid doesn't match any values in your table then nothing happens.
topcoderjax
|
|
|
|
|
You nailed it! Needed to LTrim leading blanks in str_empid or RTrim trailing blanks in the table. Works fine. Tx.
|
|
|
|
|
vb.net
in a datagrid's dropevent, how can i find out, in which row the user droped? i tried to find out the row with hit-test in my dropevent, but as rowindex '-1' is given back to me.
|
|
|
|
|
|
Using Visual basic 6.0, I want to format a date and foce the date to have the AM/PM indicator, it seems as though it does not always show up
An example:
? format(now(),"m/dd/yyyy hh:mm:ss")
5/21/2007 08:32:48
|
|
|
|
|
never mind, jsut figured it out just add the AM/PM to the format part of teh string...
|
|
|
|
|
Dim param12 As New ParameterizedThreadStart(AddressOf paeamthread)
Dim arr1(3) As String
arr1(0) = "trial"
arr1(1) = "parameter"
arr1(2) = "passing"
Dim tt As New Thread(AddressOf param12)
tt.Start(arr1)
paeamthread is a method with object type parameter
i am just trying to change the code from a sample c#project from our code project
wat i have to do to correct the error
it shows error at
Dim tt As New Thread(AddressOf param12) as 'AddressOf' operand must be the name of a method (without parentheses).
pls help me
with regards
Balagurunathan.B
|
|
|
|
|
You don't have a method in your code called "param12". What's the name of the method you want this thread to start on? What does the code look like defining it?
|
|
|
|
|
this is the sample code from which i tried.its from a codeproject article
now tell me the way in which i can use parameterizedthreadstart
there param12 is object of parameterizedthreadstart
ParameterizedThreadStart pts = new ParameterizedThreadStart(MyParameterizedMethod);
Thread t = new Thread(pts);
double d = 123d;
ArrayList al = new ArrayList();
al.Add("Hei");
al.Add(2);
t.Start(al);
WaitCallback myCallback = new WaitCallback(MyParameterizedMethod);
if (!ThreadPool.QueueUserWorkItem(myCallback, al))
{
throw new Exception("Not able to queue work item");
}
private void MyParameterizedMethod(Object o)
{
ArrayList al = (ArrayList) o;
String param1 = (String) al[0];
int param2 = (int)al[1];
}
with regards
Balagurunathan.B
|
|
|
|
|
Cute and all, but this isn't YOUR code. This is the code you're trying to make work.
I want to see YOUR code.
|
|
|
|
|
yeah true. i never said u thats my code
i have already posted the code now again i am pasting the code
Dim param12 As New ParameterizedThreadStart(AddressOf paeamthread)
Dim arr1(3) As String
arr1(0) = "trial"
arr1(1) = "parameter"
arr1(2) = "passing"
Dim tt As New Thread(AddressOf param12)
tt.Start(arr1)
then why its saying method should be without parameter in thread . its obvious for normal thread i am trying to do parameterizedthreadstart
thanks
with regards
Balagurunathan.B
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim newThread As New Thread(AddressOf worker)
Dim arrParameters(2) As String
arrParameters(0) = "This "
arrParameters(1) = "is "
arrParameters(2) = "a test!"
newThread.Start(arrParameters)
End Sub
Private Sub worker(ByVal param As Object)
Dim params() As String = DirectCast(param, String())
For Each s As String In params
Debug.WriteLine(s)
Next
End Sub
In order to use this, you have to be using .NET 2.0 and VB.NET 2005.
|
|
|
|
|