|
I don't know why, but I used this set of cade and now my problem is fixed.
'Create the ODBC objects
Dim OdbcCon As System.Data.Odbc.OdbcConnection
OdbcCon = New System.Data.Odbc.OdbcConnection
'Set up Connection String
OdbcCon.ConnectionString = _
"Driver={SQL Server};Server=" & _
pserver & ";Database=" & database & _
";Uid=" & puserid & ";Pwd=" & password
'Open the connection
OdbcCon.Open()
Dim OdbcCmd As OdbcCommand = OdbcCon.CreateCommand()
OdbcCmd.CommandText = "{ call AddMember(?,?,?,?) }"
Dim param As New OdbcParameter
param.DbType = DbType.Decimal
param.Value = 12
OdbcCmd.Parameters.Add(param)
param = New OdbcParameter
param.DbType = DbType.String
param.Value = "Mikey Ward"
OdbcCmd.Parameters.Add(param)
param = New OdbcParameter
param.DbType = DbType.String
param.Value = "444229999"
OdbcCmd.Parameters.Add(param)
param = New OdbcParameter
param.DbType = DbType.StringFixedLength
param.Value = "Y"
OdbcCmd.Parameters.Add(param)
OdbcCmd.ExecuteNonQuery()
OdbcCon.Close()
I hope someone else can benefit from this.
|
|
|
|
|
New to the .net thing but trying.
I have an App. that loops through a database and gets the email address of everyone on my newsletter list. I need to control MAPI so that I can programatically attach my newsletter to a new email for each recipient and send the message. Then continue that process until the newsletter has been sent to each recipient individually.
Any help would be great!
Do you know Jesus? ...
|
|
|
|
|
|
Thanks,
I was able to use your links to get to the info I needed!
Do you know Jesus? ...
|
|
|
|
|
Soundz wrote: I was able to use your links to get to the info I needed!
You are welcome, I'm very glad to support you.
|
|
|
|
|
I'd recommend a simple google search if your just looking for an example:
http://www.google.com/search?hl=en&q=asp.net+smtp
Sending individual emails to large lists can create performance issues if you are using an external SMTP server. To boost the performance, i always use the local server (127.0.0.1) as my smtp server and set it's smarthost setting to a real smtp server. this allows the web pages to generate the emails very quickly into the local smtp queue.
nothing change just rearrange
|
|
|
|
|
Thanks for the info. This app is not web based for now but I guess it will be useful when I start on the website.
Do you know Jesus? ...
|
|
|
|
|
Hello all, I need a little help. I'm calling a stored procedure from my
vb.net prog and I keep getting a syntax error. Could someone look at my code
and help me out a little. Thanks in advance.
Here is the procedure:
AddMember:
if exists (select * from sysobjects where id = object_id('dbo.AddMember')
and sysstat & 0xf = 4)
drop procedure dbo.AddMember
GO
CREATE PROCEDURE AddMember
@mbr_acctnum decimal(12,0),
@mbr_name varchar(50),
@mbr_ssn varchar(9),
@mbr_employee char(1)
AS
INSERT INTO Members (Account_Number, Member_Name, Social_Security_Number,
Employee)
VALUES (@mbr_acctnum, @mbr_name, @mbr_ssn, @mbr_employee)
GO
Here is the code:
'Create the ODBC objects
Dim OdbcCon As System.Data.Odbc.OdbcConnection
Dim OdbcCmd As System.Data.Odbc.OdbcCommand
'Instantiate new instances
OdbcCon = New System.Data.Odbc.OdbcConnection
OdbcCmd = New System.Data.Odbc.OdbcCommand
'Open a connection to an iSeries data source
OdbcCon.ConnectionString = _
"Driver={SQL Server};Server=" & _
pserver & ";Database=" & database & _
";Uid=" & puserid & "pwd=" & password
'Set up the procedure call
OdbcCmd.CommandText = "AddMember"
OdbcCmd.CommandType = CommandType.StoredProcedure
'Accosicate the command with the connection
OdbcCmd.Connection = OdbcCon
'Open the connection
OdbcCon.Open()
'Create the parameter objects to pass and get data from procedure
OdbcCmd.Parameters.Add("@mbr_acctnum", Odbc.OdbcType.Decimal, _
12, 0).Direction = ParameterDirection.Input
OdbcCmd.Parameters.Add("@mbr_name", Odbc.OdbcType.VarChar, _
50).Direction = ParameterDirection.Input
OdbcCmd.Parameters.Add("@mbr_ssn", Odbc.OdbcType.VarChar, _
9).Direction = ParameterDirection.Input
OdbcCmd.Parameters.Add("@mbr_employee", Odbc.OdbcType.Char, _
1).Direction = ParameterDirection.Input
'set the value of the parms to pass
OdbcCmd.Parameters(0).Value = 12
OdbcCmd.Parameters(1).Value = "xxxx wwww"
OdbcCmd.Parameters(2).Value = "444229999"
OdbcCmd.Parameters(3).Value = "Y"
'call the procedure
OdbcCmd.ExecuteNonQuery()
'put the results into a textbox control
'txtResult.Text = OdbcCmd.Parameters(1).Value
'close the connection
OdbcCon.Close()
Here is the error I receive:
MSSQLJOB 964-9a4 EXIT SQLExecDirectW with return code -1
(SQL_ERROR)
HSTMT 03A31BC0
WCHAR * 0x010C08E8 [ -3] "AddMember\ 0"
SDWORD -3
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
AddMember expects parameter @mbr_acctnum, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
AddMember expects parameter @mbr_name, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
AddMember expects parameter @mbr_ssn, which was not supplied. (201)
DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
AddMember expects parameter @mbr_employee, which was not supplied. (201)
Any help appreciated.
|
|
|
|
|
First, you might want to create all of your parameters BEFORE you open the connection.
Next, why are you using the ODBC stuff instead of the SQL Client namespace?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
What is the best way to connect to SQL Server 2000 on a network from Visual Studio 2005 Std Edition?
|
|
|
|
|
|
I have a running total field in a crystal report, and I want it to reset on each page. However, the only options available are to reset on a field, a group, or a formula. Does anyone know what formula I can use to make this work? I don't have any groups in my report and I'd rather not have to setup a field just to get this to work.
I'd appreciate any help or ideas.
-- modified at 10:34 Tuesday 13th June, 2006
I could still use some help with this one. If anyone has any ideas I'd really appreciate it.
|
|
|
|
|
|
This article doesn't have anything in it about running total fields. Could you please explain why you thought it would be helpful? If you were suggesting that I use parms, I know how to use them but I fail to understand how they would work/help in this particular situation. I could really use some advice, thanks for your help so far.
|
|
|
|
|
I have spent a great deal if the day reseraching how to do this. I thought I would post this snippet just in case anyone needs it. Please let me know if there is a more appropriate way of doing this.
Public Const WM_NCLBUTTONDBLCLK As Integer = &HA3
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_NCLBUTTONDBLCLK Then
'You can write your own code to handle the double click here....
Else
MyBase.WndProc(m)
End If
End Sub
|
|
|
|
|
Just finished my first business app using VB.net 2005/SQL2005 and wanted some advice/products to protect it before throwing it into the wild.
Looking on the web, there seem many ways to skin a cat, but I though an encryption class in the code to check a .LIC file looked the easiest. I wanted to later set up an online download/purchse/license model once it takes off so I'm not sure if the two are compatible. What the pro's experiences?
I
|
|
|
|
|
moldie wrote: wanted some advice/products to protect it before throwing it into the wild
What do you mean by protect your software?
|
|
|
|
|
I mean to protect it from copying. Just like the commercial software you get which gives you a 30 day trail then you have to pay the license fee. I was wondering what the best practice was to "make sure you get your money" for the thousands of hours of blood and sweat!!
-- modified at 6:39 Tuesday 13th June, 2006
|
|
|
|
|
As far as I know, the trail software will stock its functionality when user open X times or in a specific period (usually 30 days). You might need to count this thing (X time or specific period) with the time in windows or number of open application. These count number usually record in regedit. If you want to work with regedit in vb.net try to read this article[^].
|
|
|
|
|
Do you have vb.net QuickFillDemo_src?The VC CodeProject (QuickFillDemo_src) is very difficulty!
Do you have vb.net QuickFillDemo_src?The VC CodeProject (QuickFillDemo_src) is very difficulty!
|
|
|
|
|
I am Using Crystal Reports OCX Control in (C# ) VS.NET 2003.
I am using a DSN to connect database to report.I want to remove this method of connecting through DSN
I want to populate the Report using DataSet.
is it possible ?
thanks in Advance.
|
|
|
|
|
|
I am not using crystal report available with .net.I am Using Crystal Reports OCX Control
The code which I use is,
This is the two sentences which makes problem.
axCrystalReport1.ReportFileName= Application.StartupPath.ToString() + \\Reports\\Sample.rpt;
axCrystalReport1.Connect=System.Configuration.ConfigurationSettings.AppSettings
Here I use a dsn to connect which I want to avoid.
If I bring the result in a dataset I dont see any method to assign it to the report Object.This could have been done effectively with crystal reports of vs.net
|
|
|
|
|
|
Hi all,
I'm looking for people's thoughts on a problem I'm having. We mark users as active if they log in to our app, so they can't log into the app again using the same user. If they crash their PC they are left as active and can't log back into the sytem. How can find out if a user crashed out instead of being still logged in? I know this is probably a basic programming problem, but i've struggled for a solution so far.
Any help would be much appreciated.
|
|
|
|