|
|
Import/using globalises a namespace, it doesn't force the namespace to be present. You need to make sure you have a reference to your dll.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The namespace is language independent.
To start using a namespace you must:
- add to your project a reference to the DLL file (use Visual Studio Solution pane);
- add an Import statement to your VB source file(s)
|
|
|
|
|
An Array name as
string list[]={value1,valve2…..}
is string type I had also inserted the values but now I want to separate these values by commas like value1, value2…. in array then this is assign to
string= value1,value2…
then I want to pass it through SQL query as
“select “+string+” from table ” please provide me code in c#
|
|
|
|
|
string[] array = new string[] { "value1", "value2", "value3" };
StringBuilder insertString = new StringBuilder();
for (int count = 0; count < array.Length; count++)
{
insertString.Append(array[count].ToString());
if(count < array.Length - 1)
insertString.Append(",");
}
string sqlString = "Select " + insertString.ToString() + " from table";
MessageBox.Show(sqlString);
For StringBuilder, you will need to use System.Text
Dude, I have been observeing you for quite a few days. I really suggest you to buy a book of c# and go through it. Not every time you gonna be fed by spoon.
|
|
|
|
|
Manas Bhardwaj wrote: Dude, I have been observeing you for quite a few days. I really suggest you to buy a book of c# and go through it. Not every time you gonna be fed by spoon
Well said Manas Bhardwaj
Regards,
Satips.
|
|
|
|
|
Manas Bhardwaj wrote: Not every time you gonna be fed by spoon.
But again, it worked!
|
|
|
|
|
String.Join( "," , new string[] { "value1", "value2", "value3" } );
fits in a much smaller spoon.
|
|
|
|
|
|
Er nikesh yadav wrote: please provide me code in c#
We cannot do your work.
What you have done so for about this array code.
What error it shows?
Here you can get help only.
Regards,
Satips.
|
|
|
|
|
Hey try something yourself , if u r programmer dont ask for silly mistakes. or error.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Hi
I m working in VS2005 C# Windows Application.I have created a .DLL file and added reference in my application.I have also copied the .PDB(Progam Debug Database) file with DLL .Its working fine but when i debug code it does not show the code of .DLL.Orginal code is on any other computer and compiled on that. i have copied .DLL and .PDB files.When i click F11 for going into .DLL code from my application it gives error "There is no source code available for the current location".
ANy body have Idea how to view code???Can i view code if i have .DLL and .PDB file but not original code????
|
|
|
|
|
If you don't have the code, how do you expect to see it? Your best bet is to use a disassembler. Check out Reflector[^]
AFAIK, you can't integrate it with the debugger.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
reply me on my e-mail majidkhan50@gmail.com
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
|
sk007msc wrote: reply me on my e-mail majidkhan50@gmail.com
Dont expect someone to reply you on your email? This is not a support desk
|
|
|
|
|
|
Is it like this
string list[34]=new string;
|
|
|
|
|
|
|
No.
It is like it says it is in every book on C# and in almost every example on CodeProject.
|
|
|
|
|
string[] str= new string[100];
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
hi
I have created one method createdropdown()in that i had create one dynamic dropdownlist and in selectindexchange of that dropdownlist i had created another dynamic dropdownlist and again selectedindexchange of the second dropdown .
but when i run this code it will call first selectedindexchange when i select the dropdownvalue but it want call second selectedindexchange.
i had done autopostBack=true for both the dropdownlist.
Please Help It is some urgent Task that i have to complet.
in the below ddl_SelectedIndexChanged() is call but ddl2____SelectedIndexChanged is not fired.....?
// Add DropDownList Control to Placeholder
private void CreateDropDownBoxes()
{
//int counter= Convert[ViewState ("counter"),Int32];
for (int counter = 0; counter <= NumberOfControls; counter++)
{
DropDownList ddl = new DropDownList();
ddl.ID = "DropDownList_ID" + (counter + 1).ToString();
ddl.AutoPostBack = true;
ddl.AppendDataBoundItems = true;
ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
DataTable dt = new DataTable();
dt = getdata_workspace();
ddl.DataSource = dt;
ddl.DataTextField = "displayedname";
ddl.DataValueField = "id";
ddl.DataBind();
phDropDownLists.Controls.Add(ddl);
phDropDownLists.Controls.Add(new LiteralControl("
"));
}
}
public void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
int n = this.NumberOfControls;
for (int i = 0; i < n; i++)
{
SqlConnection conn = new SqlConnection(connStr);
string boxName = "DropDownList_ID" + (i + 1).ToString();
DropDownList ddl2_ = phDropDownLists.FindControl(boxName) as DropDownList;
DropDownList ddl2___ = new DropDownList();
ddl2___.ID = "DropDownList__" + (i + 1).ToString();
ddl2___.AutoPostBack = true;
ddl2___.AppendDataBoundItems = true;
ddl2___.EnableViewState = true;
SqlCommand cmd = new SqlCommand("select * from unit where workspaceid='" + ddl2_.SelectedValue + "'", conn);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
ddl2___.Items.Add(dr.GetString(2));
}
// ddl2___.EnableViewState = true;
ddl2___.SelectedIndexChanged += new EventHandler(ddl2____SelectedIndexChanged);
ddl2___.DataTextField = "displayedname";
ddl2___.DataValueField = "id";
phTextBoxes.Controls.Add(ddl2___);
phTextBoxes.Controls.Add(new LiteralControl("
"));
}
// throw new Exception("The method or operation is not implemented.");
}
void ddl2____SelectedIndexChanged(object sender, EventArgs e)
{
int n = this.NumberOfControls;
for (int i = 0; i < n; i++)
{
SqlConnection conn = new SqlConnection(connStr);
string boxName = "DropDownList__" + (i + 1).ToString();
DropDownList ddl2_ = phTextBoxes.FindControl(boxName) as DropDownList;
DropDownList ddl2___ = new DropDownList();
ddl2___.SelectedIndexChanged += new EventHandler(ddl2____SelectedIndexChanged);
ddl2_.ToolTip = "ddl2";
SqlCommand cmd = new SqlCommand("select * from unitoperation where workspaceid='" + ddl2_.SelectedValue + "'", conn);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
ddl2___.Items.Add(dr.GetString(3));
}
phdropdown3.Controls.Add(ddl2___);
}
}
Please Help ...Help...
|
|
|
|
|
advice 1:do not post whole project in the forum, its irritating, only post the code which u feel as doubtful.
advice 2: ur naming convention according to the above code is very very bad.
(such as ddl___SelectIndex...).
dude:if u wanna quick result for ur problem, follow the advice.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
i just created an addin in VS 2005. The addin uses different dll files and icons and the final product when run i got is the addin file and the dll file. now i want that addin to be used in other machines too and just copying the dll and addin is not just a solution (as it requires other dll and the icons).
can anyone help me out, how to make that possible?
Thanks in advance.
Your life is what your thoughts make it.
|
|
|
|
|
Hi,
I have created a Windows Component class(in C#) which will be used by the other developers in their application during the design time. The developers will add the component into the tool box by adding the reference to it. Later they drag and drop the copmponent on the Windows form.
I needed the component in such a way that the developer could add the collection items into it. So I have inherited the CollectionEditor class in the component.
Am able to add the collection items into the collection editor. But am not getting the added items back when I close the windows application and open it again.ie., it doesn't appear to be assigning the added items to the actuall collection in the form's InitializeComponent() function.
> Can you please suggest me some solution.
"Don't go the way life takes you…... Take the life the way you go……….."
|
|
|
|