|
Hi
Iam using sql server 2008. While saving time Iam getting trouble to show the size for varchar(max) field...
From the below Item_Description is Varchar(Max)
Therefore, how to pass the parameter size?......
My commands..
=============
Dim Ins_Save As String = "insert into Stock_Master (item_code,item_name,item_description) values (@item_code,@item_name,@item_description)"
MyDataAdapter.InsertCommand = New SqlCommand(Ins_Save, con)
With MyDataAdapter.InsertCommand.Parameters
.Add("@item_code", SqlDbType.VarChar, 15, "item_code")
.Add("@item_name", SqlDbType.VarChar, 30, "item_name")
.Add("@item_description", SqlDbType.VarChar, ?????????????????????, "item_description")
End With
Thanks For The Ideas
Regards
PARAMU
|
|
|
|
|
searching for SqlParameter varchar(max) I found some pages that suggest -1 would be good; I didn't find an official statement on the matter though.
|
|
|
|
|
We have a VB6 ActiveX exe program that is compiled to exe in a source library then signed and copied to the program files folder.
The program registers when we issue c:\Program Files (x86)\folder\Program.exe /REGSERVER
It is invoked by another program (QuickBooks) from the ProgramID not guidgen.
When QuickBooks invokes the program is running from the source libary (as per app.path) where it was originally compiled and signed not program files where it is registered to.
The registry has many references to the program and to the program and source library.
Can you tell me?
1. Why so many references in the registry to the source library for the activeX.exe?
2. How to get it invoked from the program files folder not the source folder.
BTW: When this is installed and setup on another machine without the source libraries it works fine.
Thanks and happy holidays!!!
|
|
|
|
|
Hi,
Can you guys check to see what I am doing wrong:
Two tables
Table_A( ID type INT, Dept_Code type INT, Name type STRING)
Table_B( ID type INT, Dept_Code, Commune_Code type nvarchar)
A view Of tableA_B (ID, dept_code, Commune_code, dept_name, commune_name)
Query:
Select * from table_A_B
where dept_code=@search or commune_code=@search
when I enter value such as 2, 3, 5; no problem
but when I do value such as 2.5,5.1.
Error: conversion failed when converting nvarchar as value to type integer.
thanks in advance
|
|
|
|
|
Yeah, this has nothing to do with VB or VB.NET. This is all SQL stuff that should be in the Database forum.
But, the error is exactly correct. In Table A, you've got Dept_Code typed as an Integer and in Table B, you don't specify a type.
You cannot supply @search to both an Integer type and an NVarChar type the same way. You also have to recognise that your cannot convert a floating point number to an Integer without data loss, so you're really NOT searching for 2.5, you're searching for 2, IF there is a hit on the Dept_Code Integer type.
|
|
|
|
|
Hi,
thanks..
Dept_code in table_B is as type INT.
When I search for 5, it is ok, but when I do 5.1 the error occurs.
Thanks again..
|
|
|
|
|
Of course it errors! 5 can be directly converted to an Integer without any data loss. 5.1 cannot.
|
|
|
|
|
What is the point to search for a float value (5.1) in an int field ?
Assuming this int represents a region or city code, what do you expect to get when you query for 5.1 ?
|
|
|
|
|
Hi,
Iam using vb.net2008. And while I send E-Mails it's sending 3-times for 3 reciepents....means each address is receiving 3 mails...
I don't know...whats wrong with me..
Does AnyBody Faced This Problem?
Even I tried by adding CC and BCC, but everywhere its always sending the mails as per the number of addressess.
My Codings...
-----------------------------------------------------------------------
FrmMail = "one@codeproject.com"
ToAddress = "two@codeproject.com,three@codeproject.com,four@codeproject.com"
MailMsg = New System.Net.Mail.MailMessage(FrmMail, ToAddress)
MailMsg.Subject = RichTextBox3.Text
MailMsg.Body = RichTextBox1.Text
MailMsg.IsBodyHtml = False
'Its also sending as per the number of address"
'MailMsg.CC.Add(""two@codeproject.com,three@codeproject.com,four@codeproject.com")
'MailMsg.Bcc.Add(""two@codeproject.com,three@codeproject.com,four@codeproject.com")
'My SERVER
Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient("1.2.3.4", 25)
'My USER SYSTEM
Dim MailAuthentication As System.Net.NetworkCredential = New System.Net.NetworkCredential("1.3.2.1\someone", "123")
smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtp.EnableSsl = False
smtp.UseDefaultCredentials = True
smtp.Credentials = MailAuthentication
Try
smtp.Send(MailMsg)
DataGridView1.Rows(TR1).Cells(3).Value = "MAIL HAS SENT"
Catch ex As Exception
MsgBox(ex.Message)
End Try
-----------------------------------------------------------------------
Thanks and Regards
PARAMU
|
|
|
|
|
why do you add addresses to both Cc and Bcc? To, Cc and Bcc are lists of recipients, they accumulate.
And please use PRE tags for showing code snippets.
|
|
|
|
|
Hi
May be I don't mentioned earlier I used as either CC or Bcc , not the both.
Thanks
|
|
|
|
|
|
Without seeing your code around the Process class you're using there's no way to tell you what you're doing wrong.
Josh6680 wrote: I've been sitting here for hours searching through millions of useless help topics!
It's quite easy actually. Process.GetProcessesByName is quite easy to use. But, like I said, it's impossible to say what you did wrong.
|
|
|
|
|
|
You've overcomplicated this. I have no idea what you were doing with the ConvertAll and the ProcessToProcess thing. GetProcessesByName returns an array of Process objects. If you expect only one instance of the process you're looking for, check the size of the returned array for 1 instance and just check the HasExisted property of the one instance. If you're expecting that you can have more than one instance, you'll have to complicate the code a bit.
Dim processes As Process() = Process.GetProcessesByName("ProcessName")
If processes.Length = 1 Then
Do While processes(0).HasExited = False
' Wait half a second and check HasExited again.
Thread.Sleep(500)
Loop
End If
' The process has exited. now you can do whatever you need.
|
|
|
|
|
|
If that one messed you up, I you should seriously pickup a book on VB.NET and work through it. You've got a ton of basic concepts that need to be laid out to you before you can really start understanding the documentation on the rest of the .NET Framework.
|
|
|
|
|
Are You tried this..,
System.Diagnostics.Process .GetProcesses
Rajesh B --> A Simple Programmer <--
|
|
|
|
|
I've been sitting here for hours searching useful information in your question. What did you try? what do you know about the process of interest, how will you identify it? Can you modify said process, e.g. make it set a Mutex?
|
|
|
|
|
Hi, I create dynamically textboxes and want to add data from them to database, but I don't know how do this.
I use this to create textbox
v = 1
Dim l As Integer
l = 40
For i = 1 To Form1.k
l = l + 30
Dim lab As New Label
Dim t As New TextBox
Dim chk As New CheckBox
lab.Location = New Point(10, 30 + l)
t.Location = New Point(100, 30 + l)
chk.Location = New Point(420, 30 + l)
Me.Panel1.Controls.Add(chk)
Me.Panel1.Controls.Add(lab)
Me.Panel1.Controls.Add(t)
lab.BringToFront()
t.BringToFront()
chk.BringToFront()
t.Size = New Size(300, 20)
t.Name = "t" & i
lab.Name = "lab" & i
lab.Text = "Отговор" & i
chk.Name = "chk" & i
Next
|
|
|
|
|
Which part do you not know how to do?
- Get the data from the controls.
- Connect to the database.
- Create a command/query to run against the database.
- Add the data as parameters to the command.
- Execute the command.
|
|
|
|
|
I don't know how to get the data from the controls, because in running program they not in the form and program give a error. I don't know with what name use them.
|
|
|
|
|
To access those controls you basically have two ways:
1.
keep a reference to each Control somewhere, maybe in a List Of Control, then enumerate the list elements.
2.
find the Controls by name: you can do Me.Panel1.Controls["John"] to access the Control with name "John".
|
|
|
|
|
Thank You very much this work.
|
|
|
|
|
hi, im doing a app on vb6 and i have a doubt about the transaction. how can i know if the transaction is "open" or not. thanks,
Marcus
|
|
|
|