|
Maybe he will say thats 12 minutes I could have saved by typing in googles URL
|
|
|
|
|
Maybe...but don't hold your breath.
|
|
|
|
|
|
|
What I want to do is something like this, which fails because NumericID is an int type.
ds_Search.SelectParameters.Add("NumericID", "%");
The only relevant hit I was able to find was from the dubious quality website expert exchange (first result, very bottom of the page)[^]which said I either needed to change the DB to have a string field (not possible) or write seperate queries for the wildcards (impractical because there're dozens that would need duplicated).
Are those really my only options?
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
A numeric is not a string, but you can convert the NumericId to a string in a query. Only then can it be compared with a string.
Jean-Christophe Grégoire
|
|
|
|
|
Do you mean a query that would take a string parameter and convert it into a number before looking at the table? If so, could you give an example?
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
What records are you selecting with that? Every record that has an int-value of "%"?
I don't understand what you are trying to do here. What is the SQL-variant of the query you wanna run?
I are troll
|
|
|
|
|
Hopefully this'll still make sense after being (heavily) cut down and generalized, the real query has more stuff in all 3 sections of sql statement.
SELECT table1.table1ID AS ID, table2.OrgTypeID
FROM (table1 INNER JOIN table2 ON table1.table2ID = table2.table2ID)
WHERE (table2.table4ID = ?)
table2.table4ID is selected from a listbox that contains all the values in table4 (each giving a table4ID value) or "all" in which case I want to pass a wildcard in.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
dan neely wrote: or "all" in which case I want to pass a wildcard in.
How about removing the
WHERE (table2.table4ID = ?)
If you omit the WHERE-clause altogether, wouldn't that effectively give you all the records that a wildcard would select?
I are troll
|
|
|
|
|
See my original post. Sometimes I need a wildcard, sometimes I have a specific value. I'd prefer not having to duplicate a dozenish queries if I don't have to in order to implement the wildcard because of the increased maintainability difficulty.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
As far as I know, ANSI-SQL supports wildcards only for filtering on text-based columns, through the LIKE-operator. This option gives you two separate queries;
SELECT table1.table1ID AS ID, table2.OrgTypeID
FROM (table1 INNER JOIN table2 ON table1.table2ID = table2.table2ID)
WHERE (table2.table4ID = 10) (10 being an example of a specific value)
SELECT table1.table1ID AS ID, table2.OrgTypeID
FROM (table1 INNER JOIN table2 ON table1.table2ID = table2.table2ID)
WHERE (CAST(table2.table4ID AS NVARCHAR) LIKE ('%'))
The second version will convert all values in the table4ID-column to the NVARCHAR datatype.
I are troll
|
|
|
|
|
An engineer was trying to set this up to access the Usage string array in struct from main.cs class. see code snippets below. The problem is that the object variable uArray can't see the Usage array from the struct. Can anyone help me to get the string array of Usage in main.cs?
<Code snippet>
// InfoTable.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace infoTable
{
public class InfoTable
{
private struct InfoStruct
{
public string[] Usage;
public string[,] Line;
}
int DLLVer = 1000;
ACMEStruct ACME = new ACMEStruct();
public ACME_Info()
{
ACME.UsageCodes = new string[255];
ACME.UsageCodes[0] = "lab 0";
ACME.UsageCodes[4] = "lab 4";
ACME.UsageCodes[5] = "lab 5";
}
public object GetACMEValues()
{
return ACME;
}
}
}
// main.cs
private void readUsageArray()
{
InfoTable iTable = new InfoTable();
object uArray = iTable.GetACMEValues();
}
|
|
|
|
|
I take it that you are converting the returned object to the correct type (ACMEStruct , I believe); like this:
ACMEStruct acme = (ACMEStruct)uArray;
If not, then you need to do this in order to access the ACMEStruct members of the Object by unboxing it into the appropriate type. If you are already doing this please include the relevant portions of the ACMEStruct definition.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi,
I have code in javascript but it resize the text it also resize the image in my page.Let me know how to avoid resize of the image.
function resizeText(multiplier) {
if (document.body.style.fontSize == "")
{
document.body.style.fontSize = "12px";
document.body.style.lineHeight = "14px";
}
var fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1);
if (fontSize <= 17 && fontSize >= 12) {
document.body.style.fontSize = parseInt(document.body.style.fontSize) + (multiplier * 1) + "px";
document.body.style.lineHeight = parseInt(document.body.style.lineHeight) + (multiplier * 1) + "px";
var p = document.getElementsByTagName('p');
for (i = 0; i < p.length; i++) {
p[i].style.fontSize = (parseInt(document.body.style.fontSize) + "px");
p[i].style.lineHeight = (parseInt(document.body.style.lineHeight) + "px");
}}}
<area shape="rect" coords="7,2,60,16" href="javascript:void(0);" onclick="resizeText(-1) ; javascript:pageTracker._trackPageview(''/coumadin/link/header_decrease_fontsize''); " /><area shape="rect" coords="60,2,103,16" href="javascript:void(0);" onclick="resizeText(1) ; javascript:pageTracker._trackPageview(''/coumadin/link/header_increase_fontsize''); " />
|
|
|
|
|
This is the C# forum. Not the javascriptweb development forum.
modified on Friday, January 9, 2009 11:29 AM
|
|
|
|
|
IN c# i am accessing javascript.Do you have any idea .Please let me know.
Thnaks
|
|
|
|
|
But your error doesn't lie in the C# coding, it lies in the javascript. You won't find much help here for a problem like that.
|
|
|
|
|
mkalantri wrote: Let me know how to avoid resize of the image.
Why, are we married, all of a sudden?
I are troll
|
|
|
|
|
Hello Forum
I wonder if what I can do this.
I have an application in C# that should be able to work in multiple languages, this is ok, but I have issue with combo boxes, I will try to explain.
I have a combo box bound to a database the column name is Color, based on the color the user choose the program will do something else i.e. if the user choose Black method A will be executed if the user choose Yellow method B will be executed.
So I am setting the comboBox1.DataSource, comboBox1.DisplayMember and comboBox1.ValueMember,
But when I am using another language I need the combo box options displayed to the user should be ‘Noir’ (for black) and ‘Jaune’ (for yellow) however the value save to the database should always be the English word.
Can it be done? And if yes, how?
Please Help.
Thank you very much
|
|
|
|
|
Set the DisplayMember to the thing you want displayed, Set the ValueMember to the thing you want stored in the database.
You will probably have to store all the translations in the database too and provide a lookup table (with the value you want to store [the English word], the language, the localised value [the French/German/Spanish/etc. word]) and join that lookup table to the query you are currently using with the additional filter of the language you want to display.
|
|
|
|
|
hi
is it poosible to make toolbox of buutons
if yes how can i make control for it
|
|
|
|
|
What about the ToolStrip control[^]? (Assuming you use Winforms)
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi. i have a problem which i just cannot solve. i have created a crystal report
with dynamic parameters , values are fetched from the database. it works fine when i run the report inside crystal reports 2008.
but when i run the report in my software, visual studio 2005, C# (with crystal reports 2008 offcourse)
i cannot get the list of values. if i add a static list of values it shows up just fine.
so this:
foreach ( ParameterField pf in m_ReportDocument.ParameterFields)
{
MessageBox.Show(pf.DefaultValues.Count.ToString());
}
shows "5" if i add five static values, but "0" if i add dynamic values.
Any suggestions?
m_reportdocument is a crystal report document. the rtp is loaded and datasources are set.
I've tried googling and searching business objects forums. i have seen the question but no replies.
Cheers // Tomas
If it' stuck, DO NOT pull harder!
|
|
|
|
|
I am designing a scheduler, for one module i need a little assistance
My class is as
public class CHandset
{
public int HandsetId
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public int LocationId
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public Queue<t> Queue
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public int ObjState
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public int ObjDBLogging
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public int RequeueTime
{
get
{
throw new System.NotImplementedException();
}
set
{
}
}
public void Execute()
{
throw new System.NotImplementedException();
}
}
</t>
The above is a class for a handset.
There may be 20 handsets over the entire network. Every handset object will have its queue.
1. Objects of this class will be made on fly
2. Queue will contain the jobs that the handset needs to fire.
3. Every instance of the handset object will fire itself in thread.
I want to know that how can i write a code that can access the Queue of object.
I have thought in mind that if i use MSMQ, will it solve my problem.
|
|
|
|