|
Hi Eddy,
I have inserted images as well as their Paths in the server...
and regarding the target path it will be text box so that all the images will be stored to that path...
sayeed bagban
|
|
|
|
|
sayeed bagban wrote: I have inserted images as well as their Paths in the server...
Aight, I'll assume that they're NOT stored in the database - storing a path would otherwise be nonsense.
sayeed bagban wrote: and regarding the target path it will be text box so that all the images will be stored to that path...
..and what was the question?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
how to bind gridview columns dynamically
|
|
|
|
|
|
|
i need to send SMS from C# windows application to registered mobile no. plz help me any one.
|
|
|
|
|
Google will find you lots of samples.
|
|
|
|
|
It depends on who you sms provider is, every provider has it's own documentation. Most of the provider uses url strings, for example:
Dim url As String = "http://smsprovider.com/plain?user=me&password=123&sender=displayname&GSM=mobile"
Dim request As HttpWebRequest = WebRequest.Create(url)
|
|
|
|
|
http://www.ozekisms.com/sms-gateway/index.php?ow_page_number=309
you can visit this site and you will have what you want...
good luck ,,,
modified 18-Feb-13 10:15am.
|
|
|
|
|
C# source of send & get SMS: Download[^]
/* LIFE RUNS ON CODE */
|
|
|
|
|
Hello All,
Suppose after drawing a rectangle with the mouse I want to give the rectangle borders, I would probably need to some how detect the rectangle. If that is what I need to do in order to draw borders around existing objects or remove borders from existing objects, how would I go about doing that? Thanks in advance for your reply.
|
|
|
|
|
Use a class that contains the details of the object and when creating a new object with the mouse you just save the details in the object. Then in your paint routine you iterate through your collection of objects and draw them according to their details. There are lots of sample drawing programs around that will demonstrate this.
|
|
|
|
|
hi all,
actually I recently made a web application. I have around 20 store procedures [for insert, update and delete] , around 12 store procedures are having different numbers of procedures.
I made different functions for every single operation, like see the code below
#region Update Comment
public int Update_Comment(string Comment, string Leave_ID)
{
SqlCommand com = new SqlCommand("Update_Comments", con);
com.CommandType =CommandType.StoredProcedure;
com.Parameters.Add("@Comments",SqlDbType.NVarChar,1000).Value =Comment;
com.Parameters.Add("@Leave_ID", SqlDbType.NVarChar, 50).Value = Leave_ID;
con.Open();
int row = com.ExecuteNonQuery();
con.Dispose();
con.Close();
return row;
}
#endregion
#region Updating Leave after approval
public int Updating_Leave(string User_Id, string Leave_Type, int Leave_Applied)
{
SqlCommand com = new SqlCommand("Update_Leave", con);
com.CommandType =CommandType.StoredProcedure;
com.Parameters.Add("@User_Id",SqlDbType.NVarChar,50).Value = User_Id;
com.Parameters.Add("@Leave_Type", SqlDbType.NVarChar, 50).Value = Leave_Type;
com.Parameters.Add("@Leave_Applied", SqlDbType.Int).Value = Leave_Applied;
con.Open();
int row = com.ExecuteNonQuery();
con.Dispose();
con.Close();
return row;
}
#endregion
here are two function first function is having 2 parametrs and the second one is having 3, but rest of the code is SAME.
So can it be possible, with the help of enum and param we can reduce the no of functions I made. all 12 functions are having different numbers of parameters.
can we reduce 20 functions to 1 or 2 functions [functions may be lengthy; having many if/else conditions] ? is this possible.
for that I did like below
enum Operation_Type
{
Insert,
Update,
Delete,
Select
}
public void Do_Insert_Update_Delete(string Proc_Name, Operation_Type Type ,int No_Of_Args , params object[] args)
{
if(Operation_Type.Insert ==Type)
{
SqlCommand com =new SqlCommand(Proc_Name,con);
com.CommandType = CommandType.StoredProcedure;
for(int i=1; i== No_Of_Args; i++)
{
com.Parameters.AddWithValue(args);
}
con.Open();
com.ExecuteNonQuery();
con.Close();
con.Dispose();
}
}
But I am not getting how to pass parameters and Proc_Name in the code above.
Please let me know
Thanks
Gaurav
|
|
|
|
|
Hi. There is a problem in my coding to display various images on linkbutton click. please correct it.. Thanks in advance.
protected void linknext_Click(object sender, EventArgs e)
{
int i = 0;
if (i > 4)
{
i--;
}
if (i < 4)
{
i++;
}
Loadinstituteimages();
}
private void Loadinstituteimages()
{
string instid = Request.QueryString["instid"].ToString();
string sqlqry = "select Instimg1, Instimg2, Instimg3, Instimg4 from InstituteDetails where instid='" + instid + "'";
DataTable dtimages = SqlHelper.Instance.GetTableByQuery(sqlqry);
if (dtimages.Rows.Count > 0)
{
for (int i = 0; i < dtimages.Rows.Count; i++)
{
Byte[] barr = new Byte[100000];
if (i == 0)
{
barr = (Byte[])dtimages.Rows[0]["Instimg1"];
Session["imagebytes1"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename1 = Convert.ToBase64String(barr);
Session["imagebytes1"] = barr;
}
else
{
}
if (i == 1)
{
barr = (Byte[])dtimages.Rows[0]["Instimg2"];
Session["imagebytes2"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename2 = Convert.ToBase64String(barr);
Session["imagebytes2"] = barr;
}
else
{
}
if (i == 2)
{
barr = (Byte[])dtimages.Rows[0]["Instimg3"];
Session["imagebytes3"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename3 = Convert.ToBase64String(barr);
Session["imagebytes3"] = barr;
}
else
{
}
if (i == 3)
{
barr = (Byte[])dtimages.Rows[0]["Instimg4"];
Session["imagebytes4"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename4 = Convert.ToBase64String(barr);
Session["imagebytes4"] = barr;
}
else
{
}
}
}
}
protected void linkprevious_Click(object sender, EventArgs e)
{
}
|
|
|
|
|
Please remove the duplicate question.
What do you mean by problem? Does your application not run? Does it not compile? Does it explode random objects nearby? You have to be clear about your problem before we can help.
|
|
|
|
|
Hi Pete O'Hanlon! Thanks for your reply. My application is working but the onclick event of the code which I specified is not working. When I click on linkbutton is done not work, even no page refresh.
|
|
|
|
|
If the LinkButton isn't working, it means that you haven't hooked it up to the UI. You need to add this in the ASPX/ASCX page. BTW, you should have asked this in the ASP.NET forum.
As another point, that declaration of i in the first method is completely redundant. It's a local variable, and you do a test and increment/decrement based on the results. The test is completely pointless.
|
|
|
|
|
Hi. There is a problem in my coding to display various images on linkbutton click. please correct it.. Thanks in advance.
protected void linknext_Click(object sender, EventArgs e)
{
int i = 0;
if (i > 4)
{
i--;
}
if (i < 4)
{
i++;
}
Loadinstituteimages();
}
private void Loadinstituteimages()
{
string instid = Request.QueryString["instid"].ToString();
string sqlqry = "select Instimg1, Instimg2, Instimg3, Instimg4 from InstituteDetails where instid='" + instid + "'";
DataTable dtimages = SqlHelper.Instance.GetTableByQuery(sqlqry);
if (dtimages.Rows.Count > 0)
{
for (int i = 0; i < dtimages.Rows.Count; i++)
{
Byte[] barr = new Byte[100000];
if (i == 0)
{
barr = (Byte[])dtimages.Rows[0]["Instimg1"];
Session["imagebytes1"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename1 = Convert.ToBase64String(barr);
Session["imagebytes1"] = barr;
}
else
{
}
if (i == 1)
{
barr = (Byte[])dtimages.Rows[0]["Instimg2"];
Session["imagebytes2"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename2 = Convert.ToBase64String(barr);
Session["imagebytes2"] = barr;
}
else
{
}
if (i == 2)
{
barr = (Byte[])dtimages.Rows[0]["Instimg3"];
Session["imagebytes3"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename3 = Convert.ToBase64String(barr);
Session["imagebytes3"] = barr;
}
else
{
}
if (i == 3)
{
barr = (Byte[])dtimages.Rows[0]["Instimg4"];
Session["imagebytes4"] = barr;
instimage.Src = "data:image/png/jpg/jpeg;base64," + Convert.ToBase64String(barr);
string imagename4 = Convert.ToBase64String(barr);
Session["imagebytes4"] = barr;
}
else
{
}
}
}
}
protected void linkprevious_Click(object sender, EventArgs e)
{
}
|
|
|
|
|
|
Hi,
I am new to C#, but have 20 years experience in CPP/MFC.I use Visual Studio Express for Web developers 2012 I started a Starter App to give a basic website. The Logging In procedure provided as default is already unsuitable. The website is intended to manage a User/Dealer network. Only Dealers can appoint Sub Dealers, or register customers. Self Registration isimpossible. Dealers and Customers can have multiples of Users(Which are Persons with aname, Passwords and Roles, etc.),Customers are in principle organisations in this model, which requires humans to run it. No Customer or User is required to declare any email address. Dealers are different. I know How to write code that implements this. The question is how to integrate this with webmatrix.
Later on I will have to produce 'User Licence Files' These are files I produced using a fairly basic encryption system. (XOR with a known block, and transpose).It has worked quite well, and there is a substantial code base out in the world that depends on this licence format.
In MFC I stored all this in a C Structure (packed to byte alignment). Do the C# and C++ structures align. Do allignment pragma's exist in C#, How does C# allign DWORDS.(Big End, Little End, or Machine Dependent)
Thanks
Bram
Bram van Kampen
|
|
|
|
|
|
Hi,
well, you live and learn. In the MFC forum,the weekend was historically a good time to ask a question. I followed your link. I do not understand how it can possibly be relevant to my question. Please Explain.
Bram van Kampen
|
|
|
|
|
I don't see a good reason to use WebMatrix here. You should probably stick to ASP.NET alone.
Bram van Kampen wrote:
In MFC I stored all this in a C Structure (packed to byte alignment). Do the C# and C++ structures align. Do allignment pragma's exist in C#, How does C# allign DWORDS.(Big End, Little End, or Machine Dependent) In C#, you can add a StructLayout attribute and with a kind Explicit to the structure. Something like,
[StructLayout(LayoutKind.Explicit)]
public struct Example
{
[FieldOffset(0)]
public int foo;
[FieldOffset(4)]
public int bar;
} This allows you to take finer control over alignment.
If you write a wrapper to your native code in C++/CLI, you don't have to worry about structure alignment in C#. Just work with managed objects.
Best wishes,
Navaneeth
|
|
|
|
|
Hi,
Many Thanks.
Sorry for rounding on you, but, you gave a good sensible answer.
Well an Good.
The C# system I'm faced with, generates dozens of files, and lengthy tutorials. Unlike MFC, it does not appear to have a meaningful Help System. If I double Click a 'System' class name and press F1, I get a list of Tutorials(if anything at all) instead of a Help file which explains the class, and what methods are available.
There is no short explanation anywhere I can find,about which file does what, or how it glues together. It is to me totally unclear whether to start a Website or a Project. Does a Project contain many Websites, or does a Website contain many projects. What is the format of the End Product. An .exe or .dll file,as in MFC, a .cgi File, or what else.
I fully understand Machine code and assembler code. I am fully aware how the CPP Compiler and Linker work, and how the lot comes together at run time. MFC has Header Filesand Libraries, and pragma's to include a DLL. It istotally unclear to me what happensin C#,
The Bottom line is, I need to know how it works, rather than yet another tutorial on how to do something trivial.
Can you help me on this.
Regards
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: The C# system I'm faced with, generates dozens of files, and lengthy tutorials. Unlike MFC, it does not appear to have a meaningful Help System. If I double Click a 'System' class name and press F1, I get a list of Tutorials(if anything at all) instead of a Help file which explains the class, and what methods are available.
System is not a class but a namespace .
I never used to look for local help instead always check in online MSDN. They are pretty good and well documented. Try this[^]Bram van Kampen wrote: There is no short explanation anywhere I can find,about which file does what, or how it glues together. It is to me totally unclear whether to start a Website or a Project. Does a Project contain many Websites, or does a Website contain many projects. What is the format of the End Product. An .exe or .dll file,as in MFC, a .cgi File, or what else. A project can contain several C# files which will be compiled together. Output of the compilation depends on the type of project created. If the type is a class library, you get a DLL and an executable file when the project type is Console or Windows or WPF application.
Usually, you will start with creating an empty solution. Then add projects into the solution. So all the componenets in your project can be separate Visual studio projects contained in a single solution file (.sln). Now you can specify the project dependencies and how they reference each other. Let us assume that you are building a website. You will create an empty solution, add a class library to it which contains your websites core logic which don't have any dependencies with web related components. This project could contain wrapper classes to your C++ library. Then you can add a ASP.NET project to the solutuion wich references the assembly from the class library project. Bram van Kampen wrote:
I fully understand Machine code and assembler code. I am fully aware how the CPP Compiler and Linker work, and how the lot comes together at run time. MFC has Header Filesand Libraries, and pragma's to include a DLL. It istotally unclear to me what happensin C#, In C# it is simple. No header files. Just a bunch of files which has classes defined in it. Compiler will compile all the files and generate the output depending on the project type. To use a class, you don't have to include any file like you do for header files. .NET managed assemblies will have class metatdata which is used to resolve classes. Bram van Kampen wrote:
The Bottom line is, I need to know how it works, rather than yet another tutorial on how to do something trivial. It is better if you get couple of .NET and C# books and learn from it. There is a lot and probably can't answer in such detail here.
Once you get a hang of how things are working, you could check my Blog post[^] which will explain how you can reuse your C++ code in C#.
Best wishes,
Navaneeth
|
|
|
|
|