|
i thought the same as you, but i have done following from sql server, still i am getting no records
<br />
declare @codes varchar(max)<br />
select @codes=cast(quotename('28-2801','''')+','+quotename('28-2802','''') as varchar(max))<br />
print @codes --prints '28-2801','28-2802'<br />
exec [sp_detail] @codes
this doesent work too.
i think first i have to execute the statement in sql server, then i can simply can execute from c#.
in above statement any thing goes worong?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
hmmm.... perhaps there's a reason that I don't know why you can't pass in a string like that. Have you tried string mashing the sql in your proc, or just creating the SQL in code instead of using a proc ?
I think at this point you'd be better asking in the SQL forum ( where this question belonged from the start ), because that's where the SQL heavyweights will be hanging out .
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Asking in the SQL forum would be best
|
|
|
|
|
i'm trying to get a selected range of data from a data set into a new data set,i use an array(dr2) of data rows and from that i get one row at a time and add it to new datatable(dt2), after it is added to a data set.
DataSet ds2 = new DataSet();
DataTable dt2 =new DataTable();
for (int start = startindex ;start < startindex+5 ; start++)
{
DataRow dd = dr2[start];
dt2.ImportRow(dd);
}
ds2.Tables.Add(dt2);
return ds2;
but the problem is when the dataset is returned it has the table with correct no of row, but the rows contain no data, what might be the problem
|
|
|
|
|
sorry to disturb you people , i just found the solution , i missed the clone the table ,
thanx.
|
|
|
|
|
|
How can i use avicap32.dll. in example i found some one user WebCamLib....may i know how can i user it? what reference?
using WebCamLib;
how can i add WebCamLib to my reference?
A S E L A
|
|
|
|
|
Have you tried searching the web, or reading articles on this site ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
yes, and i found
object selectUsingUI = System.Reflection.Missing.Value;
wiaRoot = (ItemClass) wiaManager.Create( ref selectUsingUI );
if( wiaRoot == null )
return;
wiaPics = wiaRoot.GetItemsFromUI( WiaFlag.SingleImage, WiaIntent.ImageTypeColor ) as CollectionClass;
can please explane what happen by this code.....
i can access the webcam. i want to show output in a picturebox now. later capture image.
A S E L A
|
|
|
|
|
can't i use picturebox to camera capture other than using WIA dialog to show....???
A S E L A
|
|
|
|
|
|
How to create the winform with code not by the guide (project-->add-->windows Form) at desgin-time in c#? and how to add some button in the dynamic created winform?
Many thanks
|
|
|
|
|
I would recommend the Petzold book on Winforms, he creates everything in code. To add a button to a form, you create it, and add it to the controls collection of the form. Then you tell it where it sits ( x,y,width,height)
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thank Christian Graus, Could you please tell me the full name of the book ? and in which place I can order it.
|
|
|
|
|
Charles Petzold - Programming Microsoft Windows with C#. Amazon will have it.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
How do I use a field storing Type information?
private Type _DataType;
private Dictionary<int, object> _BlobData;
...
_DataType cow = (_DataType)_BlobData[0];
Is "Type" not the right type?
|
|
|
|
|
Generics is how you do stuff like that.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
redivider, to get data out of the dictionary you have to give it the key. In a dictionary, the key is the first type whatever that is. So since you are using an int, then the integer value that you entered must exist in your dictionary, else it will be null.
For a list, this is completely different from a dictionary, and you can just sellect the first field or [0].
int key = 39292;
String testObj = "Hello I'm a string";
object value = (object)testObj;
so in your example... _BlobData.add(key, value);
To get out the value... you have to put in the correct key...
String myOldDefinition = (String)_BlobData[key];
Console.Writeln("My old string = " + myOldDefinition);
HTH,
Marc
Life is too short to program in Visual Basic.
|
|
|
|
|
redivider wrote: Is "Type" not the right type?
It is, but you are casting to _DataType , which is a variable, not a data type. Seems that you are confusing the two concepts of data type and variable (i.e. an instance of a data type). Besides that, the Object.GetType() method is the way to get type information from an object, casting will generally not work.
So your code snippet should read something like this:
private System.Type _Cow;
private Dictionary<int, object> _BlobData;
...
_Cow = _BlobData[0].GetType();
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
When i have
int i = 10;<br />
i = 5 * i;
it knows i'm not trying to multiply 5 * i, but rather 5* the value stored in i.
So i'm not trying to cast to a variable (_DataType), but rather the value stored in that variable (int, float, string)...
How would generics come into play?
|
|
|
|
|
Hey I'm looking for a bit of help for a generic letter (see code below) Generator.
The funciton takes a number and returns a String.
expected:
input output
----- ------
1 a
26 z
27 aa
28 ab
52 az
53 ba
54 bb
78 bz
79 ca
702 aaa
703 aab
704 aac
...
Here is the code I got so far:
public String getLetter(int? number)
{
number -= 1;
String letter = "";
char[] lettersA = {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
int size = number.Value % 26;
int bigSize = number.Value % 676;
int loop = (int)Math.Floor((decimal)(number.Value / 26));
int bigLoop = (int)Math.Floor((decimal)(number.Value / 676));
for (int i = 0; i < loop; i++)
{
letter += lettersA[i];
}
letter += lettersA[size];
return letter;
}
Please respond if you have a solution.
Thank you,
Marc
Life is too short to program in Visual Basic.
|
|
|
|
|
Why take an int? What happens if you get null passed in ? You don't check for it.
What is going wrong right now ? It's hard to 'find a solution' if you don't tell us what the problem is. I can see why this probably can never work, your for loop can't possibly return any thing but a, ab, abc, etc. I would expect to use a while loop and a stringbuilder to build a string based on the values I kept subtracting from the core number until I got to 0.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
ok I'll try and add a StringBuilder to this. I spent a day on it and the solution was not cliquing. I think I'll just get out an algorithms book and start from square one.
Thanks,
Marc
Life is too short to program in Visual Basic.
|
|
|
|
|
I think your best bet is to set a breakpoint and step through and see what your code is doing, so you can see where it's deviating from your intentions.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|