Monday, March 19, 2012
Image - Paste into table vs. Insert Object linked or unlinked
difference when using the form if I paste in the image or use "Insert
Object".
When looking at the underlying table after closing the form:
If the image is pasted, it shows "Picture" as the value in the field
If the image is put in via Insert Object and it is unlinked, it shows
"Package"
When I look at the "Bound Object Frame", I see no difference in values. I
see identical images when viewing the form.
My initial take on it is if the image won't change, go ahead and paste it
in. If the document may change, then it should be linked.
Is there a preferred method?
What program are you using?
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dkline" <Dkline001@.comcast.net> wrote in message
news:%23v1xUqpHFHA.1860@.TK2MSFTNGP15.phx.gbl...
>I have a form in which one of the columns will show a picture. Is there any
>difference when using the form if I paste in the image or use "Insert
>Object".
> When looking at the underlying table after closing the form:
> If the image is pasted, it shows "Picture" as the value in the field
> If the image is put in via Insert Object and it is unlinked, it shows
> "Package"
> When I look at the "Bound Object Frame", I see no difference in values. I
> see identical images when viewing the form.
> My initial take on it is if the image won't change, go ahead and paste it
> in. If the document may change, then it should be linked.
> Is there a preferred method?
>
Image - Paste into table vs. Insert Object linked or unlinked
difference when using the form if I paste in the image or use "Insert
Object".
When looking at the underlying table after closing the form:
If the image is pasted, it shows "Picture" as the value in the field
If the image is put in via Insert Object and it is unlinked, it shows
"Package"
When I look at the "Bound Object Frame", I see no difference in values. I
see identical images when viewing the form.
My initial take on it is if the image won't change, go ahead and paste it
in. If the document may change, then it should be linked.
Is there a preferred method?What program are you using?
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dkline" <Dkline001@.comcast.net> wrote in message
news:%23v1xUqpHFHA.1860@.TK2MSFTNGP15.phx.gbl...
>I have a form in which one of the columns will show a picture. Is there any
>difference when using the form if I paste in the image or use "Insert
>Object".
> When looking at the underlying table after closing the form:
> If the image is pasted, it shows "Picture" as the value in the field
> If the image is put in via Insert Object and it is unlinked, it shows
> "Package"
> When I look at the "Bound Object Frame", I see no difference in values. I
> see identical images when viewing the form.
> My initial take on it is if the image won't change, go ahead and paste it
> in. If the document may change, then it should be linked.
> Is there a preferred method?
>
Image - Paste into table vs. Insert Object linked or unlinked
difference when using the form if I paste in the image or use "Insert
Object".
When looking at the underlying table after closing the form:
If the image is pasted, it shows "Picture" as the value in the field
If the image is put in via Insert Object and it is unlinked, it shows
"Package"
When I look at the "Bound Object Frame", I see no difference in values. I
see identical images when viewing the form.
My initial take on it is if the image won't change, go ahead and paste it
in. If the document may change, then it should be linked.
Is there a preferred method?What program are you using?
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dkline" <Dkline001@.comcast.net> wrote in message
news:%23v1xUqpHFHA.1860@.TK2MSFTNGP15.phx.gbl...
>I have a form in which one of the columns will show a picture. Is there any
>difference when using the form if I paste in the image or use "Insert
>Object".
> When looking at the underlying table after closing the form:
> If the image is pasted, it shows "Picture" as the value in the field
> If the image is put in via Insert Object and it is unlinked, it shows
> "Package"
> When I look at the "Bound Object Frame", I see no difference in values. I
> see identical images when viewing the form.
> My initial take on it is if the image won't change, go ahead and paste it
> in. If the document may change, then it should be linked.
> Is there a preferred method?
>
I'm Stumped - Adding values of two columns
I'm missing it all together.
I have a very simple data entry table that is going to be used in other
areas (asp, etc.)
The table contains several columns. I need to have some of the columns
automatically equal the values of other columns added together.
ie.
Column Value
JanSalesGoals 4
FebSalesGoalsn 6
MarSalesGoals 3
Qtr1SalesGoals =[JanSalesGoals]+[FebSalesGoals]+[MarSal
esGoals]
Having the column of Qtr1SalesGoals come out to equal '13'.
The best I have acheived is getting the column to equal 463, which is
not the desired result.
There is a reason why I am trying to make it work this way in the table
itself.
Any and all sugestions are aprreciated.Convert to integer before adding, see example
declare @.val1 char(1)
declare @.val2 char(1)
declare @.val3 char(1)
select @.val1='4',@.val2 ='6',@.val3 ='3'
select @.val1+ @.val2 + @.val3
select convert(int,@.val1)+ convert(int,@.val2) + convert(int,@.val3)
Denis the SQL Menace
http://sqlservercode.blogspot.com/
ehorde@.burgoonberger.com wrote:
> I am at a loss...I have tried everything.. Hopefull this is so easy
> I'm missing it all together.
> I have a very simple data entry table that is going to be used in other
> areas (asp, etc.)
> The table contains several columns. I need to have some of the columns
> automatically equal the values of other columns added together.
> ie.
> Column Value
> JanSalesGoals 4
> FebSalesGoalsn 6
> MarSalesGoals 3
> Qtr1SalesGoals =[JanSalesGoals]+[FebSalesGoals]+[MarSal
esGoals]
> Having the column of Qtr1SalesGoals come out to equal '13'.
> The best I have acheived is getting the column to equal 463, which is
> not the desired result.
> There is a reason why I am trying to make it work this way in the table
> itself.
> Any and all sugestions are aprreciated.|||What is the datatype of "value"? If it is not a numeric datatype, why not?
This is not VBScript, and you can't just switch in math operators against
strings. SQL Server doubles up the use of + for string concatenation and
mathematical addition. Observe:
DECLARE @.foo VARCHAR(12), @.bar VARCHAR(12);
SET @.foo = 4;
SET @.bar = 3;
SELECT @.foo + @.bar;
SELECT CONVERT(INT, @.foo) + CONVERT(INT, @.bar);
GO
DECLARE @.foo INT, @.bar INT;
SET @.foo = 4;
SET @.bar = 3;
SELECT @.foo + @.bar;
SELECT CONVERT(VARCHAR(12), @.foo) + CONVERT(VARCHAR(12), @.bar);
<ehorde@.burgoonberger.com> wrote in message
news:1149270430.339282.245030@.h76g2000cwa.googlegroups.com...
>I am at a loss...I have tried everything.. Hopefull this is so easy
> I'm missing it all together.
> I have a very simple data entry table that is going to be used in other
> areas (asp, etc.)
> The table contains several columns. I need to have some of the columns
> automatically equal the values of other columns added together.
> ie.
> Column Value
> JanSalesGoals 4
> FebSalesGoalsn 6
> MarSalesGoals 3
> Qtr1SalesGoals =[JanSalesGoals]+[FebSalesGoals]+[MarSal
esGoals]
> Having the column of Qtr1SalesGoals come out to equal '13'.
> The best I have acheived is getting the column to equal 463, which is
> not the desired result.
> There is a reason why I am trying to make it work this way in the table
> itself.
> Any and all sugestions are aprreciated.
>|||Generally you should never have columns like that, since you can always
calculate the values on the way back out for viewing and reporting.
So how are you attempting to update this column? In code? In a trigger?
Bottom line, convert the values to numeric first before adding. You are
seeing string concatenation.
Jeff
<ehorde@.burgoonberger.com> wrote in message
news:1149270430.339282.245030@.h76g2000cwa.googlegroups.com...
>I am at a loss...I have tried everything.. Hopefull this is so easy
> I'm missing it all together.
> I have a very simple data entry table that is going to be used in other
> areas (asp, etc.)
> The table contains several columns. I need to have some of the columns
> automatically equal the values of other columns added together.
> ie.
> Column Value
> JanSalesGoals 4
> FebSalesGoalsn 6
> MarSalesGoals 3
> Qtr1SalesGoals =[JanSalesGoals]+[FebSalesGoals]+[MarSal
esGoals]
> Having the column of Qtr1SalesGoals come out to equal '13'.
> The best I have acheived is getting the column to equal 463, which is
> not the desired result.
> There is a reason why I am trying to make it work this way in the table
> itself.
> Any and all sugestions are aprreciated.
>|||Setting to int from varchar fixed the formula.
([Jan Sales Goals] + [Feb Sales Goals] + [Mar Sales Goals])
Thanks very much,
Trees in the way of the Forrest View syndrome
SQL Menace wrote:
> Convert to integer before adding, see example
> declare @.val1 char(1)
> declare @.val2 char(1)
> declare @.val3 char(1)
> select @.val1='4',@.val2 ='6',@.val3 ='3'
> select @.val1+ @.val2 + @.val3
> select convert(int,@.val1)+ convert(int,@.val2) + convert(int,@.val3)
> Denis the SQL Menace
> http://sqlservercode.blogspot.com/
> ehorde@.burgoonberger.com wrote:
Monday, March 12, 2012
Im new to stored Procedures
I create my store proc. I want to give it a parameter AccNmbr and I want it to return to me the total of the columns SubNmbr in total variable; total is gonna be an output. So I do this in my Stored Proc:
Create Procedure dbo.totalSub
@.AccNmbr bigint,
@.total bigint out
AS
Select @.total=sum(SubNmbr) where AccNmbr=@.AccNmbr
return
Go
When I run the proc it tells me that parameter total was not provided. I also tried with return (instead of Return @.total)
it always tells me missing total parameter. But I want total to be my result, not my input. Only AccNmbr is my input.
Thanks a lot for your help.
When you create this Stored Procedure, you have 2 input parameters. Either you can specify one as output, or just have 1 input... Here's a modification that will do what it seems you were doing. You also missed what table you were pulling the results from, that is mentioned by "FROM TABLE".
Here ya go:
Create
Procedure dbo.totalSub@.AccNmbr int,
AS
Selectsum(SubNmbr)FROMTABLEwhere AccNmbr=@.AccNmbr
Go
|||
You re right, I correct my stuff as shown bellow:
My stored procedure works perfectly when I run Query Analyser, but when I run my VB program I get the eror: I get the message : An SqlParameter with ParameterName'@.total' is not contained by this SqlParameterCollection.
Here is my stored Proc and my VB program is right below
I- Stored Proc:
CREATE PROCEDURE dbo.totalsub
@.account bigint,
@.total bigint output
AS
select total=sum(SubPhnNmbr) from tblsub whereSubAccNmbr=@.account
return
GO
II- And my pogram in VB is:
Dim totsub As Int64
Dim cm As New SqlCommand
Dim cn As New MyConnection
cn.open
'my connection is defined by me don't worry about it
cm.CommandType = CommandType.StoredProcedure
cm.CommandText = "totalsub"
cm.Connection = cn
Dim pm As SqlParameter
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("@.Account", System.Data.SqlDbType.BigInt))
pm.Value = 100000165
pm = cm.Parameters.Add(New System.Data.SqlClient.SqlParameter("total", System.Data.SqlDbType.BigInt, 4))
pm.Direction = ParameterDirection.Output
totsub = cm.Parameters("total").Value
cm.ExecuteScalar()
totsub = cm.Parameters("total").Value
I also tried using @.total instead of total and I tried ParameterDirection.ReturmValue instead of ParameterDirection.Output
No Luck, thanks a lot for help